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.