>Does anyone know when the new POSIX-draft versions of |mkdirat()|&co.
>(e.g |mkdirat()|, |faccessat()|, |fchmodat()|, |fchownat()|,
>|fstatat()|, |linkat()|, |mknodat()|, |openat()|, |symlinkat()|,
>|unlinkat()|, |utimensat()|) will be available in Solaris (AFAIK these
>functions were added to the Linux kernel with release "2.6.16" (per
>http://www.die.net/doc/linux/man/man2/mkdirat.2.html)) ?
>We're currently working in threading support for an application and will
>need such functions to make sure any operation of one thread doesn't
>affect others (the only workaround is to turn eveything into absolute
>paths which will become tricky in other situations...).

Not until it's clear there is a consensus about the functiosn.

Some of these had already been added in Solaris 2.6, I think,
where they originate.

For now we have:

        fchownat
        fstatat
        futimesat
        unlinkat
        openat
        __accessat      (which was added waiting for the final
                         POSIX standard)
        renameat

These functions are relatively straightforward to implement in the
kernel and it is probably best to implement what is missing as private
functions untile the standard has gravitated toward consensus.

There's some discussion about the 'f' argument.

Note, though, that much of the *at functions can be implemented as
follows:

int
fchownat(int fd, const char *path, uid_t owner, gid_t group, int flag)
{
        char *buf;
        size_t len = snprintf(buf, 0, "/proc/self/fd/%d/%s", fd, path);
        buf = alloca(len + 1);
        (void) snprintf(buf, len + 1, "/proc/self/fd/%d/%s", fd, path);

        if (flag == SYMLNK) {
                return (lchown(buf, owner, group));
        else {
                return (chown(buf, owner, group));
        }
}

Casper
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to