[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Getting a file_t from a file descriptor (was: Tiny error w.r.t. change f
Getting a file_t from a file descriptor (was: Tiny error w.r.t. change from 2005-12-05)
Thu, 20 Jul 2006 18:35:39 +0200
[Cced to bug-hurd.]
On Thu, Jul 20, 2006 at 08:45:37AM -0700, Paul Eggert wrote:
> Thanks for the fix.
Sure, sure. :-)
> By the way, is there some way in the Hurd to change the author of a
> file, given only its Unix file descriptor? I'd like to fix the FIXME
> about 5 lines before your fix, as that problem leads to a potential
> race condition. I'd appreciate any info you can provide for how to
> map a Unix file descriptor to a Hurd file_t.
While I'm not that proficient in these issues, is this what you're
/* Return the io server port for file descriptor FD.
This adds a Mach user reference to the returned port.
On error, sets `errno' and returns MACH_PORT_NULL. */
extern io_t __getdport (int fd), getdport (int fd);
Used e.g. like this:
mach_port_t fds; /* File descriptors passed. */
for (i = 0; i < 3; i++)
fds[i] = getdport (i);
Please tell if you (or anyone else, of course) need access to a GNU/Hurd
- Getting a file_t from a file descriptor (was: Tiny error w.r.t. change from 2005-12-05),
Thomas Schwinge <=