Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Dec 2002 23:45:56 -0500 (EST)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Garrett Wollman <wollman@lcs.mit.edu>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern syscalls.master
Message-ID:  <Pine.NEB.3.96L.1021229234028.80032A-100000@fledge.watson.org>
In-Reply-To: <20021230153107.P44771-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Mon, 30 Dec 2002, Bruce Evans wrote:

> You don't have to follow it, since it is not a standard. 
> 
> Please don't add to the verbosity by prefixing 2 underscores.  Until
> 4.4BSD/FreeBSD-2 there were no function names in syscalls.master with
> any leading underscores.  _exit(2) might have had just one but had none. 
> 4.4BSD added __sysctl().  Now there are __semctl(), __getcwd(),
> __setugid(), , and a slew of names beginning with __acl, __cap and
> __mac.  Libraries may need lots of underscores for their critical entry
> points for technical reasons, but kernels don't. 

The reason we have library wrappers around many of these calls is that the
draft standard defined a set of functions that could return opaque types
that are typically implemented using structures.  I.e., the document has
acl_get_file() return acl_t, which is implemented as a struct acl on most
systems I know of.  Since the kernel isn't in the business of allocating
userland memory as anything other than pages, we have a wrapper that
performs the allocation, then allows the kernel to fill in the allocated
structure.  We named the actual system call itself using __foo() to get it
out of the application namespace, since the POSIX.1e functions are in fact
library calls on FreeBSD.

Because acl_t is opaque and we may change the underlying structure, we
ended up putting in wrappers for all of the ACL-related system calls.
Right now, struct ACL has a fixed-length array of ACL entries in it.  In
the future, we may make that variable length, which can be done using the
current layout without breaking the ABI, but requires different libc
behavior.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert@fledge.watson.org      Network Associates Laboratories


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1021229234028.80032A-100000>