From owner-cvs-all Sun Dec 29 20:45:58 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 297BE37B401; Sun, 29 Dec 2002 20:45:57 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F0EA43EC5; Sun, 29 Dec 2002 20:45:56 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.12.6/8.12.5) with SMTP id gBU4ju1Z081209; Sun, 29 Dec 2002 23:45:56 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Sun, 29 Dec 2002 23:45:56 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Bruce Evans Cc: Garrett Wollman , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern syscalls.master In-Reply-To: <20021230153107.P44771-100000@gamplex.bde.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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