Commit Graph

47 Commits

Author SHA1 Message Date
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
f3e8cfe5ef Comment only change; s/_thread_sys_/__sys_/ 2001-01-26 02:41:07 +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
Jake Burkholder
4231c165f7 Remove last vestiges of thr_sleep and thr_wakeup from libc. 2000-12-02 05:58:03 +00:00
John Baldwin
4f9d9dc272 Remove duplicate FreeBSD id tags. 2000-08-21 21:05:44 +00:00
Peter Wemm
13dfe2f092 Take a shot at implementing a functional rfork_thread() for alpha. This
was not fun and I am not entirely certain of the correctness, but it seems
to work.  (in fact, side by side testing of this code vs the x86 version
turned up hidden bugs in the x86 code).
2000-07-29 11:43:21 +00:00
John Baldwin
bde8875a06 Finish moving all IEEE fp types to be the same on all arch's. 2000-05-10 19:41:40 +00:00
David E. O'Brien
317e99beec Add FreeBSD Id tags. 2000-05-10 19:04:57 +00:00
David E. O'Brien
8d1d19d347 fp_except => fp_except_t for consistancy with the i386 and the tradition
C methoid of nameing types.
2000-05-10 19:00:45 +00:00
Jason Evans
b479399f73 Take care to avoid having "strong" and "weak" symbols of the same name in
libc_r.
2000-03-16 02:14:41 +00:00
Jason Evans
e9a89b2196 Undo the ill-conceived breakage of the previous commit and really fix:
For libc_r renamed syscalls, correct symbol naming from
_thread_sys_foo() <-- _foo() to _thread_sys_foo() <-- _foo() <-- foo().  This
is necessary for system calls which libc_r doesn't define foo().

Some weak symbols such as poll() are defined twice.  From what I understand,
depending on one weak symbol or the other to be used is a bad idea.  All
such weak symbols defined in the libc_r-specific code should therefore be
made strong (non-weak?).

Simplify PSEUDO() to not define any weak symbols, since they aren't ever
needed.

alpha/SYS.h:

Correct reversed usage of WEAK_ALIAS(), which has reversed arguments from
__weak_reference().  Also, fix reversal of symbols, so that syscall foo()
is a weak alias for _foo().

Add WEAK_ALIAS() call to PRSYSCALL(), which unlike the i386 version of
PRSYSCALL(), is not defined in terms of PSYSCALL().

Make PSEUDO() equivalent to the i386 version.
2000-01-29 12:50:47 +00:00
Jason Evans
cabdf9cef3 For syscalls that are renamed to _thread_sys_foo, create a weak alias
called _foo, not _thread_sys_foo.
2000-01-28 22:47:21 +00:00
Jason Evans
9233c4d942 Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo().  In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate.  In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().

Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().

Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().

Make thread cancellation fully POSIX-compliant.

Suggested by:	deischen
2000-01-27 23:07:25 +00:00
Jason Evans
bafd6b2f76 Remove unnecessary alternate entry points for *setjmp(). Make the main
entry point the standard name when not compiling libc_r (for example,
longjmp is the main entry point instead of __longjmp).

Suggested by:	bde
2000-01-20 21:58:27 +00:00
Jason Evans
1c12990b99 Make minor entry point changes to support libc_r. 2000-01-19 07:01:40 +00:00
Bruce Evans
c14cc40662 Fixed corrupted tabs in previous commit. 2000-01-14 15:47:00 +00:00
Jason Evans
ecf6d6cb6d Fix unresolved _libc_*() references in libc by creating weak aliases
to the respective system call entry points.
2000-01-13 09:26:50 +00:00
Jason Evans
929273386f Add three-tier symbol naming in support of POSIX thread cancellation
points.  For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep().  The arrows represent weak aliases.  For
system calls, the pattern is _read() <-- _libc_read() <-- read().
2000-01-12 09:23:48 +00:00
John Polstra
bdf5faebaf In longjmp, call sigreturn instead of osigreturn. The latter isn't
visible from userland any more.

Reviewed by:	luoqi
1999-10-14 01:16:51 +00:00
Marcel Moolenaar
e28ceff6d6 Not needed now the syscall matches the prototype. 1999-10-12 09:38:57 +00:00
Doug Rabson
a51c074b64 Remove old sig* wrappers. 1999-10-09 12:11:31 +00:00
John Polstra
e05d1ffe18 Fix misspelling of the "addq" opcode. 1999-09-29 21:10:25 +00:00
Marcel Moolenaar
3cf3c5d9dd sigset_t change (part 5 of 5)
-----------------------------

Most of the userland changes are in libc. For both the alpha
and the i386 setjmp has been changed to accomodate for the
new sigset_t. Internally, libc is mostly rewritten to use the
new syscalls. The exception is in compat-43/sigcompat.c

The POSIX thread library has also been rewritten to use the
new sigset_t. Except, that it currently only handles NSIG
signals instead of the maximum _SIG_MAXSIG. This should not
be a problem because current applications don't use any
signals higher than NSIG.

