9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] Passing a file descriptor between processes
Date: Fri,  5 Nov 2010 06:58:33 -0400	[thread overview]
Message-ID: <3c5bbf46c1bea0e36235f391b63b969f@plug.quanstro.net> (raw)
In-Reply-To: <20101105102946.GA12171@shutemov.name>

On Fri Nov  5 06:32:55 EDT 2010, kirill@shutemov.name wrote:
> One of the ugliest interface in Unix is passing a file descriptor between
> processes [1]. Does Plan9 provide any mechanism for it?
>
> [1] http://book.chinaunix.net/special/ebook/addisonWesley/APUE2/0201433079/ch17lev1sec4.html

there is no mechanism similar to sending fds over a socket.
the two ways of file descriptor sharing are via
(a) rfork(2); and
(b) srv(3)

rfork (optionally) allows a process to share a file descriptor
table with a child process.  srv allows a process to post a file
descriptor by a given name in /srv.  the normal file operations
apply on that file.  in particular, it must be opened
before use.

- erik



  parent reply	other threads:[~2010-11-05 10:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-05 10:29 Kirill A. Shutemov
2010-11-05 10:57 ` Lucio De Re
2010-11-05 10:58 ` erik quanstrom [this message]
2010-11-05 11:03 ` roger peppe
2010-11-05 11:41   ` erik quanstrom
2010-11-05 12:16     ` Venkatesh Srinivas
2010-11-05 12:21       ` erik quanstrom
2010-11-05 21:40         ` Skip Tavakkolian
2010-11-05 12:27       ` Lucio De Re

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=3c5bbf46c1bea0e36235f391b63b969f@plug.quanstro.net \
    --to=quanstro@quanstro.net \
    --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).