tech-kern archive

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

Re: openat/fstatat functions implementation



In article <20091004205422.GR16561%snowdrop.l8s.co.uk@localhost>,
David Laight  <david%l8s.co.uk@localhost> wrote:
>On Sun, Oct 04, 2009 at 02:30:20AM +0100, Mindaugas Rasiukevicius wrote:
>> Adam Hamsik <haaaad%gmail.com@localhost> wrote:
>> > > Here is last version of openat/fstatat diff I have written atf tests  
>> > > for it and tested my patch by doing build(checks namei) and zfs 
>> > > (checks openat/fstatat) + atf tests. Both cases were working. Can  
>> > > put these syscalls in ?
>> > 
>> > As usual I forgot to attach patch file here is it
>> 
>> I still think that we should not start spreading *at() syscalls, but rather
>> have one syscall to handle them.  While it is pointless to dholland, I would
>> say it is a better structure and would probably reduce some code duplication.
>
>Why not, it is just a matter of how a 'name' is attached to the kernel
>code.  Syscall numbers aren't a restricted space, so one per entry point
>isn't a problem. Any additional form of multiplexing is just pointless
>complication.
>
>As well as the linux socket syscall, there is also the complete fubar
>of the was SCTP overloads setsockopt()!

Here's a provisional list... I don't really understand why some syscalls
are prefixed with f, why some have flags where others don't (why fchmodat
has flags and futimesat doesn't?)

int openat(int dfd, const char *path, int flags, mode_t mode);
int faccessat(int dfd, const char *path, int mode, int flags);
int fchmodat(int dfd, const char *path, mode_t mode, int flags);
int fchownat(int dfd, const char *path, uid_t uid, gid_t gid, int flags);
int fstatat(int dfd, const char *path, struct stat *, int flags);
int futimesat(int dfd, const char *path, const struct timeval times[2]);
int linkat(int odfd, const char *opath, int ndfd, const char *npath, int flags);
int mkdirat(int dfd, const char *path, mode_t mode);
int mknodat(int dfd, const char *path, mode_t mode, dev_t dev);
int readlinkat(int dfd, const char *path, char *buf, size_t bufsiz);
int renameat(int odfd, const char *opath, int ndfd, const char *npath);
int symlinkat(const char *opath, int ndfd, const char *npath);
int unlinkat(ind dfd, const char *path, int flags);
int mkfifoat(int dfd, const char *path, mode_t mode);

I think there was not enough time spent designing those syscalls.

christos



Home | Main Index | Thread Index | Old Index