From: cinap_lenrek@gmx.de
To: 9fans@9fans.net
Subject: Re: [9fans] native (mostly) go for plan9
Date: Mon, 31 Oct 2011 23:47:32 +0100 [thread overview]
Message-ID: <39af85b31163336146dbce1dd8364418@gmx.de> (raw)
In-Reply-To: <d5d05362e0a7b827b56761a2c06d519b@chula.quanstro.net>
for 9front page, i wrote a function that implements inferno
style pctl filedescriptor passing. basicly, you fork and then give
it a list of filedescriptors you want in the process like:
dupfds(foofd, 1, 2, -1); // redirect foofd to stdin of this process, keep stdout/stderr
all the other filedescriptors get closed so you wont leak
any fds.
i find this style mutch cleaner than flags on filedescriptors.
here i say exactly what i want at the time of the exec/fork
instead of having to worry about it in some random place where
i open it.
the implementation uses /fd to figure out what filedescriptors
are open.
a kernel based version of this would be nice :)
--
cinap
next prev parent reply other threads:[~2011-10-31 22:47 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-31 15:11 ron minnich
2011-10-31 16:41 ` Stanley Lieber
2011-10-31 16:51 ` andrey mirtchovski
2011-10-31 17:08 ` ron minnich
2011-10-31 17:30 ` Stanley Lieber
2011-10-31 17:41 ` andrey mirtchovski
2011-10-31 17:44 ` ron minnich
2011-10-31 17:45 ` Stanley Lieber
2011-10-31 17:50 ` ron minnich
2011-10-31 19:23 ` Stanley Lieber
2011-10-31 19:32 ` ron minnich
2011-10-31 19:44 ` Stanley Lieber
2011-10-31 19:48 ` ron minnich
2011-10-31 21:01 ` ron minnich
2011-10-31 22:10 ` Skip Tavakkolian
2011-10-31 22:17 ` ron minnich
2011-10-31 22:34 ` Bakul Shah
2011-10-31 22:38 ` ron minnich
2011-10-31 22:21 ` ron minnich
2011-11-01 10:20 ` Charles Forsyth
[not found] ` <CAP6exYJ8MQdcRa1vofMVjgaFK0Xu-po4eZBOOb>
[not found] ` <CAP6exYJf1UKFdpeXyFXRt0Y7hPc=Hyq7oBdvi9uX3Z7+FQbxsA@mail.gmail.c>
2011-10-31 22:24 ` erik quanstrom
2011-10-31 22:34 ` cinap_lenrek
2011-10-31 22:44 ` erik quanstrom
2011-10-31 22:47 ` cinap_lenrek [this message]
[not found] ` <CAP6exYKue2e7NWx07+RMNDs38aXex0y9urfT6eT1LKbjvvA_yw@mail.gmail.c>
2011-10-31 22:46 ` erik quanstrom
2011-11-01 10:41 ` Yaroslav
2011-11-01 16:57 ` Skip Tavakkolian
2011-11-01 17:26 ` ron minnich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39af85b31163336146dbce1dd8364418@gmx.de \
--to=cinap_lenrek@gmx.de \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).