Re: pad argument for mmap/lseek/etc.

From: Matthew Dillon <dillon_at_apollo.backplane.com>
Date: Wed, 10 Oct 2007 16:05:47 -0700 (PDT)
:> > of fixing them in whole kernel.
:> 
:> I also support this idea... does anyone have an argument against or should I
:> just provide a patch (removing those definitions)
:
:Many people (myself included) find it handy to have the uap structure 
:definition with the function.
:
:-- 
:John Baldwin

    What I did in DragonFly a long time ago was remove the #ifdef and struct
    defintion entirely and simply put the UAP arguments in comments.  i.e.:

/*
 * umount_args(char *path, int flags)
 */
/* ARGSUSED */
int
sys_unmount(struct unmount_args *uap)
...

/*
 * mmap_args(void *addr, size_t len, int prot, int flags, int fd,
 *              long pad, off_t pos)
 */
...
int
sys_mmap(struct mmap_args *uap)
...


    I had found that not only were the structure definitions out of date,
    there were many system calls that didn't have them at all as well as
    other inconsistencies.

    I also prefixed all system call procedure definitions in the kernel
    with 'sys_' which got rid of most of the conflicts between kernel
    function names and standard library headers.  That was so the virtual
    kernel could link against libc but even without a vkernel build I
    think it's a good idea to get rid of the conflicts.

						-Matt
Received on Wed Oct 10 2007 - 21:16:38 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:19 UTC