Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Aug 2014 18:41:50 +0000 (GMT)
From:      Steven Stewart-Gallus <sstewartgallus00@mylangara.bc.ca>
To:        freebsd-hackers@freebsd.org
Subject:   Can anyone help clarify details about the FreeBSD system call interface?
Message-ID:  <fb4bf68f53c5.53ff77ee@langara.bc.ca>

next in thread | raw e-mail | index | archive | help
Hi, I am interested in learning more about how FreeBSD works.  I have
gathered some information on some of FreeBSD's undocumented system
calls and am not sure it is correct.  Please correct me if I am wrong
about the following system calls.  I would be happy to submit some
patches to help out with documentation after I get some confirmation
and clarification.

 int sys_yield(void);
 int sys_sched_yield(void);

Not sure how sys_yield differs from sched_yield.  sys_yield is defined
in sys/kern/kern_synch.c and sys_sched_yield is defined in
sys/kern/p1003_1b.c.

 int sys_sstk(int incr);

sys/vm/vm_mmap.c defines this as:

 /*
  * MPSAFE
  */
 /* ARGSUSED */
 int
 sys_sstk(td, uap)
     struct thread *td;
     struct sstk_args *uap;
 {
     /* Not yet implemented */
     return (EOPNOTSUPP);
 }

Did sys_sstk use to do something in the past and is now just legacy?

 int sys_vadvise(int anom);

sys/vm/vm_unix.c defines this as:

/*
 * MPSAFE
 */
/* ARGSUSED */
int
sys_ovadvise(td, uap)
    struct thread *td;
    struct ovadvise_args *uap;
{
    /* START_GIANT_OPTIONAL */
    /* END_GIANT_OPTIONAL */
    return (EINVAL);
}

Did sys_vadvise use to do something in the past and is now just
legacy?

int sys_mac_syscall(const char * policy, int call, void * arg);

Not sure what sys_mac_syscall does.  Seems to do a bunch of MAC
operations at once.  See sys/security/mac for a closer look.

int sys___mac_execve(char * fname, char ** argv, char ** envv, struct
                     mac * mac_p);

Looks an execve that applys a MAC policy.  See sys/security/mac for a
closer look.

int sys__umtx_lock(struct umtx * umtx);
int sys _umtx_unlock(struct umtx * umtx);
int sys__umtx_op(void * obj, int op, u_long val, void * uaddr1, void *
                 uaddr2);

Seems to implement low level mutexes.  See sys/kern/kern_umtx.c for a
closer look and lib/libthr/thread/umtx.h for the userspace wrapper.

int sys_nlm_syscall(int debug_level, int grace_period, int addr_count,
                    char ** addrs);

Multiplexes system calls used to implement the kernel side of the
Network Lock Manager protocol.  See sys/nlm for a closer look.

int sys_nnpfs_syscall(int operation, char * a_pathP, int a_opcode,
                      void * a_paramsP, int a_followSymlinks);

Multiplexes system calls used to implement the kernel side of some
filesystem thingy.  Not sure what it does.  I can't find out where
this is defined in the source code.

int sys_afs3_syscall(long syscall, long parm1, long parm2, long parm3,
    	             long parm4, long parm5, long parm6);

Multiplexes system calls used to implement the kernel side of the AFS
protocol (version 3).  I can't find out where this is defined in the
source code.

Thank you,
Steven Stewart-Gallus




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fb4bf68f53c5.53ff77ee>