[Cced to bug-hurd.]
Hello!
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
looking for?
<hurd.h>
#v+
[...]
/* 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);
[...]
#v-
Used e.g. like this:
[hurd]/utils/login.c
#v+
[...]
mach_port_t fds[3]; /* File descriptors passed. */
[...]
for (i = 0; i < 3; i++)
fds[i] = getdport (i);
[...]
#v-
Please tell if you (or anyone else, of course) need access to a GNU/Hurd
system.
Regards,
Thomas
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils