> The kernel wrappers are there right now.
> The code for the open() system call trap in the kernel
> just calls the kernel's version of openat().
> You are recommending that I do nothing, not even
> modify libc to use the modern/standard *at() interfaces.

No, I was recommending that for "open" and perhaps any other extremely  
well-known thing we leave the sysent thing and the kernel wrapper and  
not do that in libc.  But see below.
>
>> Is there any other benefit only achieved by removing those from the
>> sysent table?  If not, my preference would be to leave 'open' and
>> friends alone for now, resolving that with kernel function calls
>> instead.  If we reach the point of needing the additional slot  
>> entries
>> freed up by those, that work can be done along with a true man(2)-
>> equivalent syscall provider.
>
> How about truth in advertising?

We have that, that's why we do only what is in the sysent table, and  
don't have aliases and illusions.  The only ways to do this are to  
either describe the sysent table as it is (what we do now), or to  
describe the provider as the set of syscalls in section (2) man pages  
(what we hope to do in the grand fullness of time, as I described in  
the previous e-mail).

> Are you aware that nothing calls the fork() system call trap anymore?
> The code for fork() and forkall() in libc invokes the forksys() system
> call trap, even though the fork1() and forkall() system call traps are
> still there in the kernel.  Anyone doing:
>    syscall::fork1
>    syscall::forkall
> will be puzzled that they see no forks.

Yes, we know.

> Also, in the current system there are two ways to open a file:
>    open(path, oflags, mode)
>    openat(dirfd, path, oflags, mode)
> (where dirfd can be AT_FDCWD to behave the same as open())
> Anyone doing:
>    syscall::open
>    syscall::open64
> will miss all of the opens executed via openat().
> (tar, cpio, pax, rm, cp/ln/mv, nftw(), attropen(), all call openat())
>
> And the openat() system call trap is currently a subcode of the
> generalized SYS_fsat system call trap number, so you can't do:
>    syscall::openat
>    syscall::openat64
> You would have do do some convoluted operation involving:
>    syscall::fsat*
>
> Likewise for all of the subcodes of SYS_fsat:
> * 0 - openat
> * 1 - openat64
> * 2 - fstatat64
> * 3 - fstatat
> * 4 - fchownat
> * 5 - unlinkat
> * 6 - futimesat
> * 7 - renameat
> * 8 - faccessat
>
> My new code breaks these subcodes out into individual system call
> traps and eliminates the SYS_fsat trap number, so you can do:
>    syscall::openat
>    syscall::openat64
> and likewise for all of the other *at() interfaces.
>
> Roger

That's certainly an improvement, given the current state of things.

-Mike

---
Mike Shapiro, Sun Microsystems Open Storage / Fishworks. blogs.sun.com/mws/

Reply via email to