From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 28 19:41:56 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC5F4A05 for ; Thu, 28 Aug 2014 19:41:56 +0000 (UTC) Received: from message.langara.bc.ca (message.langara.bc.ca [142.35.159.25]) by mx1.freebsd.org (Postfix) with ESMTP id D22F517CE for ; Thu, 28 Aug 2014 19:41:56 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-disposition: inline Content-type: text/plain; charset=us-ascii Received: from langara.bc.ca ([127.0.0.1]) by message.langara.bc.ca (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) with ESMTP id <0NB100BPE59QC7E0@message.langara.bc.ca> for freebsd-hackers@freebsd.org; Thu, 28 Aug 2014 11:41:50 -0700 (PDT) Received: from [38.108.87.20] by message.langara.bc.ca (mshttpd); Thu, 28 Aug 2014 18:41:50 +0000 (GMT) From: Steven Stewart-Gallus To: freebsd-hackers@freebsd.org Message-id: Date: Thu, 28 Aug 2014 18:41:50 +0000 (GMT) X-Mailer: Sun Java(tm) System Messenger Express 6.3-6.03 (built Mar 14 2008; 32bit) Content-language: en Subject: Can anyone help clarify details about the FreeBSD system call interface? X-Accept-Language: en Priority: normal X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Aug 2014 19:41:57 -0000 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