Re: openat()

From: Jeff Garzik
Date: Thu Nov 10 2005 - 02:41:02 EST


dean gaudet wrote:
On Wed, 9 Nov 2005, Ulrich Drepper wrote:


Can we please get the openat() syscall implemented? I know Linus already
declared this is a good idea and I can only stress that it is really essential
for some things. It is today impossible to write correct code which uses long
pathnames since all these operations would require the use of chdir() which
affect the whole POSIX process and not just one thread. In addition we have
the reduction of race conditions.


oh sweet i've always wanted this for perf improvements in multithreaded programs which have to deal with lots of lookups deep in a directory tree (especially over NFS).

would this include other related syscalls such as link, unlink, rename, chown, chmod... so that the the virtualization of the "current working directory" concept is more complete?

You already have fchown(2) and fchmod(2), that's covered.

I'm interested in openat(2) for the race-free implications. I've been working on a race-free coreutils replacement[1], targetted mainly at Linux. Being able to key an operation off of an open file descriptor eliminates the few remaining races inherent in the Linux filesystem ABI.

The remaining race cases are all cases where the the syscall takes a pathname, when it really should take a pathname and an fd.

Jeff



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/