Openat() and fexecve() committed



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: pgpX6bbYZXzSV.pgp
Description: PGP signature



Relevant Pages

  • Re: Is anything else then Solaris used on UltraSparc Machines.
    ... They are just not there right now, just like Linux isn't there ... scalability, real-time support, standards compliance, volume ... > Sure there is a lot of pre-packaged software of Solaris, ... but it is often more hassle on Solaris (even SPARC). ...
    (comp.unix.solaris)
  • Re: Is anything else then Solaris used on UltraSparc Machines.
    ... > familiar with Solaris. ... The same thing cannot be said for Linux. ... Solaris x86 seems better with more expensive hardware whereas Linux ... it for Solaris (SPARC). ...
    (comp.unix.solaris)
  • Re: Is anything else then Solaris used on UltraSparc Machines.
    ... > I think there are good reasons for using Linux in place of Solaris ... The same thing cannot be said for Linux. ... Solaris x86 seems better with more expensive hardware whereas Linux ... it for Solaris (SPARC). ...
    (comp.unix.solaris)
  • Re: Linux Advocates Fear Solaris 10.
    ... >> will want, and will get, with Linux and repositories of GPL software. ... Solaris has 95% of Linux ... Okay, so take OUT the Linux compatibility layer, and any of the GPL ... SUN, however, can 'open source' their Solaris, package a shitload of GPL ...
    (comp.unix.solaris)
  • Re: Why is SUN falling so far behind IBM?
    ... > x86 delivery to be later than Linux. ... > communicated from day one that JDS was a solution that ran on ... substantial lead over Solaris in the x86 world. ... > great success with the Sun Rays and Sun Blades running the JDS stack. ...
    (comp.unix.solaris)