Commit Graph

5 Commits

Author SHA1 Message Date
Peter Wemm
eabc04d472 Adjust the syscall stub macros to be consistent in their meaning. In
particular:
SYSCALL() makes a syscall, with errno handling, and continues execution
directly after the macro in the non-error case.
RSYSCALL() is just like SYSCALL(), but returns after success.
Both SYSCALL(name) and RSYSCALL(name) export  "__sys_name" as a strong
symbol, with "_name" and "name" as weak aliases.
PSEUDO() is just like RSYSCALL(), but skipping the "name" weak alias.  It
still does "__sys_name" and "_name".

Change i386 to add errno handling to PSEUDO.  The same for amd64 and
sparc64, with appear to have copied the behavior.
ia64 was correct (as was alpha).  Just remove some apparently unused
variants of the macros. (untested!)
I believe powerpc is correct.
Fix arm to not export "name" from the PSEUDO case.  Remove apparently
extra unused variants.  (untested!)

The errno problem manifested on i386/amd64/sparc64 by having "PSEUDO"
classified syscalls return without setting errno.  eg: "addr = mmap()"
could return with "addr" = 22 instead of setting errno to 22 and
returning -1.

Approved by: re (kensmith)
2007-07-04 23:18:38 +00:00
David E. O'Brien
1114a754ed Fix the style of the SCM ID's.
I believe have made all of libc .h's as consistent as possible.
2002-03-22 23:42:05 +00:00
Daniel Eischen
c37592a194 Clean up syscall generation in libc by removing HIDDEN_SYSCALLS
and treating (almost) all system calls the same way:

	__sys_foo - actual syscall
	foo, _foo - weak definitions to __sys_foo

Change PSEUDO syscalls (currently only _exit and _getlogin) to
be __sys_foo (T) and _foo (W).

Add $FreeBSD$ to a few files to satisfy commitprep.

Suggested by:	bde
2001-01-29 03:23:46 +00:00
Daniel Eischen
d201fe46e3 Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions.  If the threads library is linked in, the real
pthread functions will pulled in.

Use the following convention for system calls wrapped by the
threads library:
	__sys_foo - actual system call
	_foo - weak definition to __sys_foo
	foo - weak definition to __sys_foo

Change all libc uses of system calls wrapped by the threads
library from foo to _foo.  In order to define the prototypes
for _foo(), we introduce namespace.h and un-namespace.h
(suggested by bde).  All files that need to reference these
system calls, should include namespace.h before any standard
includes, then include un-namespace.h after the standard
includes and before any local includes.  <db.h> is an exception
and shouldn't be included in between namespace.h and
un-namespace.h  namespace.h will define foo to _foo, and
un-namespace.h will undefine foo.

Try to eliminate some of the recursive calls to MT-safe
functions in libc/stdio in preparation for adding a mutex
to FILE.  We have recursive mutexes, but would like to avoid
using them if possible.

Remove uneeded includes of <errno.h> from a few files.

Add $FreeBSD$ to a few files in order to pass commitprep.

Approved by:	-arch
2001-01-24 13:01:12 +00:00
Doug Rabson
94fb7ad620 Initial libc port for ia64. 2000-10-14 17:01:12 +00:00