Re: *at syscalls for xattrs?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > 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);

If you only have a single thread, yes.

The *at() thing basically gives you the advantages of a CWD without
the disadvantages.

For example it could be useful to implement the functionality of
find(1) as a library interface.

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux