bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Openat first step passfd api


From: Paul Eggert
Subject: Re: Openat first step passfd api
Date: Wed, 02 Feb 2011 10:47:24 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

On 02/02/11 09:48, Bastien ROUCARIES wrote:
> I use emac, could you give me the style used or indent command line ? Thank 
> you

Please see the existing Gnulib code for examples of
the style, for example, lib/openat.c.  It is documented in
<http://www.gnu.org/prep/standards/html_node/Formatting.html>.


> No long lived see the test file. For old linux, I will not use this
> but clone with CLONE_VM,!CLONE_FS,CLONE_FILES,CLONE_SIGHAND so it will
> be faster than fork and without calling sendfd

OK, thanks, I think I understand: you want openat to fork a
child that will do the chdir and the work, send
the fd back to the parent, and immediately exit.
Presumably there will also be a way for the child to report errno for
failed 'open' as well.  This removes my objection about long-lived
processes.

Still, I see a couple of problems that you might want to think
about.

Offhand I don't see how to use this approach to
implement functions like 'renameat', which in some
cases require two working-directory file descriptors.  Perhaps
these functions should be modified to use the above approach
on one of the file descriptors, while using the current approach
on the other?

Also, what happens if there's a signal in the middle of the
emulated 'openat'?  Won't this leak file descriptors?  A leak
like that might be acceptable, but should be documented.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]