Date: Mon, 31 Mar 2008 18:30:06 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: current@freebsd.org Subject: Openat() and fexecve() committed Message-ID: <20080331153006.GK21209@deviant.kiev.zoral.com.ua>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
This is a notice for the list that the implementation of the openat(2)
and accompanied syscalls, among them fexecve(2), as specified in The
Open Group document titled "Extended API Set Part 2", is committed today
into the HEAD. Besides (now) FreeBSD, the functionality is implemented
on Linux, and I believe that it originated on Solaris.
The work was started as GSoC 2007 by Roman Divacky, with the help by
Robert Watson, and this is the first batch of the changes. Further, the
implementation of the fdopendir(), linux compatibility shims and man
pages updates are planned.
There is one known issue with the code. The following test
#define _ATFILE_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
/*
* create /tmp/foo/ and /tmp/foo/bar prior calling this,
* set the access mode a+rx on /tmp/foo
*/
int main() {
int dfd = open("/tmp/foo", O_RDONLY);
int res;
chmod("/tmp/foo", 0666);
if (dfd != -1) {
res = openat(dfd, "bar", 0);
printf("OPENAT returns: %d, errno: %s\n", res, strerror(errno));
}
}
gives the error EACCESS on both Linux and FreeBSD, and succeeds on Solaris.
The Solaris behaviour seems to be specified in the document cited above.
There are arguments in support of the both observed behaviour.
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (FreeBSD)
iEYEARECAAYFAkfxA30ACgkQC3+MBN1Mb4ivIQCeN3jSHfGUp4+Bp8YLnMsHtFNt
66wAoJaoB74PgkhZ61idFu7wjZ/hVPj5
=uwub
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080331153006.GK21209>
