Roger A. Faulkner wrote:
> I am sponsoring this fast-track case for myself.
>
> No external/ABI interfaces are changing, so there is no documentation change.
>
> The release binding is "minor",
> so it can be done in solaris_nevada (Solaris Next, OpenSolaris)
> (this will never be back-ported).
>
> DISCUSSION:
>
> Over the years, a number of system call traps have fallen
> into an unused/obsolete state.  These are never called
> from libc, as in the case of:
>
> /*
>  * Obsolete lwp_mutex_lock() interface, no longer called from libc.
>  * libc now calls lwp_mutex_timedlock(lp, NULL, NULL).
>  * This system call trap continues to exist solely for the benefit
>  * of old statically-linked binaries from Solaris 9 and before.
>  * It should be removed from the system when we no longer care
>  * about such applications.
>  */
> int
> lwp_mutex_lock(lwp_mutex_t *lp)
> {
>         return (lwp_mutex_timedlock(lp, NULL, NULL));
> }
>
> There are cases where two traps do the same thing.
> For example:
>     dup(fd)
> is exactly the same as:
>     fcntl(fd, F_DUPFD, 0)
> The dup() syscall trap can be eliminated in favor of
> fcntl(fd, F_DUPFD, 0) (in dup() as implemented in libc).
>
> PROPOSAL:
>
> The time has come to actually delete these obsolete/redundant
> system call traps from the kernel and free their system call
> numbers for reuse by future, yet-to-be-invented system calls.
>
> The *at() system calls were introduced in Solaris 9:
>         openat()
>         openat64()
>         fstatat()
>         fstatat64()
>         fchownat()
>         unlinkat()
>         renameat()
>         accessat()
> These functions are a super-set of the corresponding traps:
>         open()
>         open64()
>         fstat()
>         fstat64()
>         fchown()
>         unlink()
>         rename()
>         access()
> all of which can be implemented in libc using calls to the
> corresponding *at() system call traps.  There is no need
> to have such duplicate functionality in the system call traps.
>
> Aside: There is a bug fix in the libc open() function that
> did not get implemented in the libc openat() function.
> Such errors are a consequence of having two system call traps
> that perform esentially the same operation.  A bug fix in one
> can be neglected in the other.  There should be only one.
>
> Finally, the *at() system calls were implemented as subcodes
> of a single trap number, SYS_fsat.  These system calls are
> important enough for each to have its own system call trap number.
>
> These old system call traps are already never called from libc.
> They can just be deleted from the kernel:
>
> fork()
> forkall()
> utime()
> utimes()
> futimesat()
> poll()
> lwp_mutex_lock()
> lwp_sema_wait()
> wait()
>
> These system call wrapper functions can be reimplemented in libc as shown
> amd then the old system call traps can be deleted from the kernel:
>
> open(path, flag, ...)   openat(AT_FDCWD, path, flag, ...)
> creat(path, ...)        open(path, O_WRONLY | O_CREAT | O_TRUNC, ...)
> open64(path, flag, ...) openat64(AT_FDCWD, path, flag, ...)
> creat64(path, mode)     open64(path, O_WRONLY | O_CREAT | O_TRUNC, mode)
> unlink(path)            unlinkat(AT_FDCWD, path, 0)
> rmdir(path)             unlinkat(AT_FDCWD, path, AT_REMOVEDIR)
> chown(path, uid, gid)   fchownat(AT_FDCWD, path, uid, gid, 0)
> lchown(path, uid, gid)  fchownat(AT_FDCWD, path, uid, gid, 
> AT_SYMLINK_NOFOLLOW)
> fchown(fd, uid, gid)    fchownat(fd, NULL, uid, gid, 0)
> stat(path, &sb)         fstatat(AT_FDCWD, path, &sb, 0)
> lstat(path, &sb)        fstatat(AT_FDCWD, path, &sb, AT_SYMLINK_NOFOLLOW)
> fstat(fd, &sb)          fstatat(fd, NULL, &sb, 0)
> stat64(path, &sb)       fstatat64(AT_FDCWD, path, &sb, 0)
> lstat64(path, &sb)      fstatat64(AT_FDCWD, path, &sb, AT_SYMLINK_NOFOLLOW)
> fstat64(fd, &sb)        fstatat64(fd, NULL, &sb, 0)
> xstat(vers, path, &sb)  stat(path, &sb)
> lxstat(vers, path, &sb) lstat(path, &sb)
> fxstat(vers, path, &sb) fstat(path, &sb)
> xmknod(vers, path, ...) mknod(path, ...)
> dup(fd)                 fcntl(fd, F_DUPFD, 0)
> rename(oldnam, newnam)  renameat(AT_FDCWD, oldnam, AT_FDCWD, newnam)
> access(fname, amode)    faccessat(AT_FDCWD, fname, amode, 0)
>
> All of this is possible without sacrificing any part of binary
> compatibility due to the Solaris 10 Branded Zone project,
> integrated into onnv-gate in build snv_127.  See:
>
> PSARC 2009/253 S10C
> 6666646 Solaris 10 zones on OpenSolaris binary (supported) distributions
>
> http://hub.opensolaris.org/bin/view/Community+Group+zones/s10brand_dev_guide
>
> As part of deleting old system call traps from the kernel,
> changes must be made to:
>       usr/src/lib/brand/solaris10
> and:
>       usr/src/uts/common/brand/solaris10
> to emulate the deleted system call traps.
>
> Any process running in a Solaris 10 branded zone will see
> a kernel interface identical to that of Solaris 10 itself.
>   

Will this change also be made for the Solaris 8 branded zone?

    - Garrett
> There will be an impact on dtrace(1M) in scripts that assume
> knowledge of the details of the system call trap interfaces.
> For example, instead of:
>     syscall::open
>     syscall::open64
> you have to type:
>     syscall::openat
>     syscall::openat64
> and you also have to change 'arg0' to 'arg1' (for ::openat:entry).
>
> See the bugid:
> 6906485 delete obsolete system call traps
>
> Roger Faulkner
>
>   

Reply via email to