Re: *at syscalls for xattrs?

Jeremy Fitzhardinge
2007-07-16T08:31:51Z

Jan Engelhardt wrote:
> fd1 = open("dir1", O_DIRECTORY):
> fd2 = open("dir2", O_DIRECTORY);
> system("mount -t tmpfs none dir1");
> system("mount -t tmpfs none dir2");
> openat(fd1, "file1", O_RDWR | O_CREAT);
> openat(fd2, "file2", O_RDWR | O_CREAT);
> If you have a better way to accomplish this, let me know. :)
>

This should work:

fchdir(fd1);
open("file1", O_RDWR | O_CREAT);
fchdir(fd2);
open("file2", O_RDWR | O_CREAT);

J