There are version bumps for the following libraries:
  libdialog
  libreadline
  libc
  libc_r
  libedit
  libftpio
  libss

These libraries either a) have one of the modified structures
visible in the interface, or b) use sigset_t internally and
may cause breakage if new binaries are used against libraries
that don't have the sigset_t change. This not an immediate
issue, but will be as soon as applications start using the
new range to its fullest.

NOTE: libncurses already had an version bump and has not been
      given one now.

NOTE: doscmd is a real casualty and has been disconnected for
      the moment. Reconnection will eventually happen after
      doscmd has been fixed. I'm aware that being the last one
      to touch it, I'm automaticly promoted to being maintainer.
      According to good taste this means that I will receive a
      badge which either will be glued or mechanically stapled,
      drilled or otherwise violently forced onto me :-)

NOTE: pcvt/vttest cannot be compiled with -traditional. The
      change cause sys/types to be included along the way which
      contains the const and volatile modifiers. I don't consider
      this a solution, but more a workaround.
1999-09-29 15:18:46 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Hidetoshi Shimokawa
d71d50b89c Just return `curbrk' for sbrk(0) to avoid syscall overhead. 1999-06-26 15:22:33 +00:00
Doug Rabson
d4af94988c Declare the return address for __divX, __remX so that gdb can step over
calls properly.
1999-05-02 12:05:09 +00:00
Dmitrij Tejblum
1b30ac5124 Add wrappers for pread and pwrite syscalls. 1999-04-04 21:46:24 +00:00
Doug Rabson
a02290da19 Rename when building libc_r. 1999-03-25 18:43:17 +00:00
Doug Rabson
6b387220be [This is a null commit to supply the correct log entry]
Rename 'cerror' to '.cerror' so that programs which have a function or
global variable named 'cerror' don't completely break the syscall error
reporting mechanism.
1998-12-23 11:55:42 +00:00
Doug Rabson
b7f762137a Implement fpsetmask() and other fp*() functions. Programs should use
#include <ieeefp.h>

to access these functions instead of the i386 specific

	#include <machine/floatingpoint.h>

Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1998-12-23 11:50:52 +00:00
John Birrell
b6776b7488 CALL -> PCALL for sigaltstack for libc_r. 1998-12-10 20:36:24 +00:00
Dmitrij Tejblum
deb9688ae1 In libc_r, rename vfork syscall to _thread_sys_vfork and make vfork an alias
to fork. It is difficult to do real vfork in libc_r, since almost every
operation with file descriptsor changes _thread_fd_table and friends.

popen(3) works much better with this change.
1998-09-12 22:03:20 +00:00
John Birrell
b4869285da Remove support for NetBSD syscalls. 1998-08-17 03:46:10 +00:00
John Birrell
4f27f01e1d Remove the comment about how to get NetBSD syscalls since there are
now programs built on alpha that _must_ use FreeBSD syscalls to work.
1998-08-17 03:35:09 +00:00
John Birrell
57eec98d62 If using FreeBSD syscalls, handle the syscalls that don't require
default asm code the same way as on i386.
1998-08-08 02:25:46 +00:00
John Birrell
2a957ed7cc Include FreeBSD's syscall.h if not using NetBSD syscalls. 1998-08-08 02:24:03 +00:00
John Birrell
dc43d96540 Allow for the fact that NetBSD syscalls are no longer the default. Call
sigaltstack by default if using FreeBSD syscalls.
1998-08-08 02:20:24 +00:00
John Birrell
920ee4896e Make NetBSD compatibility conditional on NETBSD_SYSCALLS being defined.
This is no longer the default.
1998-08-08 02:18:07 +00:00
John Birrell
61020cc681 References to NetBSD syscalls changed to just a comment about what to
add to /etc/make.conf to use FreeBSD's libc with a NetBSD/Alpha kernel.

From now on, FreeBSD/Alpha is just FreeBSD.
1998-08-08 02:14:45 +00:00
John Birrell
4bc711423a Remove __NETBSD_SYSCALLS from CFLAGS now that it is set in sys.mk. 1998-06-09 22:59:16 +00:00
John Birrell
0b0ae157f8 Rename calls when building libc_r. 1998-06-09 22:57:34 +00:00
John Birrell
f4086bc0cb Make this thread-safe in both libc as well as libc_r. 1998-06-09 22:56:24 +00:00
John Birrell
9e0370f742 Rename when building libc_r. 1998-06-09 22:45:39 +00:00
John Birrell
929140ffab Add rename support for libc_r. 1998-06-09 22:43:34 +00:00
John Birrell
4bf15af17e Remove a big hack after adding a small one to libc/gen/getcwd.c to
handle the lack of __getcwd syscall in NetBSD.
1998-05-15 12:01:06 +00:00
John Birrell
c995d3ba90 Oops, we don't need NetBSD's malloc 'cause we can turn off utrace
in phk's malloc.
1998-03-09 07:03:06 +00:00
John Birrell
03fcbeae91 Import sources from NetBSD, tweaked for building in FreeBSD. 1998-03-09 06:34:43 +00:00