2018-01-01 00:32:25 +00:00
|
|
|
|
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
|
update from main archive 961105
Wed Nov 6 04:30:26 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/syscalls.list: Add weak alias llseek for
_llseek syscall. Reported by Andy Sewell <puck@pookhill.demon.co.uk>.
* string/argz.h: Don't protect by __USE_GNU.
Tue Nov 5 23:38:28 1996 Ulrich Drepper <drepper@cygnus.com>
* Lots of files: Update and reformat copyright.
* Makefile (headers): Add xopen_lim.h.
* catgets/nl_types.h: Move __BEGIN_DECLS before definition of nl_catd.
* grp/grp.h: Define setgrent, getgrent, endgrent, and getgrent_r
if __USE_XOPEN_EXTENDED is defined.
* pwd/pwd.h: Define setpwent, getpwent, endpwent, and getpwent_r
if __USE_XOPEN_EXTENDED is defined.
* io/Makefile (routines): Add lchown.
* io/sys/poll.h: Add definition of POLLWRNORM.
* io/sys/stat.h: Declare lstat, fchmod, mknod when
__USE_XOPEN_EXTENDED is defined.
* libio/Makefile (routines): Add obprintf.
* libio/obprintf.c: New file.
* libio/iolibio.h: Add prototypes for _IO_obstack_vprintf and
_IO_obstack_printf.
* libio/libio.h: Fix typo.
* libio/stdio.h: Declare tempnam if __USE_XOPEN_EXTENDED is defined.
Add prototypes for obstack_vprintf and obstack_printf.
* manual/creature.texi: Describe _XOPEN_SOURCE macro.
* manual/intro.texi: Add reference to NSS chapter.
* manual/libc.texinfo: Update UPDATED.
Comment out `@printindex cp'. It works again.
* manual/memory.texi: Add description for obstack_ptr_grow,
obstack_int_grow, obstack_ptr_grow_fast, and obstack_int_grow_fast.
* manual/nss.texi: Add a few @cindex entries and change NSS_STATUS_*
index entries to @vindex.
* manual/users.texi: Correct @cindex entry for Netgroup.
* math/mathcalls.h: Use __USE_XOPEN and __USE_XOPEN_EXTENDED to
make declarations visible for X/Open sources.
* misc/search.h: Declare insque/remque only is __USE_SVID or
__USE_XOPEN_EXTENDED is defined.
* misc/sys/uio.h (readv, writev): Change return value from int to
ssize_t.
* posix/Makefile (headers): Add re_comp.h.
* posix/re_comp.h: New file. XPG interface to regex functions.
* posix/getconf.c: Add all names from XPG4.2.
* posix/posix1_lim.h: Increase minimum values for _POSIX_CHILD_MAX
and _POSIX_OPEN_MAX to minimums from XPG4.2.
* sysdeps/generic/confname.h: Add all _SC_* names from XPG4.2.
* sysdeps/posix/sysconf.c: Handle new _SC_* values.
* sysdeps/stub/sysconf.c: Likewise.
* posix/unistd.h: Add declaration of ualarm and lchown. Declare
usleep, fchown, fchdir, nice, getpgid, setsid, getsid, setreuid,
setregid, vfork, ttyslot, symlink, readlink, gethostid, truncate,
ftruncate, getdtablesize, brk, sbrk, lockf when
__USE_XOPEN_EXTENDED is defined.
* posix/sys/wait.h: Declare wait3 if __USE_XOPEN_EXTENDED is defined.
* shadow/shadow.h: Define SHADOW using _PATH_SHADOW.
* sysdeps/generic/paths.h: Define _PATH_SHADOW.
* sysdeps/unix/sysv/linux/paths.h: Likewise.
* signal/signal.h: Declare killpg, sigstack and sigaltstack when
__USE_XOPEN_EXTENDED is defined.
* stdio/stdio.h: Declare tempnam when __USE_XOPEN is defined.
* stdlib/stdlib.h: Make rand48 functions available when __USE_XOPEN
is defined.
Likewise for valloc, putenv, realpath, [efg]cvt*, and getsubopt
functions.
* string/string.h: Make memccpy, strdup, bcmp, bcopy, bzero, index,
and rindex available when __USE_XOPEN_EXTENDED is defined.
* sysdeps/mach/getpagesize.c: De-ANSI-fy. Change return type to int.
* sysdeps/posix/getpagesize.c: Likewise.
* sysdeps/stub/getpagesize.c: Likewise.
* sysdeps/unix/getpagesize.c: Likewise.
* time/africa: Update from tzdata1996l.
* time/asia: Likewise.
* time/australia: Likewise.
* time/europe: Likewise.
* time/northamerica: Likewise.
* time/pacificnew: Likewise.
* time/southamerica: Likewise.
* time/tzfile.h: Update from tzcode1996m.
* time/time.h: Declare strptime if __USE_XOPEN.
Declare daylight and timezone also if __USE_XOPEN.
* time/sys/time.h: Remove declaration of ualarm.
* wctype/wctype.h: Just reference ISO C standard.
Tue Nov 5 01:26:32 1996 Richard Henderson <rth@tamu.edu>
* crypt/Makefile: Add crypt routines to libc as well iff
$(crypt-in-libc) is set. Do this for temporary binary compatibility
on existing Linux/Alpha installations.
* stdlib/div.c, sysdeps/generic/div.c: Move file to .../generic/.
* stdlib/ldiv.c, sysdeps/generic/ldiv.c: Likewise.
* stdlib/lldiv.c, sysdeps/generic/lldiv.c: Likewise.
* sysdeps/alpha/Makefile (divrem): Add divlu, dviqu, remlu, and
remqu.
* sysdeps/alpha/div.S: New file.
* sysdeps/alpha/ldiv.S: New file.
* sysdeps/alpha/lldiv.S: New file.
* sysdeps/alpha/divrem.h: Merge signed and unsigned division.
Take pointers from Linus and tighten the inner loops a bit.
* sysdeps/alpha/divl.S: Change defines for merged routines.
* sysdeps/alpha/divq.S: Likewise.
* sysdeps/alpha/reml.S: Likewise.
* sysdeps/alpha/remq.S: Likewise.
* sysdeps/alpha/divlu.S: Remove file.
* sysdeps/alpha/divqu.S: Likewise.
* sysdeps/alpha/remlu.S: Likewise.
* sysdeps/alpha/remqu.S: Likewise.
* sysdeps/alpha/bsd-_setjmp.S: If PROF, call _mcount.
* sysdeps/alpha/bsd-setjmp.S: Likewise.
* sysdeps/alpha/bzero.S: Likewise.
* sysdeps/alpha/ffs.S: Likewise.
* sysdeps/alpha/htonl.S: Likewise.
* sysdeps/alpha/htons.S: Likewise.
* sysdeps/alpha/memchr.S: Likewise.
* sysdeps/alpha/memset.S: Likewise.
* sysdeps/alpha/s_copysign.S: Likewise.
* sysdeps/alpha/s_fabs.S: Likewise.
* sysdeps/alpha/setjmp.S: Likewise.
* sysdeps/alpha/stpcpy.S: Likewise.
* sysdeps/alpha/stpncpy.S: Likewise.
* sysdeps/alpha/strcat.S: Likewise.
* sysdeps/alpha/strchr.S: Likewise.
* sysdeps/alpha/strcpy.S: Likewise.
* sysdeps/alpha/strlen.S: Likewise.
* sysdeps/alpha/strncat.S: Likewise.
* sysdeps/alpha/strncpy.S: Likewise.
* sysdeps/alpha/strrchr.S: Likewise.
* sysdeps/alpha/udiv_qrnnd.S: Likewise. Fix private labels.
Convert two small jumps to use conditional moves.
* sysdeps/unix/alpha/sysdep.h: Compress all __STDC__ nastiness.
(PSEUDO): If PROF, call _mcount.
* sysdeps/unix/sysv/linux/alpha/brk.S: If PROF, call _mcount.
* sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/llseek.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/sigsuspend.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/syscall.S: Likewise.
* sysdeps/alpha/memcpy.S: New file. Odd layout because it should
eventually contain memmove as well.
* sysdeps/alpha/strcmp.S: New file.
* sysdeps/alpha/strncmp.S: New file.
* sysdeps/alpha/w_sqrt.S: New file.
Tue Nov 5 18:06:06 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/mach/hurd/ttyname_r.c: Use `size_t' for len variable.
Tue Nov 5 12:09:29 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdep/generic/sysdep.h: Define END only if not yet defined.
* sysdep/unix/sysdep.h: Define PSEUDO_END only if not yet defined.
Reported by Thomas Bushnell, n/BSG.
Mon Nov 4 22:46:53 1996 Ulrich Drepper <drepper@cygnus.com>
* manual/users.texi (Netgroup Data): Remove { } around @cindex.
Mon Nov 4 19:07:05 1996 Ulrich Drepper <drepper@cygnus.com>
* malloc/calloc.c: Check for overflow before trying to allocate
memory. Proposed by Neil Matthews <nm@adv.sbc.sony.co.jp>.
Fri Nov 1 18:18:32 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* manual/llio.texi (Operating Modes): Add missing arguments to
@deftypevr in O_NONBLOCK description.
* manual/time.texi (Time Zone Functions): Enclose type name in
braces in description of tzname. FIXME: this does not yet work
correctly in info.
Sun Nov 3 17:29:06 1996 Ulrich Drepper <drepper@cygnus.com>
* features.h: Add X/Open macros.
* posix/unistd.h: Define X/Open macros.
* sysdeps/generic/confname.h: Add _SC_XOPEN_XCU_VERSION,
_SC_XOPEN_UNIX, _SC_XOPEN_CRYPT, _SC_XOPEN_ENH_I18N,
_SC_XOPEN_SHM, _SC_2_CHAR_TERM, _SC_2_C_VERSION, and _SC_2_UPE.
* sysdeps/posix/sysconf.c: Handle new constants.
* sysdeps/stub/sysconf.c: Likewise.
* sysdeps/unix/sysv/linux/posix_opt.h: Add definition of _XOPEN_SHM.
* catgets/catgets.c (catopen): Set errno to ENOMEM when
we run out of memory.
(catgets): Set errno to EBADF when catalog handle is invalid.
Set errno to ENOMSG when translation is not available.
(catclose): Set errno to EBADF when catalog handle is invalid.
* ctype/ctype.h: Declare isascii and toascii when __USE_XOPEN.
Likewise for _toupper and _tolower.
* manual/arith.texi: Document strtoq, strtoll, strtouq, strtoull,
strtof, and strtold.
* manual/math.texi: Document HUGE_VALf and HUGE_VALl.
* manual/stdio.h: Document ' flag for numeric formats of scanf.
* manual/users.texi: Document that cuserid shouldn't be used.
* misc/Makefile (routines): Add dirname.
(headers): Add libgen.h.
(tests): Add tst-dirname.
* misc/dirname.c: New file.
* misc/libgen.h: New file.
* misc/tst-dirname.c: New file.
* misc/search.h: Parameter of hcreate must be of type size_t.
* misc/hsearch.c: Likewise.
* misc/hsearch_r.c: Likewise for hcreate_r.
* misc/search.h: Parameters of insque and remque must be `void *'.
* misc/insremque.c: Likewise.
* posix/unistd.h: Move declarations of mktemp and mkstemp to...
* stdlib/stdlib.h: ...here.
* posix/unistd.h [__USE_XOPEN]: Add prototypes for crypt, setkey,
encrypt, and swab.
* stdio-common/printf-parse.h (struct printf_spec): Add pa_wchar
and pa_wstring.
(parse_one_spec): Remove Linux compatibility code.
Recognize %C and %S formats.
* stdio-common/printf.h: Add PA_WCHAR and PA_WSTRING.
* stdio-common/vfprintf.c: Add implementation of %C and %S format.
* stdio-common/vfscanf.c: Likewise for scanf.
* stdlib/l64a.c: Return value for 0 must be the empty string.
* stdlib/stdlib.h: Declare reentrant function from rand49 family
only if __USE_REENTRANT.
Declare rand48 functions also if __USE_XOPEN.
* stdlib/strtol.c: Return 0 and set errno to EINVAL when BASE is
not a legal value.
Return 0 and set errno to EINVAL when strou* sees negativ number.
* stdlib/tst-strtol.c: De-ANSI-fy.
Change expected results for test of unsigned function and negative
input.
* string/stratcliff.c: Prevent warnings.
* string.h: Move declaration of swab to <unistd.h>.
* string/swab.c: De-ANSI-fy.
* sysdeps/posix/cuserid.c: Implement using getpwuid_r.
* sysdeps/posix/mkstemp.c: Include <stdlib.h> for prototype.
* sysdeps/posix/mktemp.c: Likewise.
* sysdeps/stub/mkstemp.c: Likewise.
* sysdeps/stub/mktemp.c: Likewise.
* sysvipc/sys/ipc.h: Prototypes of ftok have to be of types `const
char *' and `int'.
* sysvipc/ftok.c: Likewise. Make sure only lower 8 bits of
PROJ_ID are used.
Sun Nov 3 03:21:28 1996 Heiko Schroeder <Heiko.Schroeder@post.rwth-aachen.de>
* locale/programs/ld-numeric.c (numeric_output): Compute idx[0]
correctly.
Sat Nov 2 17:44:32 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/posix/cuserid.c: Use reentrant functions.
* manual/users.texi: Tell that cuserid is marked to be withdrawn in
XPG4.2.
Sat Nov 2 14:26:37 1996 Ulrich Drepper <drepper@cygnus.com>
Linus said he will make sure no system call will return a value
in -1 ... -4095 as a valid result.
* sysdeps/unix/sysv/linux/i386/sysdep.h: Correct test for error.
* sysdeps/unix/sysv/linux/i386/syscall.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/m68k/syscall.S: Likewise.
Sat Nov 2 16:54:49 1996 NIIBE Yutaka <gniibe@mri.co.jp>
* sysdeps/stub/lockfile.c [!USE_IN_LIBIO]: Define weak alias for
__funlockfile, not a circular alias.
Define __IO_ftrylockfile if USE_IN_LIBIO and __ftrylockfile if not,
not vice versa.
* sysdeps/unix/sysv/linux/i386/sysdep.S (__errno_location): Make
it a weak symbol.
* sysdeps/unix/sysv/linux/m68k/sysdep.S (__errno_location): Likewise.
Likewise.
* crypt/Makefile (rpath-link): Extend search path to current directory.
1996-11-06 04:24:40 +00:00
|
|
|
|
This file is part of the GNU C Library.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
update from main archive 961105
Wed Nov 6 04:30:26 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/syscalls.list: Add weak alias llseek for
_llseek syscall. Reported by Andy Sewell <puck@pookhill.demon.co.uk>.
* string/argz.h: Don't protect by __USE_GNU.
Tue Nov 5 23:38:28 1996 Ulrich Drepper <drepper@cygnus.com>
* Lots of files: Update and reformat copyright.
* Makefile (headers): Add xopen_lim.h.
* catgets/nl_types.h: Move __BEGIN_DECLS before definition of nl_catd.
* grp/grp.h: Define setgrent, getgrent, endgrent, and getgrent_r
if __USE_XOPEN_EXTENDED is defined.
* pwd/pwd.h: Define setpwent, getpwent, endpwent, and getpwent_r
if __USE_XOPEN_EXTENDED is defined.
* io/Makefile (routines): Add lchown.
* io/sys/poll.h: Add definition of POLLWRNORM.
* io/sys/stat.h: Declare lstat, fchmod, mknod when
__USE_XOPEN_EXTENDED is defined.
* libio/Makefile (routines): Add obprintf.
* libio/obprintf.c: New file.
* libio/iolibio.h: Add prototypes for _IO_obstack_vprintf and
_IO_obstack_printf.
* libio/libio.h: Fix typo.
* libio/stdio.h: Declare tempnam if __USE_XOPEN_EXTENDED is defined.
Add prototypes for obstack_vprintf and obstack_printf.
* manual/creature.texi: Describe _XOPEN_SOURCE macro.
* manual/intro.texi: Add reference to NSS chapter.
* manual/libc.texinfo: Update UPDATED.
Comment out `@printindex cp'. It works again.
* manual/memory.texi: Add description for obstack_ptr_grow,
obstack_int_grow, obstack_ptr_grow_fast, and obstack_int_grow_fast.
* manual/nss.texi: Add a few @cindex entries and change NSS_STATUS_*
index entries to @vindex.
* manual/users.texi: Correct @cindex entry for Netgroup.
* math/mathcalls.h: Use __USE_XOPEN and __USE_XOPEN_EXTENDED to
make declarations visible for X/Open sources.
* misc/search.h: Declare insque/remque only is __USE_SVID or
__USE_XOPEN_EXTENDED is defined.
* misc/sys/uio.h (readv, writev): Change return value from int to
ssize_t.
* posix/Makefile (headers): Add re_comp.h.
* posix/re_comp.h: New file. XPG interface to regex functions.
* posix/getconf.c: Add all names from XPG4.2.
* posix/posix1_lim.h: Increase minimum values for _POSIX_CHILD_MAX
and _POSIX_OPEN_MAX to minimums from XPG4.2.
* sysdeps/generic/confname.h: Add all _SC_* names from XPG4.2.
* sysdeps/posix/sysconf.c: Handle new _SC_* values.
* sysdeps/stub/sysconf.c: Likewise.
* posix/unistd.h: Add declaration of ualarm and lchown. Declare
usleep, fchown, fchdir, nice, getpgid, setsid, getsid, setreuid,
setregid, vfork, ttyslot, symlink, readlink, gethostid, truncate,
ftruncate, getdtablesize, brk, sbrk, lockf when
__USE_XOPEN_EXTENDED is defined.
* posix/sys/wait.h: Declare wait3 if __USE_XOPEN_EXTENDED is defined.
* shadow/shadow.h: Define SHADOW using _PATH_SHADOW.
* sysdeps/generic/paths.h: Define _PATH_SHADOW.
* sysdeps/unix/sysv/linux/paths.h: Likewise.
* signal/signal.h: Declare killpg, sigstack and sigaltstack when
__USE_XOPEN_EXTENDED is defined.
* stdio/stdio.h: Declare tempnam when __USE_XOPEN is defined.
* stdlib/stdlib.h: Make rand48 functions available when __USE_XOPEN
is defined.
Likewise for valloc, putenv, realpath, [efg]cvt*, and getsubopt
functions.
* string/string.h: Make memccpy, strdup, bcmp, bcopy, bzero, index,
and rindex available when __USE_XOPEN_EXTENDED is defined.
* sysdeps/mach/getpagesize.c: De-ANSI-fy. Change return type to int.
* sysdeps/posix/getpagesize.c: Likewise.
* sysdeps/stub/getpagesize.c: Likewise.
* sysdeps/unix/getpagesize.c: Likewise.
* time/africa: Update from tzdata1996l.
* time/asia: Likewise.
* time/australia: Likewise.
* time/europe: Likewise.
* time/northamerica: Likewise.
* time/pacificnew: Likewise.
* time/southamerica: Likewise.
* time/tzfile.h: Update from tzcode1996m.
* time/time.h: Declare strptime if __USE_XOPEN.
Declare daylight and timezone also if __USE_XOPEN.
* time/sys/time.h: Remove declaration of ualarm.
* wctype/wctype.h: Just reference ISO C standard.
Tue Nov 5 01:26:32 1996 Richard Henderson <rth@tamu.edu>
* crypt/Makefile: Add crypt routines to libc as well iff
$(crypt-in-libc) is set. Do this for temporary binary compatibility
on existing Linux/Alpha installations.
* stdlib/div.c, sysdeps/generic/div.c: Move file to .../generic/.
* stdlib/ldiv.c, sysdeps/generic/ldiv.c: Likewise.
* stdlib/lldiv.c, sysdeps/generic/lldiv.c: Likewise.
* sysdeps/alpha/Makefile (divrem): Add divlu, dviqu, remlu, and
remqu.
* sysdeps/alpha/div.S: New file.
* sysdeps/alpha/ldiv.S: New file.
* sysdeps/alpha/lldiv.S: New file.
* sysdeps/alpha/divrem.h: Merge signed and unsigned division.
Take pointers from Linus and tighten the inner loops a bit.
* sysdeps/alpha/divl.S: Change defines for merged routines.
* sysdeps/alpha/divq.S: Likewise.
* sysdeps/alpha/reml.S: Likewise.
* sysdeps/alpha/remq.S: Likewise.
* sysdeps/alpha/divlu.S: Remove file.
* sysdeps/alpha/divqu.S: Likewise.
* sysdeps/alpha/remlu.S: Likewise.
* sysdeps/alpha/remqu.S: Likewise.
* sysdeps/alpha/bsd-_setjmp.S: If PROF, call _mcount.
* sysdeps/alpha/bsd-setjmp.S: Likewise.
* sysdeps/alpha/bzero.S: Likewise.
* sysdeps/alpha/ffs.S: Likewise.
* sysdeps/alpha/htonl.S: Likewise.
* sysdeps/alpha/htons.S: Likewise.
* sysdeps/alpha/memchr.S: Likewise.
* sysdeps/alpha/memset.S: Likewise.
* sysdeps/alpha/s_copysign.S: Likewise.
* sysdeps/alpha/s_fabs.S: Likewise.
* sysdeps/alpha/setjmp.S: Likewise.
* sysdeps/alpha/stpcpy.S: Likewise.
* sysdeps/alpha/stpncpy.S: Likewise.
* sysdeps/alpha/strcat.S: Likewise.
* sysdeps/alpha/strchr.S: Likewise.
* sysdeps/alpha/strcpy.S: Likewise.
* sysdeps/alpha/strlen.S: Likewise.
* sysdeps/alpha/strncat.S: Likewise.
* sysdeps/alpha/strncpy.S: Likewise.
* sysdeps/alpha/strrchr.S: Likewise.
* sysdeps/alpha/udiv_qrnnd.S: Likewise. Fix private labels.
Convert two small jumps to use conditional moves.
* sysdeps/unix/alpha/sysdep.h: Compress all __STDC__ nastiness.
(PSEUDO): If PROF, call _mcount.
* sysdeps/unix/sysv/linux/alpha/brk.S: If PROF, call _mcount.
* sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/llseek.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/sigsuspend.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/syscall.S: Likewise.
* sysdeps/alpha/memcpy.S: New file. Odd layout because it should
eventually contain memmove as well.
* sysdeps/alpha/strcmp.S: New file.
* sysdeps/alpha/strncmp.S: New file.
* sysdeps/alpha/w_sqrt.S: New file.
Tue Nov 5 18:06:06 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/mach/hurd/ttyname_r.c: Use `size_t' for len variable.
Tue Nov 5 12:09:29 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdep/generic/sysdep.h: Define END only if not yet defined.
* sysdep/unix/sysdep.h: Define PSEUDO_END only if not yet defined.
Reported by Thomas Bushnell, n/BSG.
Mon Nov 4 22:46:53 1996 Ulrich Drepper <drepper@cygnus.com>
* manual/users.texi (Netgroup Data): Remove { } around @cindex.
Mon Nov 4 19:07:05 1996 Ulrich Drepper <drepper@cygnus.com>
* malloc/calloc.c: Check for overflow before trying to allocate
memory. Proposed by Neil Matthews <nm@adv.sbc.sony.co.jp>.
Fri Nov 1 18:18:32 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* manual/llio.texi (Operating Modes): Add missing arguments to
@deftypevr in O_NONBLOCK description.
* manual/time.texi (Time Zone Functions): Enclose type name in
braces in description of tzname. FIXME: this does not yet work
correctly in info.
Sun Nov 3 17:29:06 1996 Ulrich Drepper <drepper@cygnus.com>
* features.h: Add X/Open macros.
* posix/unistd.h: Define X/Open macros.
* sysdeps/generic/confname.h: Add _SC_XOPEN_XCU_VERSION,
_SC_XOPEN_UNIX, _SC_XOPEN_CRYPT, _SC_XOPEN_ENH_I18N,
_SC_XOPEN_SHM, _SC_2_CHAR_TERM, _SC_2_C_VERSION, and _SC_2_UPE.
* sysdeps/posix/sysconf.c: Handle new constants.
* sysdeps/stub/sysconf.c: Likewise.
* sysdeps/unix/sysv/linux/posix_opt.h: Add definition of _XOPEN_SHM.
* catgets/catgets.c (catopen): Set errno to ENOMEM when
we run out of memory.
(catgets): Set errno to EBADF when catalog handle is invalid.
Set errno to ENOMSG when translation is not available.
(catclose): Set errno to EBADF when catalog handle is invalid.
* ctype/ctype.h: Declare isascii and toascii when __USE_XOPEN.
Likewise for _toupper and _tolower.
* manual/arith.texi: Document strtoq, strtoll, strtouq, strtoull,
strtof, and strtold.
* manual/math.texi: Document HUGE_VALf and HUGE_VALl.
* manual/stdio.h: Document ' flag for numeric formats of scanf.
* manual/users.texi: Document that cuserid shouldn't be used.
* misc/Makefile (routines): Add dirname.
(headers): Add libgen.h.
(tests): Add tst-dirname.
* misc/dirname.c: New file.
* misc/libgen.h: New file.
* misc/tst-dirname.c: New file.
* misc/search.h: Parameter of hcreate must be of type size_t.
* misc/hsearch.c: Likewise.
* misc/hsearch_r.c: Likewise for hcreate_r.
* misc/search.h: Parameters of insque and remque must be `void *'.
* misc/insremque.c: Likewise.
* posix/unistd.h: Move declarations of mktemp and mkstemp to...
* stdlib/stdlib.h: ...here.
* posix/unistd.h [__USE_XOPEN]: Add prototypes for crypt, setkey,
encrypt, and swab.
* stdio-common/printf-parse.h (struct printf_spec): Add pa_wchar
and pa_wstring.
(parse_one_spec): Remove Linux compatibility code.
Recognize %C and %S formats.
* stdio-common/printf.h: Add PA_WCHAR and PA_WSTRING.
* stdio-common/vfprintf.c: Add implementation of %C and %S format.
* stdio-common/vfscanf.c: Likewise for scanf.
* stdlib/l64a.c: Return value for 0 must be the empty string.
* stdlib/stdlib.h: Declare reentrant function from rand49 family
only if __USE_REENTRANT.
Declare rand48 functions also if __USE_XOPEN.
* stdlib/strtol.c: Return 0 and set errno to EINVAL when BASE is
not a legal value.
Return 0 and set errno to EINVAL when strou* sees negativ number.
* stdlib/tst-strtol.c: De-ANSI-fy.
Change expected results for test of unsigned function and negative
input.
* string/stratcliff.c: Prevent warnings.
* string.h: Move declaration of swab to <unistd.h>.
* string/swab.c: De-ANSI-fy.
* sysdeps/posix/cuserid.c: Implement using getpwuid_r.
* sysdeps/posix/mkstemp.c: Include <stdlib.h> for prototype.
* sysdeps/posix/mktemp.c: Likewise.
* sysdeps/stub/mkstemp.c: Likewise.
* sysdeps/stub/mktemp.c: Likewise.
* sysvipc/sys/ipc.h: Prototypes of ftok have to be of types `const
char *' and `int'.
* sysvipc/ftok.c: Likewise. Make sure only lower 8 bits of
PROJ_ID are used.
Sun Nov 3 03:21:28 1996 Heiko Schroeder <Heiko.Schroeder@post.rwth-aachen.de>
* locale/programs/ld-numeric.c (numeric_output): Compute idx[0]
correctly.
Sat Nov 2 17:44:32 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/posix/cuserid.c: Use reentrant functions.
* manual/users.texi: Tell that cuserid is marked to be withdrawn in
XPG4.2.
Sat Nov 2 14:26:37 1996 Ulrich Drepper <drepper@cygnus.com>
Linus said he will make sure no system call will return a value
in -1 ... -4095 as a valid result.
* sysdeps/unix/sysv/linux/i386/sysdep.h: Correct test for error.
* sysdeps/unix/sysv/linux/i386/syscall.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/m68k/syscall.S: Likewise.
Sat Nov 2 16:54:49 1996 NIIBE Yutaka <gniibe@mri.co.jp>
* sysdeps/stub/lockfile.c [!USE_IN_LIBIO]: Define weak alias for
__funlockfile, not a circular alias.
Define __IO_ftrylockfile if USE_IN_LIBIO and __ftrylockfile if not,
not vice versa.
* sysdeps/unix/sysv/linux/i386/sysdep.S (__errno_location): Make
it a weak symbol.
* sysdeps/unix/sysv/linux/m68k/sysdep.S (__errno_location): Likewise.
Likewise.
* crypt/Makefile (rpath-link): Extend search path to current directory.
1996-11-06 04:24:40 +00:00
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
update from main archive 961105
Wed Nov 6 04:30:26 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/syscalls.list: Add weak alias llseek for
_llseek syscall. Reported by Andy Sewell <puck@pookhill.demon.co.uk>.
* string/argz.h: Don't protect by __USE_GNU.
Tue Nov 5 23:38:28 1996 Ulrich Drepper <drepper@cygnus.com>
* Lots of files: Update and reformat copyright.
* Makefile (headers): Add xopen_lim.h.
* catgets/nl_types.h: Move __BEGIN_DECLS before definition of nl_catd.
* grp/grp.h: Define setgrent, getgrent, endgrent, and getgrent_r
if __USE_XOPEN_EXTENDED is defined.
* pwd/pwd.h: Define setpwent, getpwent, endpwent, and getpwent_r
if __USE_XOPEN_EXTENDED is defined.
* io/Makefile (routines): Add lchown.
* io/sys/poll.h: Add definition of POLLWRNORM.
* io/sys/stat.h: Declare lstat, fchmod, mknod when
__USE_XOPEN_EXTENDED is defined.
* libio/Makefile (routines): Add obprintf.
* libio/obprintf.c: New file.
* libio/iolibio.h: Add prototypes for _IO_obstack_vprintf and
_IO_obstack_printf.
* libio/libio.h: Fix typo.
* libio/stdio.h: Declare tempnam if __USE_XOPEN_EXTENDED is defined.
Add prototypes for obstack_vprintf and obstack_printf.
* manual/creature.texi: Describe _XOPEN_SOURCE macro.
* manual/intro.texi: Add reference to NSS chapter.
* manual/libc.texinfo: Update UPDATED.
Comment out `@printindex cp'. It works again.
* manual/memory.texi: Add description for obstack_ptr_grow,
obstack_int_grow, obstack_ptr_grow_fast, and obstack_int_grow_fast.
* manual/nss.texi: Add a few @cindex entries and change NSS_STATUS_*
index entries to @vindex.
* manual/users.texi: Correct @cindex entry for Netgroup.
* math/mathcalls.h: Use __USE_XOPEN and __USE_XOPEN_EXTENDED to
make declarations visible for X/Open sources.
* misc/search.h: Declare insque/remque only is __USE_SVID or
__USE_XOPEN_EXTENDED is defined.
* misc/sys/uio.h (readv, writev): Change return value from int to
ssize_t.
* posix/Makefile (headers): Add re_comp.h.
* posix/re_comp.h: New file. XPG interface to regex functions.
* posix/getconf.c: Add all names from XPG4.2.
* posix/posix1_lim.h: Increase minimum values for _POSIX_CHILD_MAX
and _POSIX_OPEN_MAX to minimums from XPG4.2.
* sysdeps/generic/confname.h: Add all _SC_* names from XPG4.2.
* sysdeps/posix/sysconf.c: Handle new _SC_* values.
* sysdeps/stub/sysconf.c: Likewise.
* posix/unistd.h: Add declaration of ualarm and lchown. Declare
usleep, fchown, fchdir, nice, getpgid, setsid, getsid, setreuid,
setregid, vfork, ttyslot, symlink, readlink, gethostid, truncate,
ftruncate, getdtablesize, brk, sbrk, lockf when
__USE_XOPEN_EXTENDED is defined.
* posix/sys/wait.h: Declare wait3 if __USE_XOPEN_EXTENDED is defined.
* shadow/shadow.h: Define SHADOW using _PATH_SHADOW.
* sysdeps/generic/paths.h: Define _PATH_SHADOW.
* sysdeps/unix/sysv/linux/paths.h: Likewise.
* signal/signal.h: Declare killpg, sigstack and sigaltstack when
__USE_XOPEN_EXTENDED is defined.
* stdio/stdio.h: Declare tempnam when __USE_XOPEN is defined.
* stdlib/stdlib.h: Make rand48 functions available when __USE_XOPEN
is defined.
Likewise for valloc, putenv, realpath, [efg]cvt*, and getsubopt
functions.
* string/string.h: Make memccpy, strdup, bcmp, bcopy, bzero, index,
and rindex available when __USE_XOPEN_EXTENDED is defined.
* sysdeps/mach/getpagesize.c: De-ANSI-fy. Change return type to int.
* sysdeps/posix/getpagesize.c: Likewise.
* sysdeps/stub/getpagesize.c: Likewise.
* sysdeps/unix/getpagesize.c: Likewise.
* time/africa: Update from tzdata1996l.
* time/asia: Likewise.
* time/australia: Likewise.
* time/europe: Likewise.
* time/northamerica: Likewise.
* time/pacificnew: Likewise.
* time/southamerica: Likewise.
* time/tzfile.h: Update from tzcode1996m.
* time/time.h: Declare strptime if __USE_XOPEN.
Declare daylight and timezone also if __USE_XOPEN.
* time/sys/time.h: Remove declaration of ualarm.
* wctype/wctype.h: Just reference ISO C standard.
Tue Nov 5 01:26:32 1996 Richard Henderson <rth@tamu.edu>
* crypt/Makefile: Add crypt routines to libc as well iff
$(crypt-in-libc) is set. Do this for temporary binary compatibility
on existing Linux/Alpha installations.
* stdlib/div.c, sysdeps/generic/div.c: Move file to .../generic/.
* stdlib/ldiv.c, sysdeps/generic/ldiv.c: Likewise.
* stdlib/lldiv.c, sysdeps/generic/lldiv.c: Likewise.
* sysdeps/alpha/Makefile (divrem): Add divlu, dviqu, remlu, and
remqu.
* sysdeps/alpha/div.S: New file.
* sysdeps/alpha/ldiv.S: New file.
* sysdeps/alpha/lldiv.S: New file.
* sysdeps/alpha/divrem.h: Merge signed and unsigned division.
Take pointers from Linus and tighten the inner loops a bit.
* sysdeps/alpha/divl.S: Change defines for merged routines.
* sysdeps/alpha/divq.S: Likewise.
* sysdeps/alpha/reml.S: Likewise.
* sysdeps/alpha/remq.S: Likewise.
* sysdeps/alpha/divlu.S: Remove file.
* sysdeps/alpha/divqu.S: Likewise.
* sysdeps/alpha/remlu.S: Likewise.
* sysdeps/alpha/remqu.S: Likewise.
* sysdeps/alpha/bsd-_setjmp.S: If PROF, call _mcount.
* sysdeps/alpha/bsd-setjmp.S: Likewise.
* sysdeps/alpha/bzero.S: Likewise.
* sysdeps/alpha/ffs.S: Likewise.
* sysdeps/alpha/htonl.S: Likewise.
* sysdeps/alpha/htons.S: Likewise.
* sysdeps/alpha/memchr.S: Likewise.
* sysdeps/alpha/memset.S: Likewise.
* sysdeps/alpha/s_copysign.S: Likewise.
* sysdeps/alpha/s_fabs.S: Likewise.
* sysdeps/alpha/setjmp.S: Likewise.
* sysdeps/alpha/stpcpy.S: Likewise.
* sysdeps/alpha/stpncpy.S: Likewise.
* sysdeps/alpha/strcat.S: Likewise.
* sysdeps/alpha/strchr.S: Likewise.
* sysdeps/alpha/strcpy.S: Likewise.
* sysdeps/alpha/strlen.S: Likewise.
* sysdeps/alpha/strncat.S: Likewise.
* sysdeps/alpha/strncpy.S: Likewise.
* sysdeps/alpha/strrchr.S: Likewise.
* sysdeps/alpha/udiv_qrnnd.S: Likewise. Fix private labels.
Convert two small jumps to use conditional moves.
* sysdeps/unix/alpha/sysdep.h: Compress all __STDC__ nastiness.
(PSEUDO): If PROF, call _mcount.
* sysdeps/unix/sysv/linux/alpha/brk.S: If PROF, call _mcount.
* sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/llseek.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/sigsuspend.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/syscall.S: Likewise.
* sysdeps/alpha/memcpy.S: New file. Odd layout because it should
eventually contain memmove as well.
* sysdeps/alpha/strcmp.S: New file.
* sysdeps/alpha/strncmp.S: New file.
* sysdeps/alpha/w_sqrt.S: New file.
Tue Nov 5 18:06:06 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/mach/hurd/ttyname_r.c: Use `size_t' for len variable.
Tue Nov 5 12:09:29 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdep/generic/sysdep.h: Define END only if not yet defined.
* sysdep/unix/sysdep.h: Define PSEUDO_END only if not yet defined.
Reported by Thomas Bushnell, n/BSG.
Mon Nov 4 22:46:53 1996 Ulrich Drepper <drepper@cygnus.com>
* manual/users.texi (Netgroup Data): Remove { } around @cindex.
Mon Nov 4 19:07:05 1996 Ulrich Drepper <drepper@cygnus.com>
* malloc/calloc.c: Check for overflow before trying to allocate
memory. Proposed by Neil Matthews <nm@adv.sbc.sony.co.jp>.
Fri Nov 1 18:18:32 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* manual/llio.texi (Operating Modes): Add missing arguments to
@deftypevr in O_NONBLOCK description.
* manual/time.texi (Time Zone Functions): Enclose type name in
braces in description of tzname. FIXME: this does not yet work
correctly in info.
Sun Nov 3 17:29:06 1996 Ulrich Drepper <drepper@cygnus.com>
* features.h: Add X/Open macros.
* posix/unistd.h: Define X/Open macros.
* sysdeps/generic/confname.h: Add _SC_XOPEN_XCU_VERSION,
_SC_XOPEN_UNIX, _SC_XOPEN_CRYPT, _SC_XOPEN_ENH_I18N,
_SC_XOPEN_SHM, _SC_2_CHAR_TERM, _SC_2_C_VERSION, and _SC_2_UPE.
* sysdeps/posix/sysconf.c: Handle new constants.
* sysdeps/stub/sysconf.c: Likewise.
* sysdeps/unix/sysv/linux/posix_opt.h: Add definition of _XOPEN_SHM.
* catgets/catgets.c (catopen): Set errno to ENOMEM when
we run out of memory.
(catgets): Set errno to EBADF when catalog handle is invalid.
Set errno to ENOMSG when translation is not available.
(catclose): Set errno to EBADF when catalog handle is invalid.
* ctype/ctype.h: Declare isascii and toascii when __USE_XOPEN.
Likewise for _toupper and _tolower.
* manual/arith.texi: Document strtoq, strtoll, strtouq, strtoull,
strtof, and strtold.
* manual/math.texi: Document HUGE_VALf and HUGE_VALl.
* manual/stdio.h: Document ' flag for numeric formats of scanf.
* manual/users.texi: Document that cuserid shouldn't be used.
* misc/Makefile (routines): Add dirname.
(headers): Add libgen.h.
(tests): Add tst-dirname.
* misc/dirname.c: New file.
* misc/libgen.h: New file.
* misc/tst-dirname.c: New file.
* misc/search.h: Parameter of hcreate must be of type size_t.
* misc/hsearch.c: Likewise.
* misc/hsearch_r.c: Likewise for hcreate_r.
* misc/search.h: Parameters of insque and remque must be `void *'.
* misc/insremque.c: Likewise.
* posix/unistd.h: Move declarations of mktemp and mkstemp to...
* stdlib/stdlib.h: ...here.
* posix/unistd.h [__USE_XOPEN]: Add prototypes for crypt, setkey,
encrypt, and swab.
* stdio-common/printf-parse.h (struct printf_spec): Add pa_wchar
and pa_wstring.
(parse_one_spec): Remove Linux compatibility code.
Recognize %C and %S formats.
* stdio-common/printf.h: Add PA_WCHAR and PA_WSTRING.
* stdio-common/vfprintf.c: Add implementation of %C and %S format.
* stdio-common/vfscanf.c: Likewise for scanf.
* stdlib/l64a.c: Return value for 0 must be the empty string.
* stdlib/stdlib.h: Declare reentrant function from rand49 family
only if __USE_REENTRANT.
Declare rand48 functions also if __USE_XOPEN.
* stdlib/strtol.c: Return 0 and set errno to EINVAL when BASE is
not a legal value.
Return 0 and set errno to EINVAL when strou* sees negativ number.
* stdlib/tst-strtol.c: De-ANSI-fy.
Change expected results for test of unsigned function and negative
input.
* string/stratcliff.c: Prevent warnings.
* string.h: Move declaration of swab to <unistd.h>.
* string/swab.c: De-ANSI-fy.
* sysdeps/posix/cuserid.c: Implement using getpwuid_r.
* sysdeps/posix/mkstemp.c: Include <stdlib.h> for prototype.
* sysdeps/posix/mktemp.c: Likewise.
* sysdeps/stub/mkstemp.c: Likewise.
* sysdeps/stub/mktemp.c: Likewise.
* sysvipc/sys/ipc.h: Prototypes of ftok have to be of types `const
char *' and `int'.
* sysvipc/ftok.c: Likewise. Make sure only lower 8 bits of
PROJ_ID are used.
Sun Nov 3 03:21:28 1996 Heiko Schroeder <Heiko.Schroeder@post.rwth-aachen.de>
* locale/programs/ld-numeric.c (numeric_output): Compute idx[0]
correctly.
Sat Nov 2 17:44:32 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/posix/cuserid.c: Use reentrant functions.
* manual/users.texi: Tell that cuserid is marked to be withdrawn in
XPG4.2.
Sat Nov 2 14:26:37 1996 Ulrich Drepper <drepper@cygnus.com>
Linus said he will make sure no system call will return a value
in -1 ... -4095 as a valid result.
* sysdeps/unix/sysv/linux/i386/sysdep.h: Correct test for error.
* sysdeps/unix/sysv/linux/i386/syscall.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/m68k/syscall.S: Likewise.
Sat Nov 2 16:54:49 1996 NIIBE Yutaka <gniibe@mri.co.jp>
* sysdeps/stub/lockfile.c [!USE_IN_LIBIO]: Define weak alias for
__funlockfile, not a circular alias.
Define __IO_ftrylockfile if USE_IN_LIBIO and __ftrylockfile if not,
not vice versa.
* sysdeps/unix/sysv/linux/i386/sysdep.S (__errno_location): Make
it a weak symbol.
* sysdeps/unix/sysv/linux/m68k/sysdep.S (__errno_location): Likewise.
Likewise.
* crypt/Makefile (rpath-link): Extend search path to current directory.
1996-11-06 04:24:40 +00:00
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
|
Lesser General Public License for more details.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2000-08-22 19:31:27 +00:00
|
|
|
|
#include <stdlib.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
#include <string.h>
|
2000-08-22 19:31:27 +00:00
|
|
|
|
|
|
|
|
|
#include <cthreads.h> /* For `struct mutex'. */
|
2018-03-17 21:50:09 +00:00
|
|
|
|
#include <pthread.h>
|
2000-08-22 19:31:27 +00:00
|
|
|
|
#include <mach.h>
|
|
|
|
|
#include <mach/thread_switch.h>
|
|
|
|
|
|
|
|
|
|
#include <hurd.h>
|
1997-07-06 22:02:42 +00:00
|
|
|
|
#include <hurd/id.h>
|
2000-08-22 19:31:27 +00:00
|
|
|
|
#include <hurd/signal.h>
|
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
#include "hurdfault.h"
|
|
|
|
|
#include "hurdmalloc.h" /* XXX */
|
2002-08-30 01:51:11 +00:00
|
|
|
|
#include "../locale/localeinfo.h"
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
const char *_hurdsig_getenv (const char *);
|
|
|
|
|
|
|
|
|
|
struct mutex _hurd_siglock;
|
|
|
|
|
int _hurd_stopped;
|
|
|
|
|
|
|
|
|
|
/* Port that receives signals and other miscellaneous messages. */
|
|
|
|
|
mach_port_t _hurd_msgport;
|
|
|
|
|
|
|
|
|
|
/* Thread listening on it. */
|
|
|
|
|
thread_t _hurd_msgport_thread;
|
|
|
|
|
|
|
|
|
|
/* Thread which receives task-global signals. */
|
|
|
|
|
thread_t _hurd_sigthread;
|
|
|
|
|
|
1997-02-23 22:09:31 +00:00
|
|
|
|
/* These are set up by _hurdsig_init. */
|
|
|
|
|
unsigned long int __hurd_sigthread_stack_base;
|
|
|
|
|
unsigned long int __hurd_sigthread_stack_end;
|
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* Linked-list of per-thread signal state. */
|
|
|
|
|
struct hurd_sigstate *_hurd_sigstates;
|
1995-08-14 22:49:23 +00:00
|
|
|
|
|
|
|
|
|
/* Timeout for RPC's after interrupt_operation. */
|
|
|
|
|
mach_msg_timeout_t _hurd_interrupted_rpc_timeout = 3000;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
default_sigaction (struct sigaction actions[NSIG])
|
|
|
|
|
{
|
|
|
|
|
int signo;
|
|
|
|
|
|
|
|
|
|
__sigemptyset (&actions[0].sa_mask);
|
|
|
|
|
actions[0].sa_flags = SA_RESTART;
|
|
|
|
|
actions[0].sa_handler = SIG_DFL;
|
|
|
|
|
|
|
|
|
|
for (signo = 1; signo < NSIG; ++signo)
|
|
|
|
|
actions[signo] = actions[0];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct hurd_sigstate *
|
|
|
|
|
_hurd_thread_sigstate (thread_t thread)
|
|
|
|
|
{
|
|
|
|
|
struct hurd_sigstate *ss;
|
|
|
|
|
__mutex_lock (&_hurd_siglock);
|
|
|
|
|
for (ss = _hurd_sigstates; ss != NULL; ss = ss->next)
|
|
|
|
|
if (ss->thread == thread)
|
1995-04-21 02:54:07 +00:00
|
|
|
|
break;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
if (ss == NULL)
|
|
|
|
|
{
|
|
|
|
|
ss = malloc (sizeof (*ss));
|
|
|
|
|
if (ss == NULL)
|
|
|
|
|
__libc_fatal ("hurd: Can't allocate thread sigstate\n");
|
|
|
|
|
ss->thread = thread;
|
|
|
|
|
__spin_lock_init (&ss->lock);
|
|
|
|
|
|
1996-01-04 00:06:01 +00:00
|
|
|
|
/* Initialize default state. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
__sigemptyset (&ss->blocked);
|
|
|
|
|
__sigemptyset (&ss->pending);
|
|
|
|
|
memset (&ss->sigaltstack, 0, sizeof (ss->sigaltstack));
|
update from main archive 961217
Wed Dec 18 03:31:58 1996 Ulrich Drepper <drepper@cygnus.com>
* dirent/scandir.c: Undo change from Mon Dec 2 15:32:15 1996.
The stream is private and usages outside glibc don't care about
reentrancy.
* io/fts.c: Likewise.
* io/ftw.c: Likewise.
* sysdeps/posix/getcwd.c: Likewise.
* sysdeps/posix/ttyname.c: Likewise.
* sysdeps/posix/ttyname_r.c: Likewise.
* sysdeps/posix/glob.c: Likewise.
* libio/iovsprintf.c: Add cast to prevent warning.
* libio/iovsscanf.c: Likewise.
* libio/libioP.h: Define mmap to __mmap and munmap to __munmap
to keep namespace clean.
* new-malloc/malloc.c: Update to last version from Wolfram Gloger.
Add hooks and check functions from old GNU malloc.
* new-malloc/malloc.h: Likewise.
* nis/ypclnt.c: Remove prototype for xdr_free.
* snrpc/rpc/xdr.h: Add prototype for xdr_free.
* manual/nss.texi: Correct description of default values and don't
meantion NSS as an add-on.
* nss/grp-lookup.c: Provide default value as
"compat [NOTFOUND=return] files".
* nss/pwd-lookup.c: Likewise.
* nss/spwd-lookup.c: Likewise.
* nss/network-lookup.c: Correct default to
"dns [!UNAVAIL=return] files".
* nss/nsswitch.c: Change default-default value to "nis
[NOTFOUND=return] files" since compat is only available for group,
passwd, and shadow.
* stdlib/on_exit.c (on_exit): Rename to __on_exit and make old name
a weak alias.
* stdlib/stdlib.h: Add prototype for __on_exit.
* sysdeps/unix/sysv/linux/schedbits.h: Add prototype for __clone.
* time/Makefile: Undo change from Sun Dec 8 06:56:49 1996.
The new malloc now has mcheck.
* time/ap.c: Likewise.
* time/tzset.c (__tzset): Rename to __tzset_internal.
(tzset): Rename to __tzset. Make tzset a weak alias for __tzset.
* time/localtime.c: Use __tzset_internal not __tzset.
* time/strftime.c [_LIBC]: Define tzname as __tzname and tzset
as __tzset to prevent namespace pollution.
* wctype/iswctype.h (icwctype): Rename to __iswctype. Make iswctype
a weak alias of __iswctype.
* wctype/wctype.h: Add prototype for __iswctype.
(iswalnum, iswalpha, iswcntrl, iswdigit, iswlower, iswgraph,
iswprint, iswpunct, iswspace, iswupper, iswxdigit, iswblank):
Use __iswctype for the test, not iswctype.
1996-12-16 Paul Eggert <eggert@twinsun.com>
* hurd/hurd/sigpreempt.h
(struct hurd_signal_preemptor.preemptor, _hurdsig_preemptors),
hurd/hurd/signal.h (struct hurd_sigstate.preemptors),
hurd/hurdfault.c, hurd/hurdfault.h (_hurdsig_fault_preemptor),
hurd/hurdsig.c (_hurdsig_preempters):
Renamed to fix spelling from `preempter' to `preemptor'.
All uses changed.
1996-12-15 Paul Eggert <eggert@twinsun.com>
* ctime.c (ctime): Return asctime (localtime (t)), as the C
standard requires.
Tue Dec 17 02:05:48 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/libc-lock.h (__libc_lock_trylock): Invert return
value because Mach/cthreads uses the opposite convention from
Posix/glibc.
Mon Dec 16 22:41:01 1996 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/fcloseall.c: Correct test of already_called.
Reported by Thomas Bushnell, n/BSG.
Mon Dec 16 14:52:07 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* mach/lock-intern.h (__mutex_try_lock): New function.
Sun Dec 15 16:33:44 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* termios/sys/ttydefaults.h (TTYDEF_OFLAG): Only use OXTABS if
defined, else XTABS.
(CEOL, CSTATUS): Use _POSIX_VDISABLE if defined.
Sun Dec 15 11:56:19 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/m68k/mremap.S: New file.
* sysdeps/unix/sysv/linux/m68k/Dist: Distribute it.
* sysdeps/unix/sysv/linux/m68k/Makefile (sysdep_routines): Add mremap.
1996-12-18 03:23:47 +00:00
|
|
|
|
ss->preemptors = NULL;
|
2001-07-11 21:15:50 +00:00
|
|
|
|
ss->suspended = MACH_PORT_NULL;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
ss->intr_port = MACH_PORT_NULL;
|
|
|
|
|
ss->context = NULL;
|
|
|
|
|
|
|
|
|
|
/* Initialize the sigaction vector from the default signal receiving
|
|
|
|
|
thread's state, and its from the system defaults. */
|
|
|
|
|
if (thread == _hurd_sigthread)
|
|
|
|
|
default_sigaction (ss->actions);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
struct hurd_sigstate *s;
|
|
|
|
|
for (s = _hurd_sigstates; s != NULL; s = s->next)
|
|
|
|
|
if (s->thread == _hurd_sigthread)
|
|
|
|
|
break;
|
|
|
|
|
if (s)
|
|
|
|
|
{
|
|
|
|
|
__spin_lock (&s->lock);
|
|
|
|
|
memcpy (ss->actions, s->actions, sizeof (s->actions));
|
|
|
|
|
__spin_unlock (&s->lock);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
default_sigaction (ss->actions);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ss->next = _hurd_sigstates;
|
|
|
|
|
_hurd_sigstates = ss;
|
|
|
|
|
}
|
|
|
|
|
__mutex_unlock (&_hurd_siglock);
|
|
|
|
|
return ss;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Signal delivery itself is on this page. */
|
|
|
|
|
|
|
|
|
|
#include <hurd/fd.h>
|
1995-09-17 19:29:59 +00:00
|
|
|
|
#include <hurd/crash.h>
|
2001-04-19 22:08:27 +00:00
|
|
|
|
#include <hurd/resource.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
#include <hurd/paths.h>
|
|
|
|
|
#include <setjmp.h>
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <sys/wait.h>
|
2005-12-21 22:16:34 +00:00
|
|
|
|
#include <thread_state.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
#include <hurd/msg_server.h>
|
|
|
|
|
#include <hurd/msg_reply.h> /* For __msg_sig_post_reply. */
|
|
|
|
|
#include <hurd/interrupt.h>
|
1996-01-04 10:00:22 +00:00
|
|
|
|
#include <assert.h>
|
|
|
|
|
#include <unistd.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
|
1995-09-17 19:29:59 +00:00
|
|
|
|
/* Call the crash dump server to mummify us before we die.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
Returns nonzero if a core file was written. */
|
|
|
|
|
static int
|
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
|
|
|
|
write_corefile (int signo, const struct hurd_signal_detail *detail)
|
1995-02-18 01:27:10 +00:00
|
|
|
|
{
|
|
|
|
|
error_t err;
|
|
|
|
|
mach_port_t coreserver;
|
|
|
|
|
file_t file, coredir;
|
|
|
|
|
const char *name;
|
|
|
|
|
|
2001-04-19 22:08:27 +00:00
|
|
|
|
/* Don't bother locking since we just read the one word. */
|
|
|
|
|
rlim_t corelimit = _hurd_rlimits[RLIMIT_CORE].rlim_cur;
|
|
|
|
|
|
|
|
|
|
if (corelimit == 0)
|
|
|
|
|
/* No core dumping, thank you very much. Note that this makes
|
|
|
|
|
`ulimit -c 0' prevent crash-suspension too, which is probably
|
|
|
|
|
what the user wanted. */
|
|
|
|
|
return 0;
|
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* XXX RLIMIT_CORE:
|
|
|
|
|
When we have a protocol to make the server return an error
|
|
|
|
|
for RLIMIT_FSIZE, then tell the corefile fs server the RLIMIT_CORE
|
|
|
|
|
value in place of the RLIMIT_FSIZE value. */
|
|
|
|
|
|
|
|
|
|
/* First get a port to the core dumping server. */
|
|
|
|
|
coreserver = MACH_PORT_NULL;
|
1995-09-17 19:29:59 +00:00
|
|
|
|
name = _hurdsig_getenv ("CRASHSERVER");
|
1995-02-18 01:27:10 +00:00
|
|
|
|
if (name != NULL)
|
|
|
|
|
coreserver = __file_name_lookup (name, 0, 0);
|
|
|
|
|
if (coreserver == MACH_PORT_NULL)
|
1995-09-17 19:29:59 +00:00
|
|
|
|
coreserver = __file_name_lookup (_SERVERS_CRASH, 0, 0);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
if (coreserver == MACH_PORT_NULL)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* Get a port to the directory where the new core file will reside. */
|
1996-10-31 17:30:56 +00:00
|
|
|
|
file = MACH_PORT_NULL;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
name = _hurdsig_getenv ("COREFILE");
|
|
|
|
|
if (name == NULL)
|
|
|
|
|
name = "core";
|
|
|
|
|
coredir = __file_name_split (name, (char **) &name);
|
1996-10-31 17:30:56 +00:00
|
|
|
|
if (coredir != MACH_PORT_NULL)
|
|
|
|
|
/* Create the new file, but don't link it into the directory yet. */
|
|
|
|
|
__dir_mkfile (coredir, O_WRONLY|O_CREAT,
|
|
|
|
|
0600 & ~_hurd_umask, /* XXX ? */
|
1996-11-05 05:07:48 +00:00
|
|
|
|
&file);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
/* Call the core dumping server to write the core file. */
|
1995-09-17 19:29:59 +00:00
|
|
|
|
err = __crash_dump_task (coreserver,
|
|
|
|
|
__mach_task_self (),
|
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
|
|
|
|
file,
|
|
|
|
|
signo, detail->code, detail->error,
|
|
|
|
|
detail->exc, detail->exc_code, detail->exc_subcode,
|
|
|
|
|
_hurd_ports[INIT_PORT_CTTYID].port,
|
|
|
|
|
MACH_MSG_TYPE_COPY_SEND);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
__mach_port_deallocate (__mach_task_self (), coreserver);
|
1996-10-31 17:30:56 +00:00
|
|
|
|
|
|
|
|
|
if (! err && file != MACH_PORT_NULL)
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* The core dump into FILE succeeded, so now link it into the
|
|
|
|
|
directory. */
|
2002-03-09 21:19:16 +00:00
|
|
|
|
err = __dir_link (coredir, file, name, 1);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
__mach_port_deallocate (__mach_task_self (), file);
|
|
|
|
|
__mach_port_deallocate (__mach_task_self (), coredir);
|
1996-10-31 17:30:56 +00:00
|
|
|
|
return !err && file != MACH_PORT_NULL;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* The lowest-numbered thread state flavor value is 1,
|
|
|
|
|
so we use bit 0 in machine_thread_all_state.set to
|
|
|
|
|
record whether we have done thread_abort. */
|
|
|
|
|
#define THREAD_ABORTED 1
|
|
|
|
|
|
1995-11-22 10:00:23 +00:00
|
|
|
|
/* SS->thread is suspended. Abort the thread and get its basic state. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
static void
|
|
|
|
|
abort_thread (struct hurd_sigstate *ss, struct machine_thread_all_state *state,
|
1995-11-22 10:00:23 +00:00
|
|
|
|
void (*reply) (void))
|
1995-02-18 01:27:10 +00:00
|
|
|
|
{
|
|
|
|
|
if (!(state->set & THREAD_ABORTED))
|
|
|
|
|
{
|
1995-04-21 02:54:07 +00:00
|
|
|
|
error_t err = __thread_abort (ss->thread);
|
|
|
|
|
assert_perror (err);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* Clear all thread state flavor set bits, because thread_abort may
|
|
|
|
|
have changed the state. */
|
|
|
|
|
state->set = THREAD_ABORTED;
|
|
|
|
|
}
|
|
|
|
|
|
1995-11-22 10:00:23 +00:00
|
|
|
|
if (reply)
|
|
|
|
|
(*reply) ();
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
machine_get_basic_state (ss->thread, state);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Find the location of the MiG reply port cell in use by the thread whose
|
1995-08-14 22:49:23 +00:00
|
|
|
|
state is described by THREAD_STATE. If SIGTHREAD is nonzero, make sure
|
|
|
|
|
that this location can be set without faulting, or else return NULL. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
static mach_port_t *
|
hurd: Replace threadvars with TLS
This gets rid of a lot of kludge and gets closer to other ports.
* hurd/Makefile (headers): Remove threadvar.h.
(inline-headers): Remove threadvar.h.
* hurd/Versions (GLIBC_2.0: Remove __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables,
__hurd_threadvar_max, __hurd_errno_location.
(HURD_CTHREADS_0.3): Add pthread_getattr_np, pthread_attr_getstack.
* hurd/hurd/signal.h: Do not include <hurd/threadvar.h>.
(_hurd_self_sigstate): Use THREAD_SELF to get _hurd_sigstate.
(_HURD_SIGNAL_H_EXTERN_INLINE): Use THREAD_SELF to get _hurd_sigstate,
unless TLS is not initialized yet, in which case we do not need a
critical section yet anyway.
* hurd/hurd/threadvar.h: Include <tls.h>, do not include
<machine-sp.h>.
(__hurd_sigthread_variables, __hurd_threadvar_max): Remove variables
declarations.
(__hurd_threadvar_index): Remove enum.
(_HURD_THREADVAR_H_EXTERN_INLINE): Remove macro.
(__hurd_threadvar_location_from_sp,__hurd_threadvar_location): Remove
inlines.
(__hurd_reply_port0): New variable declaration.
(__hurd_local_reply_port): New macro.
* hurd/hurdsig.c (__hurd_sigthread_variables): Remove variable.
(interrupted_reply_port_location): Add thread_t parameter. Use it
with THREAD_TCB to access thread-local variables.
(_hurdsig_abort_rpcs): Pass ss->thread to
interrupted_reply_port_location.
(_hurd_internal_post_signal): Likewise.
(_hurdsig_init): Use presence of cthread_fork instead of
__hurd_threadvar_stack_mask to start signal thread by hand.
Remove signal thread threadvar initialization.
* hurd/hurdstartup.c: Do not include <hurd/threadvar.h>
* hurd/sigunwind.c: Include <hurd/threadvar.h>
(_hurdsig_longjmp_from_handler): Use __hurd_local_reply_port instead
of threadvar.
* sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE): Add
__libc_lock_self0.
(ld.GLIBC_2.0): Remove __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables.
(ld.GLIBC_PRIVATE): Add __libc_lock_self0.
* sysdeps/mach/hurd/cthreads.c: Add __libc_lock_self0.
* sysdeps/mach/hurd/dl-sysdep.c (errno, __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables, threadvars,
__hurd_threadvar_stack_offset, __hurd_threadvar_stack_mask): Do not
define variables.
* sysdeps/mach/hurd/errno-loc.c: Do not include <errno.h> and
<hurd/threadvar.h>.
[IS_IN(rtld)] (rtld_errno): New variable.
[IS_IN(rtld)] (__errno_location): New weak function.
[!IS_IN(rtld)]: Include "../../../csu/errno-loc.c".
* sysdeps/mach/hurd/errno.c: Remove file.
* sysdeps/mach/hurd/fork.c: Include <hurd/threadvar.h>
(__fork): Remove THREADVAR_SPACE macro and its use.
* sysdeps/mach/hurd/i386/init-first.c (__hurd_threadvar_max): Remove
variable.
(init): Do not initialize threadvar.
* sysdeps/mach/hurd/i386/libc.abilist (__hurd_threadvar_max): Remove
symbol.
* sysdeps/mach/hurd/i386/sigreturn.c (__sigreturn): Use
__hurd_local_reply_port instead of threadvar.
* sysdeps/mach/hurd/i386/tls.h (tcbhead_t): Add reply_port and
_hurd_sigstate fields.
(HURD_DESC_TLS, __LIBC_NO_TLS, THREAD_TCB): New macro.
* sysdeps/mach/hurd/i386/trampoline.c: Remove outdated comment.
* sysdeps/mach/hurd/libc-lock.h: Do not include <hurd/threadvar.h>.
(__libc_lock_owner_self): Use &__libc_lock_self0 and THREAD_SELF
instead of threadvar.
* sysdeps/mach/hurd/libc-tsd.h: Remove file.
* sysdeps/mach/hurd/mig-reply.c (GETPORT, reply_port): Remove macros.
(use_threadvar, global_reply_port): Remove variables.
(__hurd_reply_port0): New variable.
(__mig_get_reply_port): Use __hurd_local_reply_port and
__hurd_reply_port0 instead of threadvar.
(__mig_dealloc_reply_port): Likewise.
(__mig_init): Do not initialize threadvar.
* sysdeps/mach/hurd/profil.c: Fix comment.
2018-03-17 22:27:34 +00:00
|
|
|
|
interrupted_reply_port_location (thread_t thread,
|
|
|
|
|
struct machine_thread_all_state *thread_state,
|
1995-08-14 22:49:23 +00:00
|
|
|
|
int sigthread)
|
1995-02-18 01:27:10 +00:00
|
|
|
|
{
|
hurd: Replace threadvars with TLS
This gets rid of a lot of kludge and gets closer to other ports.
* hurd/Makefile (headers): Remove threadvar.h.
(inline-headers): Remove threadvar.h.
* hurd/Versions (GLIBC_2.0: Remove __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables,
__hurd_threadvar_max, __hurd_errno_location.
(HURD_CTHREADS_0.3): Add pthread_getattr_np, pthread_attr_getstack.
* hurd/hurd/signal.h: Do not include <hurd/threadvar.h>.
(_hurd_self_sigstate): Use THREAD_SELF to get _hurd_sigstate.
(_HURD_SIGNAL_H_EXTERN_INLINE): Use THREAD_SELF to get _hurd_sigstate,
unless TLS is not initialized yet, in which case we do not need a
critical section yet anyway.
* hurd/hurd/threadvar.h: Include <tls.h>, do not include
<machine-sp.h>.
(__hurd_sigthread_variables, __hurd_threadvar_max): Remove variables
declarations.
(__hurd_threadvar_index): Remove enum.
(_HURD_THREADVAR_H_EXTERN_INLINE): Remove macro.
(__hurd_threadvar_location_from_sp,__hurd_threadvar_location): Remove
inlines.
(__hurd_reply_port0): New variable declaration.
(__hurd_local_reply_port): New macro.
* hurd/hurdsig.c (__hurd_sigthread_variables): Remove variable.
(interrupted_reply_port_location): Add thread_t parameter. Use it
with THREAD_TCB to access thread-local variables.
(_hurdsig_abort_rpcs): Pass ss->thread to
interrupted_reply_port_location.
(_hurd_internal_post_signal): Likewise.
(_hurdsig_init): Use presence of cthread_fork instead of
__hurd_threadvar_stack_mask to start signal thread by hand.
Remove signal thread threadvar initialization.
* hurd/hurdstartup.c: Do not include <hurd/threadvar.h>
* hurd/sigunwind.c: Include <hurd/threadvar.h>
(_hurdsig_longjmp_from_handler): Use __hurd_local_reply_port instead
of threadvar.
* sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE): Add
__libc_lock_self0.
(ld.GLIBC_2.0): Remove __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables.
(ld.GLIBC_PRIVATE): Add __libc_lock_self0.
* sysdeps/mach/hurd/cthreads.c: Add __libc_lock_self0.
* sysdeps/mach/hurd/dl-sysdep.c (errno, __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables, threadvars,
__hurd_threadvar_stack_offset, __hurd_threadvar_stack_mask): Do not
define variables.
* sysdeps/mach/hurd/errno-loc.c: Do not include <errno.h> and
<hurd/threadvar.h>.
[IS_IN(rtld)] (rtld_errno): New variable.
[IS_IN(rtld)] (__errno_location): New weak function.
[!IS_IN(rtld)]: Include "../../../csu/errno-loc.c".
* sysdeps/mach/hurd/errno.c: Remove file.
* sysdeps/mach/hurd/fork.c: Include <hurd/threadvar.h>
(__fork): Remove THREADVAR_SPACE macro and its use.
* sysdeps/mach/hurd/i386/init-first.c (__hurd_threadvar_max): Remove
variable.
(init): Do not initialize threadvar.
* sysdeps/mach/hurd/i386/libc.abilist (__hurd_threadvar_max): Remove
symbol.
* sysdeps/mach/hurd/i386/sigreturn.c (__sigreturn): Use
__hurd_local_reply_port instead of threadvar.
* sysdeps/mach/hurd/i386/tls.h (tcbhead_t): Add reply_port and
_hurd_sigstate fields.
(HURD_DESC_TLS, __LIBC_NO_TLS, THREAD_TCB): New macro.
* sysdeps/mach/hurd/i386/trampoline.c: Remove outdated comment.
* sysdeps/mach/hurd/libc-lock.h: Do not include <hurd/threadvar.h>.
(__libc_lock_owner_self): Use &__libc_lock_self0 and THREAD_SELF
instead of threadvar.
* sysdeps/mach/hurd/libc-tsd.h: Remove file.
* sysdeps/mach/hurd/mig-reply.c (GETPORT, reply_port): Remove macros.
(use_threadvar, global_reply_port): Remove variables.
(__hurd_reply_port0): New variable.
(__mig_get_reply_port): Use __hurd_local_reply_port and
__hurd_reply_port0 instead of threadvar.
(__mig_dealloc_reply_port): Likewise.
(__mig_init): Do not initialize threadvar.
* sysdeps/mach/hurd/profil.c: Fix comment.
2018-03-17 22:27:34 +00:00
|
|
|
|
mach_port_t *portloc = &THREAD_TCB(thread, thread_state)->reply_port;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1996-01-04 10:00:22 +00:00
|
|
|
|
if (sigthread && _hurdsig_catch_memory_fault (portloc))
|
hurd: Replace threadvars with TLS
This gets rid of a lot of kludge and gets closer to other ports.
* hurd/Makefile (headers): Remove threadvar.h.
(inline-headers): Remove threadvar.h.
* hurd/Versions (GLIBC_2.0: Remove __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables,
__hurd_threadvar_max, __hurd_errno_location.
(HURD_CTHREADS_0.3): Add pthread_getattr_np, pthread_attr_getstack.
* hurd/hurd/signal.h: Do not include <hurd/threadvar.h>.
(_hurd_self_sigstate): Use THREAD_SELF to get _hurd_sigstate.
(_HURD_SIGNAL_H_EXTERN_INLINE): Use THREAD_SELF to get _hurd_sigstate,
unless TLS is not initialized yet, in which case we do not need a
critical section yet anyway.
* hurd/hurd/threadvar.h: Include <tls.h>, do not include
<machine-sp.h>.
(__hurd_sigthread_variables, __hurd_threadvar_max): Remove variables
declarations.
(__hurd_threadvar_index): Remove enum.
(_HURD_THREADVAR_H_EXTERN_INLINE): Remove macro.
(__hurd_threadvar_location_from_sp,__hurd_threadvar_location): Remove
inlines.
(__hurd_reply_port0): New variable declaration.
(__hurd_local_reply_port): New macro.
* hurd/hurdsig.c (__hurd_sigthread_variables): Remove variable.
(interrupted_reply_port_location): Add thread_t parameter. Use it
with THREAD_TCB to access thread-local variables.
(_hurdsig_abort_rpcs): Pass ss->thread to
interrupted_reply_port_location.
(_hurd_internal_post_signal): Likewise.
(_hurdsig_init): Use presence of cthread_fork instead of
__hurd_threadvar_stack_mask to start signal thread by hand.
Remove signal thread threadvar initialization.
* hurd/hurdstartup.c: Do not include <hurd/threadvar.h>
* hurd/sigunwind.c: Include <hurd/threadvar.h>
(_hurdsig_longjmp_from_handler): Use __hurd_local_reply_port instead
of threadvar.
* sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE): Add
__libc_lock_self0.
(ld.GLIBC_2.0): Remove __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables.
(ld.GLIBC_PRIVATE): Add __libc_lock_self0.
* sysdeps/mach/hurd/cthreads.c: Add __libc_lock_self0.
* sysdeps/mach/hurd/dl-sysdep.c (errno, __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables, threadvars,
__hurd_threadvar_stack_offset, __hurd_threadvar_stack_mask): Do not
define variables.
* sysdeps/mach/hurd/errno-loc.c: Do not include <errno.h> and
<hurd/threadvar.h>.
[IS_IN(rtld)] (rtld_errno): New variable.
[IS_IN(rtld)] (__errno_location): New weak function.
[!IS_IN(rtld)]: Include "../../../csu/errno-loc.c".
* sysdeps/mach/hurd/errno.c: Remove file.
* sysdeps/mach/hurd/fork.c: Include <hurd/threadvar.h>
(__fork): Remove THREADVAR_SPACE macro and its use.
* sysdeps/mach/hurd/i386/init-first.c (__hurd_threadvar_max): Remove
variable.
(init): Do not initialize threadvar.
* sysdeps/mach/hurd/i386/libc.abilist (__hurd_threadvar_max): Remove
symbol.
* sysdeps/mach/hurd/i386/sigreturn.c (__sigreturn): Use
__hurd_local_reply_port instead of threadvar.
* sysdeps/mach/hurd/i386/tls.h (tcbhead_t): Add reply_port and
_hurd_sigstate fields.
(HURD_DESC_TLS, __LIBC_NO_TLS, THREAD_TCB): New macro.
* sysdeps/mach/hurd/i386/trampoline.c: Remove outdated comment.
* sysdeps/mach/hurd/libc-lock.h: Do not include <hurd/threadvar.h>.
(__libc_lock_owner_self): Use &__libc_lock_self0 and THREAD_SELF
instead of threadvar.
* sysdeps/mach/hurd/libc-tsd.h: Remove file.
* sysdeps/mach/hurd/mig-reply.c (GETPORT, reply_port): Remove macros.
(use_threadvar, global_reply_port): Remove variables.
(__hurd_reply_port0): New variable.
(__mig_get_reply_port): Use __hurd_local_reply_port and
__hurd_reply_port0 instead of threadvar.
(__mig_dealloc_reply_port): Likewise.
(__mig_init): Do not initialize threadvar.
* sysdeps/mach/hurd/profil.c: Fix comment.
2018-03-17 22:27:34 +00:00
|
|
|
|
/* Faulted trying to read the TCB. */
|
1996-01-04 10:00:22 +00:00
|
|
|
|
return NULL;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
/* Fault now if this pointer is bogus. */
|
|
|
|
|
*(volatile mach_port_t *) portloc = *portloc;
|
|
|
|
|
|
1995-08-14 22:49:23 +00:00
|
|
|
|
if (sigthread)
|
|
|
|
|
_hurdsig_end_catch_fault ();
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
return portloc;
|
|
|
|
|
}
|
1995-08-17 22:55:22 +00:00
|
|
|
|
|
1996-01-04 00:06:01 +00:00
|
|
|
|
#include <hurd/sigpreempt.h>
|
2005-12-21 22:16:34 +00:00
|
|
|
|
#include <intr-msg.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1996-05-01 01:01:48 +00:00
|
|
|
|
/* Timeout on interrupt_operation calls. */
|
|
|
|
|
mach_msg_timeout_t _hurdsig_interrupt_timeout = 1000;
|
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* SS->thread is suspended.
|
|
|
|
|
|
|
|
|
|
Abort any interruptible RPC operation the thread is doing.
|
|
|
|
|
|
|
|
|
|
This uses only the constant member SS->thread and the unlocked, atomically
|
|
|
|
|
set member SS->intr_port, so no locking is needed.
|
|
|
|
|
|
|
|
|
|
If successfully sent an interrupt_operation and therefore the thread should
|
|
|
|
|
wait for its pending RPC to return (possibly EINTR) before taking the
|
|
|
|
|
incoming signal, returns the reply port to be received on. Otherwise
|
|
|
|
|
returns MACH_PORT_NULL.
|
|
|
|
|
|
1995-11-10 20:38:31 +00:00
|
|
|
|
SIGNO is used to find the applicable SA_RESTART bit. If SIGNO is zero,
|
|
|
|
|
the RPC fails with EINTR instead of restarting (thread_cancel).
|
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
*STATE_CHANGE is set nonzero if STATE->basic was modified and should
|
|
|
|
|
be applied back to the thread if it might ever run again, else zero. */
|
|
|
|
|
|
1995-08-17 09:00:05 +00:00
|
|
|
|
mach_port_t
|
1995-11-10 20:38:31 +00:00
|
|
|
|
_hurdsig_abort_rpcs (struct hurd_sigstate *ss, int signo, int sigthread,
|
1995-08-14 22:49:23 +00:00
|
|
|
|
struct machine_thread_all_state *state, int *state_change,
|
1995-11-22 10:00:23 +00:00
|
|
|
|
void (*reply) (void))
|
1995-02-18 01:27:10 +00:00
|
|
|
|
{
|
1995-08-17 22:55:22 +00:00
|
|
|
|
extern const void _hurd_intr_rpc_msg_in_trap;
|
1995-08-14 22:49:23 +00:00
|
|
|
|
mach_port_t rcv_port = MACH_PORT_NULL;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
mach_port_t intr_port;
|
|
|
|
|
|
|
|
|
|
*state_change = 0;
|
|
|
|
|
|
|
|
|
|
intr_port = ss->intr_port;
|
|
|
|
|
if (intr_port == MACH_PORT_NULL)
|
|
|
|
|
/* No interruption needs done. */
|
|
|
|
|
return MACH_PORT_NULL;
|
|
|
|
|
|
|
|
|
|
/* Abort the thread's kernel context, so any pending message send or
|
|
|
|
|
receive completes immediately or aborts. */
|
1995-11-22 10:00:23 +00:00
|
|
|
|
abort_thread (ss, state, reply);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1995-08-14 22:49:23 +00:00
|
|
|
|
if (state->basic.PC < (natural_t) &_hurd_intr_rpc_msg_in_trap)
|
1995-02-18 01:27:10 +00:00
|
|
|
|
{
|
1995-08-14 22:49:23 +00:00
|
|
|
|
/* The thread is about to do the RPC, but hasn't yet entered
|
|
|
|
|
mach_msg. Mutate the thread's state so it knows not to try
|
|
|
|
|
the RPC. */
|
1995-08-17 22:55:22 +00:00
|
|
|
|
INTR_MSG_BACK_OUT (&state->basic);
|
1995-08-14 22:49:23 +00:00
|
|
|
|
MACHINE_THREAD_STATE_SET_PC (&state->basic,
|
|
|
|
|
&_hurd_intr_rpc_msg_in_trap);
|
|
|
|
|
state->basic.SYSRETURN = MACH_SEND_INTERRUPTED;
|
|
|
|
|
*state_change = 1;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
}
|
1995-08-14 22:49:23 +00:00
|
|
|
|
else if (state->basic.PC == (natural_t) &_hurd_intr_rpc_msg_in_trap &&
|
|
|
|
|
/* The thread was blocked in the system call. After thread_abort,
|
|
|
|
|
the return value register indicates what state the RPC was in
|
|
|
|
|
when interrupted. */
|
|
|
|
|
state->basic.SYSRETURN == MACH_RCV_INTERRUPTED)
|
|
|
|
|
{
|
|
|
|
|
/* The RPC request message was sent and the thread was waiting for
|
|
|
|
|
the reply message; now the message receive has been aborted, so
|
|
|
|
|
the mach_msg call will return MACH_RCV_INTERRUPTED. We must tell
|
|
|
|
|
the server to interrupt the pending operation. The thread must
|
|
|
|
|
wait for the reply message before running the signal handler (to
|
|
|
|
|
guarantee that the operation has finished being interrupted), so
|
|
|
|
|
our nonzero return tells the trampoline code to finish the message
|
|
|
|
|
receive operation before running the handler. */
|
|
|
|
|
|
hurd: Replace threadvars with TLS
This gets rid of a lot of kludge and gets closer to other ports.
* hurd/Makefile (headers): Remove threadvar.h.
(inline-headers): Remove threadvar.h.
* hurd/Versions (GLIBC_2.0: Remove __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables,
__hurd_threadvar_max, __hurd_errno_location.
(HURD_CTHREADS_0.3): Add pthread_getattr_np, pthread_attr_getstack.
* hurd/hurd/signal.h: Do not include <hurd/threadvar.h>.
(_hurd_self_sigstate): Use THREAD_SELF to get _hurd_sigstate.
(_HURD_SIGNAL_H_EXTERN_INLINE): Use THREAD_SELF to get _hurd_sigstate,
unless TLS is not initialized yet, in which case we do not need a
critical section yet anyway.
* hurd/hurd/threadvar.h: Include <tls.h>, do not include
<machine-sp.h>.
(__hurd_sigthread_variables, __hurd_threadvar_max): Remove variables
declarations.
(__hurd_threadvar_index): Remove enum.
(_HURD_THREADVAR_H_EXTERN_INLINE): Remove macro.
(__hurd_threadvar_location_from_sp,__hurd_threadvar_location): Remove
inlines.
(__hurd_reply_port0): New variable declaration.
(__hurd_local_reply_port): New macro.
* hurd/hurdsig.c (__hurd_sigthread_variables): Remove variable.
(interrupted_reply_port_location): Add thread_t parameter. Use it
with THREAD_TCB to access thread-local variables.
(_hurdsig_abort_rpcs): Pass ss->thread to
interrupted_reply_port_location.
(_hurd_internal_post_signal): Likewise.
(_hurdsig_init): Use presence of cthread_fork instead of
__hurd_threadvar_stack_mask to start signal thread by hand.
Remove signal thread threadvar initialization.
* hurd/hurdstartup.c: Do not include <hurd/threadvar.h>
* hurd/sigunwind.c: Include <hurd/threadvar.h>
(_hurdsig_longjmp_from_handler): Use __hurd_local_reply_port instead
of threadvar.
* sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE): Add
__libc_lock_self0.
(ld.GLIBC_2.0): Remove __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables.
(ld.GLIBC_PRIVATE): Add __libc_lock_self0.
* sysdeps/mach/hurd/cthreads.c: Add __libc_lock_self0.
* sysdeps/mach/hurd/dl-sysdep.c (errno, __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables, threadvars,
__hurd_threadvar_stack_offset, __hurd_threadvar_stack_mask): Do not
define variables.
* sysdeps/mach/hurd/errno-loc.c: Do not include <errno.h> and
<hurd/threadvar.h>.
[IS_IN(rtld)] (rtld_errno): New variable.
[IS_IN(rtld)] (__errno_location): New weak function.
[!IS_IN(rtld)]: Include "../../../csu/errno-loc.c".
* sysdeps/mach/hurd/errno.c: Remove file.
* sysdeps/mach/hurd/fork.c: Include <hurd/threadvar.h>
(__fork): Remove THREADVAR_SPACE macro and its use.
* sysdeps/mach/hurd/i386/init-first.c (__hurd_threadvar_max): Remove
variable.
(init): Do not initialize threadvar.
* sysdeps/mach/hurd/i386/libc.abilist (__hurd_threadvar_max): Remove
symbol.
* sysdeps/mach/hurd/i386/sigreturn.c (__sigreturn): Use
__hurd_local_reply_port instead of threadvar.
* sysdeps/mach/hurd/i386/tls.h (tcbhead_t): Add reply_port and
_hurd_sigstate fields.
(HURD_DESC_TLS, __LIBC_NO_TLS, THREAD_TCB): New macro.
* sysdeps/mach/hurd/i386/trampoline.c: Remove outdated comment.
* sysdeps/mach/hurd/libc-lock.h: Do not include <hurd/threadvar.h>.
(__libc_lock_owner_self): Use &__libc_lock_self0 and THREAD_SELF
instead of threadvar.
* sysdeps/mach/hurd/libc-tsd.h: Remove file.
* sysdeps/mach/hurd/mig-reply.c (GETPORT, reply_port): Remove macros.
(use_threadvar, global_reply_port): Remove variables.
(__hurd_reply_port0): New variable.
(__mig_get_reply_port): Use __hurd_local_reply_port and
__hurd_reply_port0 instead of threadvar.
(__mig_dealloc_reply_port): Likewise.
(__mig_init): Do not initialize threadvar.
* sysdeps/mach/hurd/profil.c: Fix comment.
2018-03-17 22:27:34 +00:00
|
|
|
|
mach_port_t *reply = interrupted_reply_port_location (ss->thread,
|
|
|
|
|
state,
|
1995-08-14 22:49:23 +00:00
|
|
|
|
sigthread);
|
1996-05-01 01:01:48 +00:00
|
|
|
|
error_t err = __interrupt_operation (intr_port, _hurdsig_interrupt_timeout);
|
1995-08-14 22:49:23 +00:00
|
|
|
|
|
|
|
|
|
if (err)
|
|
|
|
|
{
|
|
|
|
|
if (reply)
|
|
|
|
|
{
|
|
|
|
|
/* The interrupt didn't work.
|
|
|
|
|
Destroy the receive right the thread is blocked on. */
|
|
|
|
|
__mach_port_destroy (__mach_task_self (), *reply);
|
|
|
|
|
*reply = MACH_PORT_NULL;
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1995-08-14 22:49:23 +00:00
|
|
|
|
/* The system call return value register now contains
|
|
|
|
|
MACH_RCV_INTERRUPTED; when mach_msg resumes, it will retry the
|
|
|
|
|
call. Since we have just destroyed the receive right, the
|
|
|
|
|
retry will fail with MACH_RCV_INVALID_NAME. Instead, just
|
|
|
|
|
change the return value here to EINTR so mach_msg will not
|
|
|
|
|
retry and the EINTR error code will propagate up. */
|
|
|
|
|
state->basic.SYSRETURN = EINTR;
|
|
|
|
|
*state_change = 1;
|
|
|
|
|
}
|
|
|
|
|
else if (reply)
|
|
|
|
|
rcv_port = *reply;
|
|
|
|
|
|
|
|
|
|
/* All threads whose RPCs were interrupted by the interrupt_operation
|
|
|
|
|
call above will retry their RPCs unless we clear SS->intr_port.
|
|
|
|
|
So we clear it for the thread taking a signal when SA_RESTART is
|
|
|
|
|
clear, so that its call returns EINTR. */
|
|
|
|
|
if (! signo || !(ss->actions[signo].sa_flags & SA_RESTART))
|
|
|
|
|
ss->intr_port = MACH_PORT_NULL;
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1995-08-14 22:49:23 +00:00
|
|
|
|
return rcv_port;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-08-14 22:49:23 +00:00
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* Abort the RPCs being run by all threads but this one;
|
|
|
|
|
all other threads should be suspended. If LIVE is nonzero, those
|
|
|
|
|
threads may run again, so they should be adjusted as necessary to be
|
|
|
|
|
happy when resumed. STATE is clobbered as a scratch area; its initial
|
|
|
|
|
contents are ignored, and its contents on return are not useful. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
abort_all_rpcs (int signo, struct machine_thread_all_state *state, int live)
|
|
|
|
|
{
|
|
|
|
|
/* We can just loop over the sigstates. Any thread doing something
|
|
|
|
|
interruptible must have one. We needn't bother locking because all
|
|
|
|
|
other threads are stopped. */
|
|
|
|
|
|
|
|
|
|
struct hurd_sigstate *ss;
|
|
|
|
|
size_t nthreads;
|
|
|
|
|
mach_port_t *reply_ports;
|
|
|
|
|
|
|
|
|
|
/* First loop over the sigstates to count them.
|
|
|
|
|
We need to know how big a vector we will need for REPLY_PORTS. */
|
|
|
|
|
nthreads = 0;
|
|
|
|
|
for (ss = _hurd_sigstates; ss != NULL; ss = ss->next)
|
|
|
|
|
++nthreads;
|
|
|
|
|
|
|
|
|
|
reply_ports = alloca (nthreads * sizeof *reply_ports);
|
|
|
|
|
|
|
|
|
|
nthreads = 0;
|
1996-01-04 10:00:22 +00:00
|
|
|
|
for (ss = _hurd_sigstates; ss != NULL; ss = ss->next, ++nthreads)
|
1995-02-18 01:27:10 +00:00
|
|
|
|
if (ss->thread == _hurd_msgport_thread)
|
1996-01-04 10:00:22 +00:00
|
|
|
|
reply_ports[nthreads] = MACH_PORT_NULL;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int state_changed;
|
|
|
|
|
state->set = 0; /* Reset scratch area. */
|
|
|
|
|
|
|
|
|
|
/* Abort any operation in progress with interrupt_operation.
|
|
|
|
|
Record the reply port the thread is waiting on.
|
|
|
|
|
We will wait for all the replies below. */
|
1996-01-04 10:00:22 +00:00
|
|
|
|
reply_ports[nthreads] = _hurdsig_abort_rpcs (ss, signo, 1,
|
|
|
|
|
state, &state_changed,
|
|
|
|
|
NULL);
|
|
|
|
|
if (live)
|
|
|
|
|
{
|
|
|
|
|
if (reply_ports[nthreads] != MACH_PORT_NULL)
|
|
|
|
|
{
|
|
|
|
|
/* We will wait for the reply to this RPC below, so the
|
|
|
|
|
thread must issue a new RPC rather than waiting for the
|
|
|
|
|
reply to the one it sent. */
|
|
|
|
|
state->basic.SYSRETURN = EINTR;
|
|
|
|
|
state_changed = 1;
|
|
|
|
|
}
|
|
|
|
|
if (state_changed)
|
|
|
|
|
/* Aborting the RPC needed to change this thread's state,
|
|
|
|
|
and it might ever run again. So write back its state. */
|
|
|
|
|
__thread_set_state (ss->thread, MACHINE_THREAD_STATE_FLAVOR,
|
|
|
|
|
(natural_t *) &state->basic,
|
|
|
|
|
MACHINE_THREAD_STATE_COUNT);
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Wait for replies from all the successfully interrupted RPCs. */
|
|
|
|
|
while (nthreads-- > 0)
|
|
|
|
|
if (reply_ports[nthreads] != MACH_PORT_NULL)
|
|
|
|
|
{
|
|
|
|
|
error_t err;
|
|
|
|
|
mach_msg_header_t head;
|
1995-08-14 22:49:23 +00:00
|
|
|
|
err = __mach_msg (&head, MACH_RCV_MSG|MACH_RCV_TIMEOUT, 0, sizeof head,
|
1995-02-18 01:27:10 +00:00
|
|
|
|
reply_ports[nthreads],
|
1995-08-14 22:49:23 +00:00
|
|
|
|
_hurd_interrupted_rpc_timeout, MACH_PORT_NULL);
|
|
|
|
|
switch (err)
|
|
|
|
|
{
|
|
|
|
|
case MACH_RCV_TIMED_OUT:
|
|
|
|
|
case MACH_RCV_TOO_LARGE:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
assert_perror (err);
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1997-05-10 23:37:32 +00:00
|
|
|
|
struct hurd_signal_preemptor *_hurdsig_preemptors = 0;
|
1996-01-04 00:06:01 +00:00
|
|
|
|
sigset_t _hurdsig_preempted_set;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1997-02-23 22:09:31 +00:00
|
|
|
|
/* XXX temporary to deal with spelling fix */
|
|
|
|
|
weak_alias (_hurdsig_preemptors, _hurdsig_preempters)
|
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* Mask of stop signals. */
|
|
|
|
|
#define STOPSIGS (sigmask (SIGTTIN) | sigmask (SIGTTOU) | \
|
|
|
|
|
sigmask (SIGSTOP) | sigmask (SIGTSTP))
|
|
|
|
|
|
|
|
|
|
/* Deliver a signal. SS is not locked. */
|
|
|
|
|
void
|
|
|
|
|
_hurd_internal_post_signal (struct hurd_sigstate *ss,
|
1996-05-07 14:57:38 +00:00
|
|
|
|
int signo, struct hurd_signal_detail *detail,
|
1995-02-18 01:27:10 +00:00
|
|
|
|
mach_port_t reply_port,
|
|
|
|
|
mach_msg_type_name_t reply_port_type,
|
|
|
|
|
int untraced)
|
|
|
|
|
{
|
1995-04-21 02:54:07 +00:00
|
|
|
|
error_t err;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
struct machine_thread_all_state thread_state;
|
|
|
|
|
enum { stop, ignore, core, term, handle } act;
|
|
|
|
|
sighandler_t handler;
|
|
|
|
|
sigset_t pending;
|
|
|
|
|
int ss_suspended;
|
|
|
|
|
|
|
|
|
|
/* Reply to this sig_post message. */
|
1995-11-22 10:00:23 +00:00
|
|
|
|
__typeof (__msg_sig_post_reply) *reply_rpc
|
|
|
|
|
= (untraced ? __msg_sig_post_untraced_reply : __msg_sig_post_reply);
|
|
|
|
|
void reply (void)
|
1995-02-18 01:27:10 +00:00
|
|
|
|
{
|
1995-11-22 10:00:23 +00:00
|
|
|
|
error_t err;
|
|
|
|
|
if (reply_port == MACH_PORT_NULL)
|
|
|
|
|
return;
|
|
|
|
|
err = (*reply_rpc) (reply_port, reply_port_type, 0);
|
|
|
|
|
reply_port = MACH_PORT_NULL;
|
|
|
|
|
if (err != MACH_SEND_INVALID_DEST) /* Ignore dead reply port. */
|
|
|
|
|
assert_perror (err);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Mark the signal as pending. */
|
|
|
|
|
void mark_pending (void)
|
|
|
|
|
{
|
|
|
|
|
__sigaddset (&ss->pending, signo);
|
1996-05-07 14:57:38 +00:00
|
|
|
|
/* Save the details to be given to the handler when SIGNO is
|
1995-02-18 01:27:10 +00:00
|
|
|
|
unblocked. */
|
1996-05-07 14:57:38 +00:00
|
|
|
|
ss->pending_data[signo] = *detail;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Suspend the process with SIGNO. */
|
|
|
|
|
void suspend (void)
|
|
|
|
|
{
|
|
|
|
|
/* Stop all other threads and mark ourselves stopped. */
|
|
|
|
|
__USEPORT (PROC,
|
|
|
|
|
({
|
|
|
|
|
/* Hold the siglock while stopping other threads to be
|
|
|
|
|
sure it is not held by another thread afterwards. */
|
|
|
|
|
__mutex_lock (&_hurd_siglock);
|
|
|
|
|
__proc_dostop (port, _hurd_msgport_thread);
|
|
|
|
|
__mutex_unlock (&_hurd_siglock);
|
|
|
|
|
abort_all_rpcs (signo, &thread_state, 1);
|
1995-12-14 03:05:50 +00:00
|
|
|
|
reply ();
|
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
|
|
|
|
__proc_mark_stop (port, signo, detail->code);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
}));
|
|
|
|
|
_hurd_stopped = 1;
|
|
|
|
|
}
|
1995-11-10 20:38:31 +00:00
|
|
|
|
/* Resume the process after a suspension. */
|
|
|
|
|
void resume (void)
|
|
|
|
|
{
|
|
|
|
|
/* Resume the process from being stopped. */
|
|
|
|
|
thread_t *threads;
|
|
|
|
|
mach_msg_type_number_t nthreads, i;
|
|
|
|
|
error_t err;
|
|
|
|
|
|
|
|
|
|
if (! _hurd_stopped)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Tell the proc server we are continuing. */
|
|
|
|
|
__USEPORT (PROC, __proc_mark_cont (port));
|
|
|
|
|
/* Fetch ports to all our threads and resume them. */
|
|
|
|
|
err = __task_threads (__mach_task_self (), &threads, &nthreads);
|
|
|
|
|
assert_perror (err);
|
|
|
|
|
for (i = 0; i < nthreads; ++i)
|
|
|
|
|
{
|
|
|
|
|
if (threads[i] != _hurd_msgport_thread &&
|
|
|
|
|
(act != handle || threads[i] != ss->thread))
|
|
|
|
|
{
|
|
|
|
|
err = __thread_resume (threads[i]);
|
|
|
|
|
assert_perror (err);
|
|
|
|
|
}
|
|
|
|
|
err = __mach_port_deallocate (__mach_task_self (),
|
|
|
|
|
threads[i]);
|
|
|
|
|
assert_perror (err);
|
|
|
|
|
}
|
|
|
|
|
__vm_deallocate (__mach_task_self (),
|
|
|
|
|
(vm_address_t) threads,
|
|
|
|
|
nthreads * sizeof *threads);
|
|
|
|
|
_hurd_stopped = 0;
|
1996-06-06 20:49:22 +00:00
|
|
|
|
if (act == handle)
|
|
|
|
|
/* The thread that will run the handler is already suspended. */
|
|
|
|
|
ss_suspended = 1;
|
1995-11-10 20:38:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (signo == 0)
|
|
|
|
|
{
|
|
|
|
|
if (untraced)
|
|
|
|
|
/* This is PTRACE_CONTINUE. */
|
|
|
|
|
resume ();
|
|
|
|
|
|
|
|
|
|
/* This call is just to check for pending signals. */
|
|
|
|
|
__spin_lock (&ss->lock);
|
|
|
|
|
goto check_pending_signals;
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
post_signal:
|
|
|
|
|
|
|
|
|
|
thread_state.set = 0; /* We know nothing. */
|
|
|
|
|
|
1996-01-04 00:06:01 +00:00
|
|
|
|
__spin_lock (&ss->lock);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1996-01-04 00:06:01 +00:00
|
|
|
|
/* Check for a preempted signal. Preempted signals can arrive during
|
|
|
|
|
critical sections. */
|
1999-07-21 16:50:21 +00:00
|
|
|
|
{
|
|
|
|
|
inline sighandler_t try_preemptor (struct hurd_signal_preemptor *pe)
|
|
|
|
|
{ /* PE cannot be null. */
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
if (HURD_PREEMPT_SIGNAL_P (pe, signo, detail->code))
|
|
|
|
|
{
|
|
|
|
|
if (pe->preemptor)
|
|
|
|
|
{
|
|
|
|
|
sighandler_t handler = (*pe->preemptor) (pe, ss,
|
|
|
|
|
&signo, detail);
|
|
|
|
|
if (handler != SIG_ERR)
|
|
|
|
|
return handler;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return pe->handler;
|
|
|
|
|
}
|
|
|
|
|
pe = pe->next;
|
|
|
|
|
} while (pe != 0);
|
|
|
|
|
return SIG_ERR;
|
|
|
|
|
}
|
1996-01-04 00:06:01 +00:00
|
|
|
|
|
1999-07-21 16:50:21 +00:00
|
|
|
|
handler = ss->preemptors ? try_preemptor (ss->preemptors) : SIG_ERR;
|
1996-01-04 00:06:01 +00:00
|
|
|
|
|
1999-07-21 16:50:21 +00:00
|
|
|
|
/* If no thread-specific preemptor, check for a global one. */
|
2002-01-02 10:54:54 +00:00
|
|
|
|
if (handler == SIG_ERR && __sigismember (&_hurdsig_preempted_set, signo))
|
1999-07-21 16:50:21 +00:00
|
|
|
|
{
|
|
|
|
|
__mutex_lock (&_hurd_siglock);
|
|
|
|
|
handler = try_preemptor (_hurdsig_preemptors);
|
|
|
|
|
__mutex_unlock (&_hurd_siglock);
|
|
|
|
|
}
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
ss_suspended = 0;
|
|
|
|
|
|
1996-01-04 00:06:01 +00:00
|
|
|
|
if (handler == SIG_IGN)
|
|
|
|
|
/* Ignore the signal altogether. */
|
|
|
|
|
act = ignore;
|
1999-08-23 20:53:42 +00:00
|
|
|
|
else if (handler != SIG_ERR)
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* Run the preemption-provided handler. */
|
|
|
|
|
act = handle;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* No preemption. Do normal handling. */
|
|
|
|
|
|
1996-05-04 09:46:57 +00:00
|
|
|
|
if (!untraced && __sigismember (&_hurdsig_traced, signo))
|
1995-02-18 01:27:10 +00:00
|
|
|
|
{
|
|
|
|
|
/* We are being traced. Stop to tell the debugger of the signal. */
|
|
|
|
|
if (_hurd_stopped)
|
|
|
|
|
/* Already stopped. Mark the signal as pending;
|
|
|
|
|
when resumed, we will notice it and stop again. */
|
|
|
|
|
mark_pending ();
|
|
|
|
|
else
|
|
|
|
|
suspend ();
|
|
|
|
|
__spin_unlock (&ss->lock);
|
|
|
|
|
reply ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
1995-11-10 20:38:31 +00:00
|
|
|
|
handler = ss->actions[signo].sa_handler;
|
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
if (handler == SIG_DFL)
|
|
|
|
|
/* Figure out the default action for this signal. */
|
|
|
|
|
switch (signo)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
/* A sig_post msg with SIGNO==0 is sent to
|
|
|
|
|
tell us to check for pending signals. */
|
|
|
|
|
act = ignore;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGTTIN:
|
|
|
|
|
case SIGTTOU:
|
|
|
|
|
case SIGSTOP:
|
|
|
|
|
case SIGTSTP:
|
|
|
|
|
act = stop;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGCONT:
|
|
|
|
|
case SIGIO:
|
|
|
|
|
case SIGURG:
|
|
|
|
|
case SIGCHLD:
|
|
|
|
|
case SIGWINCH:
|
|
|
|
|
act = ignore;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGQUIT:
|
|
|
|
|
case SIGILL:
|
|
|
|
|
case SIGTRAP:
|
|
|
|
|
case SIGIOT:
|
|
|
|
|
case SIGEMT:
|
|
|
|
|
case SIGFPE:
|
|
|
|
|
case SIGBUS:
|
|
|
|
|
case SIGSEGV:
|
|
|
|
|
case SIGSYS:
|
|
|
|
|
act = core;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGINFO:
|
|
|
|
|
if (_hurd_pgrp == _hurd_pid)
|
|
|
|
|
{
|
|
|
|
|
/* We are the process group leader. Since there is no
|
|
|
|
|
user-specified handler for SIGINFO, we use a default one
|
|
|
|
|
which prints something interesting. We use the normal
|
|
|
|
|
handler mechanism instead of just doing it here to avoid
|
|
|
|
|
the signal thread faulting or blocking in this
|
|
|
|
|
potentially hairy operation. */
|
|
|
|
|
act = handle;
|
|
|
|
|
handler = _hurd_siginfo_handler;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
act = ignore;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
act = term;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else if (handler == SIG_IGN)
|
|
|
|
|
act = ignore;
|
|
|
|
|
else
|
|
|
|
|
act = handle;
|
|
|
|
|
|
|
|
|
|
if (__sigmask (signo) & STOPSIGS)
|
|
|
|
|
/* Stop signals clear a pending SIGCONT even if they
|
|
|
|
|
are handled or ignored (but not if preempted). */
|
2002-01-02 10:52:56 +00:00
|
|
|
|
__sigdelset (&ss->pending, SIGCONT);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (signo == SIGCONT)
|
|
|
|
|
/* Even if handled or ignored (but not preempted), SIGCONT clears
|
|
|
|
|
stop signals and resumes the process. */
|
|
|
|
|
ss->pending &= ~STOPSIGS;
|
|
|
|
|
|
|
|
|
|
if (_hurd_stopped && act != stop && (untraced || signo == SIGCONT))
|
1995-11-10 20:38:31 +00:00
|
|
|
|
resume ();
|
1995-02-18 01:27:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_hurd_orphaned && act == stop &&
|
|
|
|
|
(__sigmask (signo) & (__sigmask (SIGTTIN) | __sigmask (SIGTTOU) |
|
|
|
|
|
__sigmask (SIGTSTP))))
|
|
|
|
|
{
|
|
|
|
|
/* If we would ordinarily stop for a job control signal, but we are
|
|
|
|
|
orphaned so noone would ever notice and continue us again, we just
|
|
|
|
|
quietly die, alone and in the dark. */
|
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
|
|
|
|
detail->code = signo;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
signo = SIGKILL;
|
|
|
|
|
act = term;
|
|
|
|
|
}
|
|
|
|
|
|
1995-11-10 20:38:31 +00:00
|
|
|
|
/* Handle receipt of a blocked signal, or any signal while stopped. */
|
1996-06-06 20:49:22 +00:00
|
|
|
|
if (act != ignore && /* Signals ignored now are forgotten now. */
|
|
|
|
|
__sigismember (&ss->blocked, signo) ||
|
1995-02-18 01:27:10 +00:00
|
|
|
|
(signo != SIGKILL && _hurd_stopped))
|
|
|
|
|
{
|
|
|
|
|
mark_pending ();
|
|
|
|
|
act = ignore;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Perform the chosen action for the signal. */
|
|
|
|
|
switch (act)
|
|
|
|
|
{
|
|
|
|
|
case stop:
|
|
|
|
|
if (_hurd_stopped)
|
1995-04-21 02:54:07 +00:00
|
|
|
|
{
|
|
|
|
|
/* We are already stopped, but receiving an untraced stop
|
|
|
|
|
signal. Instead of resuming and suspending again, just
|
|
|
|
|
notify the proc server of the new stop signal. */
|
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
|
|
|
|
error_t err = __USEPORT (PROC, __proc_mark_stop
|
|
|
|
|
(port, signo, detail->code));
|
1995-04-21 02:54:07 +00:00
|
|
|
|
assert_perror (err);
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
else
|
|
|
|
|
/* Suspend the process. */
|
|
|
|
|
suspend ();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ignore:
|
2008-03-08 21:47:27 +00:00
|
|
|
|
if (detail->exc)
|
|
|
|
|
/* Blocking or ignoring a machine exception is fatal.
|
|
|
|
|
Otherwise we could just spin on the faulting instruction. */
|
|
|
|
|
goto fatal;
|
|
|
|
|
|
1996-06-06 20:49:22 +00:00
|
|
|
|
/* Nobody cares about this signal. If there was a call to resume
|
|
|
|
|
above in SIGCONT processing and we've left a thread suspended,
|
|
|
|
|
now's the time to set it going. */
|
|
|
|
|
if (ss_suspended)
|
|
|
|
|
{
|
|
|
|
|
err = __thread_resume (ss->thread);
|
|
|
|
|
assert_perror (err);
|
|
|
|
|
ss_suspended = 0;
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
break;
|
|
|
|
|
|
1995-05-08 09:11:25 +00:00
|
|
|
|
sigbomb:
|
|
|
|
|
/* We got a fault setting up the stack frame for the handler.
|
|
|
|
|
Nothing to do but die; BSD gets SIGILL in this case. */
|
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
|
|
|
|
detail->code = signo; /* XXX ? */
|
1995-05-08 09:11:25 +00:00
|
|
|
|
signo = SIGILL;
|
2008-03-08 21:47:27 +00:00
|
|
|
|
|
|
|
|
|
fatal:
|
1995-05-08 09:11:25 +00:00
|
|
|
|
act = core;
|
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
case term: /* Time to die. */
|
|
|
|
|
case core: /* And leave a rotting corpse. */
|
|
|
|
|
/* Have the proc server stop all other threads in our task. */
|
1995-04-21 02:54:07 +00:00
|
|
|
|
err = __USEPORT (PROC, __proc_dostop (port, _hurd_msgport_thread));
|
|
|
|
|
assert_perror (err);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* No more user instructions will be executed.
|
|
|
|
|
The signal can now be considered delivered. */
|
|
|
|
|
reply ();
|
|
|
|
|
/* Abort all server operations now in progress. */
|
|
|
|
|
abort_all_rpcs (signo, &thread_state, 0);
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
int status = W_EXITCODE (0, signo);
|
|
|
|
|
/* Do a core dump if desired. Only set the wait status bit saying we
|
|
|
|
|
in fact dumped core if the operation was actually successful. */
|
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
|
|
|
|
if (act == core && write_corefile (signo, detail))
|
1995-02-18 01:27:10 +00:00
|
|
|
|
status |= WCOREFLAG;
|
|
|
|
|
/* Tell proc how we died and then stick the saber in the gut. */
|
|
|
|
|
_hurd_exit (status);
|
|
|
|
|
/* NOTREACHED */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case handle:
|
|
|
|
|
/* Call a handler for this signal. */
|
|
|
|
|
{
|
1995-05-08 09:11:25 +00:00
|
|
|
|
struct sigcontext *scp, ocontext;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
int wait_for_reply, state_changed;
|
|
|
|
|
|
|
|
|
|
/* Stop the thread and abort its pending RPC operations. */
|
|
|
|
|
if (! ss_suspended)
|
1995-04-21 02:54:07 +00:00
|
|
|
|
{
|
|
|
|
|
err = __thread_suspend (ss->thread);
|
|
|
|
|
assert_perror (err);
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
/* Abort the thread's kernel context, so any pending message send
|
|
|
|
|
or receive completes immediately or aborts. If an interruptible
|
|
|
|
|
RPC is in progress, abort_rpcs will do this. But we must always
|
|
|
|
|
do it before fetching the thread's state, because
|
|
|
|
|
thread_get_state is never kosher before thread_abort. */
|
1995-11-22 10:00:23 +00:00
|
|
|
|
abort_thread (ss, &thread_state, NULL);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1995-05-08 09:11:25 +00:00
|
|
|
|
if (ss->context)
|
|
|
|
|
{
|
|
|
|
|
/* We have a previous sigcontext that sigreturn was about
|
|
|
|
|
to restore when another signal arrived. */
|
|
|
|
|
|
|
|
|
|
mach_port_t *loc;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1996-01-04 10:00:22 +00:00
|
|
|
|
if (_hurdsig_catch_memory_fault (ss->context))
|
1995-05-08 09:11:25 +00:00
|
|
|
|
{
|
|
|
|
|
/* We faulted reading the thread's stack. Forget that
|
|
|
|
|
context and pretend it wasn't there. It almost
|
|
|
|
|
certainly crash if this handler returns, but that's it's
|
|
|
|
|
problem. */
|
|
|
|
|
ss->context = NULL;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Copy the context from the thread's stack before
|
|
|
|
|
we start diddling the stack to set up the handler. */
|
|
|
|
|
ocontext = *ss->context;
|
|
|
|
|
ss->context = &ocontext;
|
|
|
|
|
}
|
|
|
|
|
_hurdsig_end_catch_fault ();
|
1995-11-10 20:38:31 +00:00
|
|
|
|
|
1995-05-08 09:11:25 +00:00
|
|
|
|
if (! machine_get_basic_state (ss->thread, &thread_state))
|
|
|
|
|
goto sigbomb;
|
hurd: Replace threadvars with TLS
This gets rid of a lot of kludge and gets closer to other ports.
* hurd/Makefile (headers): Remove threadvar.h.
(inline-headers): Remove threadvar.h.
* hurd/Versions (GLIBC_2.0: Remove __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables,
__hurd_threadvar_max, __hurd_errno_location.
(HURD_CTHREADS_0.3): Add pthread_getattr_np, pthread_attr_getstack.
* hurd/hurd/signal.h: Do not include <hurd/threadvar.h>.
(_hurd_self_sigstate): Use THREAD_SELF to get _hurd_sigstate.
(_HURD_SIGNAL_H_EXTERN_INLINE): Use THREAD_SELF to get _hurd_sigstate,
unless TLS is not initialized yet, in which case we do not need a
critical section yet anyway.
* hurd/hurd/threadvar.h: Include <tls.h>, do not include
<machine-sp.h>.
(__hurd_sigthread_variables, __hurd_threadvar_max): Remove variables
declarations.
(__hurd_threadvar_index): Remove enum.
(_HURD_THREADVAR_H_EXTERN_INLINE): Remove macro.
(__hurd_threadvar_location_from_sp,__hurd_threadvar_location): Remove
inlines.
(__hurd_reply_port0): New variable declaration.
(__hurd_local_reply_port): New macro.
* hurd/hurdsig.c (__hurd_sigthread_variables): Remove variable.
(interrupted_reply_port_location): Add thread_t parameter. Use it
with THREAD_TCB to access thread-local variables.
(_hurdsig_abort_rpcs): Pass ss->thread to
interrupted_reply_port_location.
(_hurd_internal_post_signal): Likewise.
(_hurdsig_init): Use presence of cthread_fork instead of
__hurd_threadvar_stack_mask to start signal thread by hand.
Remove signal thread threadvar initialization.
* hurd/hurdstartup.c: Do not include <hurd/threadvar.h>
* hurd/sigunwind.c: Include <hurd/threadvar.h>
(_hurdsig_longjmp_from_handler): Use __hurd_local_reply_port instead
of threadvar.
* sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE): Add
__libc_lock_self0.
(ld.GLIBC_2.0): Remove __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables.
(ld.GLIBC_PRIVATE): Add __libc_lock_self0.
* sysdeps/mach/hurd/cthreads.c: Add __libc_lock_self0.
* sysdeps/mach/hurd/dl-sysdep.c (errno, __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables, threadvars,
__hurd_threadvar_stack_offset, __hurd_threadvar_stack_mask): Do not
define variables.
* sysdeps/mach/hurd/errno-loc.c: Do not include <errno.h> and
<hurd/threadvar.h>.
[IS_IN(rtld)] (rtld_errno): New variable.
[IS_IN(rtld)] (__errno_location): New weak function.
[!IS_IN(rtld)]: Include "../../../csu/errno-loc.c".
* sysdeps/mach/hurd/errno.c: Remove file.
* sysdeps/mach/hurd/fork.c: Include <hurd/threadvar.h>
(__fork): Remove THREADVAR_SPACE macro and its use.
* sysdeps/mach/hurd/i386/init-first.c (__hurd_threadvar_max): Remove
variable.
(init): Do not initialize threadvar.
* sysdeps/mach/hurd/i386/libc.abilist (__hurd_threadvar_max): Remove
symbol.
* sysdeps/mach/hurd/i386/sigreturn.c (__sigreturn): Use
__hurd_local_reply_port instead of threadvar.
* sysdeps/mach/hurd/i386/tls.h (tcbhead_t): Add reply_port and
_hurd_sigstate fields.
(HURD_DESC_TLS, __LIBC_NO_TLS, THREAD_TCB): New macro.
* sysdeps/mach/hurd/i386/trampoline.c: Remove outdated comment.
* sysdeps/mach/hurd/libc-lock.h: Do not include <hurd/threadvar.h>.
(__libc_lock_owner_self): Use &__libc_lock_self0 and THREAD_SELF
instead of threadvar.
* sysdeps/mach/hurd/libc-tsd.h: Remove file.
* sysdeps/mach/hurd/mig-reply.c (GETPORT, reply_port): Remove macros.
(use_threadvar, global_reply_port): Remove variables.
(__hurd_reply_port0): New variable.
(__mig_get_reply_port): Use __hurd_local_reply_port and
__hurd_reply_port0 instead of threadvar.
(__mig_dealloc_reply_port): Likewise.
(__mig_init): Do not initialize threadvar.
* sysdeps/mach/hurd/profil.c: Fix comment.
2018-03-17 22:27:34 +00:00
|
|
|
|
loc = interrupted_reply_port_location (ss->thread,
|
|
|
|
|
&thread_state, 1);
|
1995-05-08 09:11:25 +00:00
|
|
|
|
if (loc && *loc != MACH_PORT_NULL)
|
|
|
|
|
/* This is the reply port for the context which called
|
|
|
|
|
sigreturn. Since we are abandoning that context entirely
|
|
|
|
|
and restoring SS->context instead, destroy this port. */
|
|
|
|
|
__mach_port_destroy (__mach_task_self (), *loc);
|
|
|
|
|
|
|
|
|
|
/* The thread was in sigreturn, not in any interruptible RPC. */
|
|
|
|
|
wait_for_reply = 0;
|
|
|
|
|
|
1996-05-04 09:46:57 +00:00
|
|
|
|
assert (! __spin_lock_locked (&ss->critical_section_lock));
|
1995-05-08 09:11:25 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
1995-02-18 01:27:10 +00:00
|
|
|
|
{
|
1996-07-05 23:47:08 +00:00
|
|
|
|
int crit = __spin_lock_locked (&ss->critical_section_lock);
|
|
|
|
|
|
1995-08-14 22:49:23 +00:00
|
|
|
|
wait_for_reply
|
1996-07-05 23:47:08 +00:00
|
|
|
|
= (_hurdsig_abort_rpcs (ss,
|
|
|
|
|
/* In a critical section, any RPC
|
|
|
|
|
should be cancelled instead of
|
|
|
|
|
restarted, regardless of
|
1998-05-19 16:13:05 +00:00
|
|
|
|
SA_RESTART, so the entire
|
1996-07-05 23:47:08 +00:00
|
|
|
|
"atomic" operation can be aborted
|
|
|
|
|
as a unit. */
|
|
|
|
|
crit ? 0 : signo, 1,
|
1995-08-14 22:49:23 +00:00
|
|
|
|
&thread_state, &state_changed,
|
1995-11-22 10:00:23 +00:00
|
|
|
|
&reply)
|
1995-08-14 22:49:23 +00:00
|
|
|
|
!= MACH_PORT_NULL);
|
1995-05-08 09:11:25 +00:00
|
|
|
|
|
1996-07-05 23:47:08 +00:00
|
|
|
|
if (crit)
|
1995-05-08 09:11:25 +00:00
|
|
|
|
{
|
|
|
|
|
/* The thread is in a critical section. Mark the signal as
|
|
|
|
|
pending. When it finishes the critical section, it will
|
|
|
|
|
check for pending signals. */
|
|
|
|
|
mark_pending ();
|
1996-07-05 23:47:08 +00:00
|
|
|
|
if (state_changed)
|
|
|
|
|
/* Some cases of interrupting an RPC must change the
|
|
|
|
|
thread state to back out the call. Normally this
|
|
|
|
|
change is rolled into the warping to the handler and
|
|
|
|
|
sigreturn, but we are not running the handler now
|
|
|
|
|
because the thread is in a critical section. Instead,
|
|
|
|
|
mutate the thread right away for the RPC interruption
|
|
|
|
|
and resume it; the RPC will return early so the
|
|
|
|
|
critical section can end soon. */
|
|
|
|
|
__thread_set_state (ss->thread, MACHINE_THREAD_STATE_FLAVOR,
|
|
|
|
|
(natural_t *) &thread_state.basic,
|
|
|
|
|
MACHINE_THREAD_STATE_COUNT);
|
|
|
|
|
/* */
|
|
|
|
|
ss->intr_port = MACH_PORT_NULL;
|
1995-05-08 09:11:25 +00:00
|
|
|
|
__thread_resume (ss->thread);
|
|
|
|
|
break;
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Call the machine-dependent function to set the thread up
|
|
|
|
|
to run the signal handler, and preserve its old context. */
|
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
|
|
|
|
scp = _hurd_setup_sighandler (ss, handler, signo, detail,
|
1995-02-18 01:27:10 +00:00
|
|
|
|
wait_for_reply, &thread_state);
|
|
|
|
|
if (scp == NULL)
|
1995-05-08 09:11:25 +00:00
|
|
|
|
goto sigbomb;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
/* Set the machine-independent parts of the signal context. */
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
/* Fetch the thread variable for the MiG reply port,
|
|
|
|
|
and set it to MACH_PORT_NULL. */
|
hurd: Replace threadvars with TLS
This gets rid of a lot of kludge and gets closer to other ports.
* hurd/Makefile (headers): Remove threadvar.h.
(inline-headers): Remove threadvar.h.
* hurd/Versions (GLIBC_2.0: Remove __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables,
__hurd_threadvar_max, __hurd_errno_location.
(HURD_CTHREADS_0.3): Add pthread_getattr_np, pthread_attr_getstack.
* hurd/hurd/signal.h: Do not include <hurd/threadvar.h>.
(_hurd_self_sigstate): Use THREAD_SELF to get _hurd_sigstate.
(_HURD_SIGNAL_H_EXTERN_INLINE): Use THREAD_SELF to get _hurd_sigstate,
unless TLS is not initialized yet, in which case we do not need a
critical section yet anyway.
* hurd/hurd/threadvar.h: Include <tls.h>, do not include
<machine-sp.h>.
(__hurd_sigthread_variables, __hurd_threadvar_max): Remove variables
declarations.
(__hurd_threadvar_index): Remove enum.
(_HURD_THREADVAR_H_EXTERN_INLINE): Remove macro.
(__hurd_threadvar_location_from_sp,__hurd_threadvar_location): Remove
inlines.
(__hurd_reply_port0): New variable declaration.
(__hurd_local_reply_port): New macro.
* hurd/hurdsig.c (__hurd_sigthread_variables): Remove variable.
(interrupted_reply_port_location): Add thread_t parameter. Use it
with THREAD_TCB to access thread-local variables.
(_hurdsig_abort_rpcs): Pass ss->thread to
interrupted_reply_port_location.
(_hurd_internal_post_signal): Likewise.
(_hurdsig_init): Use presence of cthread_fork instead of
__hurd_threadvar_stack_mask to start signal thread by hand.
Remove signal thread threadvar initialization.
* hurd/hurdstartup.c: Do not include <hurd/threadvar.h>
* hurd/sigunwind.c: Include <hurd/threadvar.h>
(_hurdsig_longjmp_from_handler): Use __hurd_local_reply_port instead
of threadvar.
* sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE): Add
__libc_lock_self0.
(ld.GLIBC_2.0): Remove __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables.
(ld.GLIBC_PRIVATE): Add __libc_lock_self0.
* sysdeps/mach/hurd/cthreads.c: Add __libc_lock_self0.
* sysdeps/mach/hurd/dl-sysdep.c (errno, __hurd_sigthread_stack_base,
__hurd_sigthread_stack_end, __hurd_sigthread_variables, threadvars,
__hurd_threadvar_stack_offset, __hurd_threadvar_stack_mask): Do not
define variables.
* sysdeps/mach/hurd/errno-loc.c: Do not include <errno.h> and
<hurd/threadvar.h>.
[IS_IN(rtld)] (rtld_errno): New variable.
[IS_IN(rtld)] (__errno_location): New weak function.
[!IS_IN(rtld)]: Include "../../../csu/errno-loc.c".
* sysdeps/mach/hurd/errno.c: Remove file.
* sysdeps/mach/hurd/fork.c: Include <hurd/threadvar.h>
(__fork): Remove THREADVAR_SPACE macro and its use.
* sysdeps/mach/hurd/i386/init-first.c (__hurd_threadvar_max): Remove
variable.
(init): Do not initialize threadvar.
* sysdeps/mach/hurd/i386/libc.abilist (__hurd_threadvar_max): Remove
symbol.
* sysdeps/mach/hurd/i386/sigreturn.c (__sigreturn): Use
__hurd_local_reply_port instead of threadvar.
* sysdeps/mach/hurd/i386/tls.h (tcbhead_t): Add reply_port and
_hurd_sigstate fields.
(HURD_DESC_TLS, __LIBC_NO_TLS, THREAD_TCB): New macro.
* sysdeps/mach/hurd/i386/trampoline.c: Remove outdated comment.
* sysdeps/mach/hurd/libc-lock.h: Do not include <hurd/threadvar.h>.
(__libc_lock_owner_self): Use &__libc_lock_self0 and THREAD_SELF
instead of threadvar.
* sysdeps/mach/hurd/libc-tsd.h: Remove file.
* sysdeps/mach/hurd/mig-reply.c (GETPORT, reply_port): Remove macros.
(use_threadvar, global_reply_port): Remove variables.
(__hurd_reply_port0): New variable.
(__mig_get_reply_port): Use __hurd_local_reply_port and
__hurd_reply_port0 instead of threadvar.
(__mig_dealloc_reply_port): Likewise.
(__mig_init): Do not initialize threadvar.
* sysdeps/mach/hurd/profil.c: Fix comment.
2018-03-17 22:27:34 +00:00
|
|
|
|
mach_port_t *loc = interrupted_reply_port_location (ss->thread,
|
|
|
|
|
&thread_state,
|
1995-08-14 22:49:23 +00:00
|
|
|
|
1);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
if (loc)
|
|
|
|
|
{
|
|
|
|
|
scp->sc_reply_port = *loc;
|
|
|
|
|
*loc = MACH_PORT_NULL;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
scp->sc_reply_port = MACH_PORT_NULL;
|
1995-05-08 09:11:25 +00:00
|
|
|
|
|
|
|
|
|
/* Save the intr_port in use by the interrupted code,
|
|
|
|
|
and clear the cell before running the trampoline. */
|
|
|
|
|
scp->sc_intr_port = ss->intr_port;
|
|
|
|
|
ss->intr_port = MACH_PORT_NULL;
|
|
|
|
|
|
|
|
|
|
if (ss->context)
|
|
|
|
|
{
|
|
|
|
|
/* After the handler runs we will restore to the state in
|
|
|
|
|
SS->context, not the state of the thread now. So restore
|
|
|
|
|
that context's reply port and intr port. */
|
|
|
|
|
|
|
|
|
|
scp->sc_reply_port = ss->context->sc_reply_port;
|
|
|
|
|
scp->sc_intr_port = ss->context->sc_intr_port;
|
|
|
|
|
|
|
|
|
|
ss->context = NULL;
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
1995-05-08 09:11:25 +00:00
|
|
|
|
/* Backdoor extra argument to signal handler. */
|
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
|
|
|
|
scp->sc_error = detail->error;
|
1995-05-08 09:11:25 +00:00
|
|
|
|
|
2001-07-27 08:50:55 +00:00
|
|
|
|
/* Block requested signals while running the handler. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
scp->sc_mask = ss->blocked;
|
2002-01-02 10:52:56 +00:00
|
|
|
|
__sigorset (&ss->blocked, &ss->blocked, &ss->actions[signo].sa_mask);
|
2001-07-23 07:19:20 +00:00
|
|
|
|
|
2001-07-27 08:50:55 +00:00
|
|
|
|
/* Also block SIGNO unless we're asked not to. */
|
|
|
|
|
if (! (ss->actions[signo].sa_flags & (SA_RESETHAND | SA_NODEFER)))
|
2002-01-02 10:52:56 +00:00
|
|
|
|
__sigaddset (&ss->blocked, signo);
|
2001-07-23 07:19:20 +00:00
|
|
|
|
|
2001-07-27 08:50:55 +00:00
|
|
|
|
/* Reset to SIG_DFL if requested. SIGILL and SIGTRAP cannot
|
|
|
|
|
be automatically reset when delivered; the system silently
|
|
|
|
|
enforces this restriction. */
|
|
|
|
|
if (ss->actions[signo].sa_flags & SA_RESETHAND
|
|
|
|
|
&& signo != SIGILL && signo != SIGTRAP)
|
2001-07-23 07:19:20 +00:00
|
|
|
|
ss->actions[signo].sa_handler = SIG_DFL;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
/* Start the thread running the handler (or possibly waiting for an
|
|
|
|
|
RPC reply before running the handler). */
|
1995-04-21 02:54:07 +00:00
|
|
|
|
err = __thread_set_state (ss->thread, MACHINE_THREAD_STATE_FLAVOR,
|
|
|
|
|
(natural_t *) &thread_state.basic,
|
|
|
|
|
MACHINE_THREAD_STATE_COUNT);
|
|
|
|
|
assert_perror (err);
|
|
|
|
|
err = __thread_resume (ss->thread);
|
|
|
|
|
assert_perror (err);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
thread_state.set = 0; /* Everything we know is now wrong. */
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The signal has either been ignored or is now being handled. We can
|
1995-11-10 20:38:31 +00:00
|
|
|
|
consider it delivered and reply to the killer. */
|
|
|
|
|
reply ();
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
/* We get here unless the signal was fatal. We still hold SS->lock.
|
|
|
|
|
Check for pending signals, and loop to post them. */
|
1995-05-27 07:18:52 +00:00
|
|
|
|
{
|
|
|
|
|
/* Return nonzero if SS has any signals pending we should worry about.
|
|
|
|
|
We don't worry about any pending signals if we are stopped, nor if
|
|
|
|
|
SS is in a critical section. We are guaranteed to get a sig_post
|
|
|
|
|
message before any of them become deliverable: either the SIGCONT
|
|
|
|
|
signal, or a sig_post with SIGNO==0 as an explicit poll when the
|
|
|
|
|
thread finishes its critical section. */
|
|
|
|
|
inline int signals_pending (void)
|
|
|
|
|
{
|
1996-05-04 09:46:57 +00:00
|
|
|
|
if (_hurd_stopped || __spin_lock_locked (&ss->critical_section_lock))
|
1995-05-27 07:18:52 +00:00
|
|
|
|
return 0;
|
|
|
|
|
return pending = ss->pending & ~ss->blocked;
|
|
|
|
|
}
|
|
|
|
|
|
1995-11-10 20:38:31 +00:00
|
|
|
|
check_pending_signals:
|
|
|
|
|
untraced = 0;
|
|
|
|
|
|
1995-05-27 07:18:52 +00:00
|
|
|
|
if (signals_pending ())
|
|
|
|
|
{
|
|
|
|
|
for (signo = 1; signo < NSIG; ++signo)
|
|
|
|
|
if (__sigismember (&pending, signo))
|
|
|
|
|
{
|
1996-06-13 20:44:10 +00:00
|
|
|
|
deliver_pending:
|
1995-05-27 07:18:52 +00:00
|
|
|
|
__sigdelset (&ss->pending, signo);
|
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
|
|
|
|
*detail = ss->pending_data[signo];
|
1995-05-27 07:18:52 +00:00
|
|
|
|
__spin_unlock (&ss->lock);
|
|
|
|
|
goto post_signal;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* No pending signals left undelivered for this thread.
|
|
|
|
|
If we were sent signal 0, we need to check for pending
|
|
|
|
|
signals for all threads. */
|
|
|
|
|
if (signo == 0)
|
|
|
|
|
{
|
|
|
|
|
__spin_unlock (&ss->lock);
|
|
|
|
|
__mutex_lock (&_hurd_siglock);
|
|
|
|
|
for (ss = _hurd_sigstates; ss != NULL; ss = ss->next)
|
1995-02-18 01:27:10 +00:00
|
|
|
|
{
|
1995-05-27 07:18:52 +00:00
|
|
|
|
__spin_lock (&ss->lock);
|
1996-06-06 20:49:22 +00:00
|
|
|
|
for (signo = 1; signo < NSIG; ++signo)
|
1996-06-28 19:44:50 +00:00
|
|
|
|
if (__sigismember (&ss->pending, signo)
|
|
|
|
|
&& (!__sigismember (&ss->blocked, signo)
|
1996-07-01 18:10:03 +00:00
|
|
|
|
/* We "deliver" immediately pending blocked signals whose
|
|
|
|
|
action might be to ignore, so that if ignored they are
|
|
|
|
|
dropped right away. */
|
1996-06-28 19:44:50 +00:00
|
|
|
|
|| ss->actions[signo].sa_handler == SIG_IGN
|
|
|
|
|
|| ss->actions[signo].sa_handler == SIG_DFL))
|
1996-06-28 20:29:45 +00:00
|
|
|
|
{
|
|
|
|
|
mutex_unlock (&_hurd_siglock);
|
|
|
|
|
goto deliver_pending;
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
__spin_unlock (&ss->lock);
|
|
|
|
|
}
|
1995-05-27 07:18:52 +00:00
|
|
|
|
__mutex_unlock (&_hurd_siglock);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* No more signals pending; SS->lock is still locked.
|
|
|
|
|
Wake up any sigsuspend call that is blocking SS->thread. */
|
|
|
|
|
if (ss->suspended != MACH_PORT_NULL)
|
|
|
|
|
{
|
|
|
|
|
/* There is a sigsuspend waiting. Tell it to wake up. */
|
|
|
|
|
error_t err;
|
|
|
|
|
mach_msg_header_t msg;
|
2001-07-04 23:07:03 +00:00
|
|
|
|
msg.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_MAKE_SEND, 0);
|
1995-05-27 07:18:52 +00:00
|
|
|
|
msg.msgh_remote_port = ss->suspended;
|
|
|
|
|
msg.msgh_local_port = MACH_PORT_NULL;
|
|
|
|
|
/* These values do not matter. */
|
|
|
|
|
msg.msgh_id = 8675309; /* Jenny, Jenny. */
|
|
|
|
|
ss->suspended = MACH_PORT_NULL;
|
|
|
|
|
err = __mach_msg (&msg, MACH_SEND_MSG, sizeof msg, 0,
|
|
|
|
|
MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE,
|
|
|
|
|
MACH_PORT_NULL);
|
|
|
|
|
assert_perror (err);
|
|
|
|
|
}
|
|
|
|
|
__spin_unlock (&ss->lock);
|
|
|
|
|
}
|
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
/* All pending signals delivered to all threads.
|
|
|
|
|
Now we can send the reply message even for signal 0. */
|
|
|
|
|
reply ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Decide whether REFPORT enables the sender to send us a SIGNO signal.
|
|
|
|
|
Returns zero if so, otherwise the error code to return to the sender. */
|
|
|
|
|
|
|
|
|
|
static error_t
|
|
|
|
|
signal_allowed (int signo, mach_port_t refport)
|
|
|
|
|
{
|
|
|
|
|
if (signo < 0 || signo >= NSIG)
|
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
|
|
if (refport == __mach_task_self ())
|
|
|
|
|
/* Can send any signal. */
|
|
|
|
|
goto win;
|
|
|
|
|
|
|
|
|
|
/* Avoid needing to check for this below. */
|
|
|
|
|
if (refport == MACH_PORT_NULL)
|
|
|
|
|
return EPERM;
|
|
|
|
|
|
|
|
|
|
switch (signo)
|
|
|
|
|
{
|
|
|
|
|
case SIGINT:
|
|
|
|
|
case SIGQUIT:
|
|
|
|
|
case SIGTSTP:
|
|
|
|
|
case SIGHUP:
|
|
|
|
|
case SIGINFO:
|
|
|
|
|
case SIGTTIN:
|
|
|
|
|
case SIGTTOU:
|
1996-10-08 18:38:08 +00:00
|
|
|
|
case SIGWINCH:
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* Job control signals can be sent by the controlling terminal. */
|
|
|
|
|
if (__USEPORT (CTTYID, port == refport))
|
|
|
|
|
goto win;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGCONT:
|
|
|
|
|
{
|
|
|
|
|
/* A continue signal can be sent by anyone in the session. */
|
|
|
|
|
mach_port_t sessport;
|
|
|
|
|
if (! __USEPORT (PROC, __proc_getsidport (port, &sessport)))
|
1995-11-10 20:38:31 +00:00
|
|
|
|
{
|
1995-02-18 01:27:10 +00:00
|
|
|
|
__mach_port_deallocate (__mach_task_self (), sessport);
|
|
|
|
|
if (refport == sessport)
|
|
|
|
|
goto win;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGIO:
|
|
|
|
|
case SIGURG:
|
|
|
|
|
{
|
|
|
|
|
/* Any io object a file descriptor refers to might send us
|
|
|
|
|
one of these signals using its async ID port for REFPORT.
|
|
|
|
|
|
|
|
|
|
This is pretty wide open; it is not unlikely that some random
|
|
|
|
|
process can at least open for reading something we have open,
|
|
|
|
|
get its async ID port, and send us a spurious SIGIO or SIGURG
|
|
|
|
|
signal. But BSD is actually wider open than that!--you can set
|
|
|
|
|
the owner of an io object to any process or process group
|
|
|
|
|
whatsoever and send them gratuitous signals.
|
|
|
|
|
|
|
|
|
|
Someday we could implement some reasonable scheme for
|
|
|
|
|
authorizing SIGIO and SIGURG signals properly. */
|
|
|
|
|
|
|
|
|
|
int d;
|
1996-04-24 03:28:51 +00:00
|
|
|
|
int lucky = 0; /* True if we find a match for REFPORT. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
__mutex_lock (&_hurd_dtable_lock);
|
1996-04-24 03:28:51 +00:00
|
|
|
|
for (d = 0; !lucky && (unsigned) d < (unsigned) _hurd_dtablesize; ++d)
|
1995-02-18 01:27:10 +00:00
|
|
|
|
{
|
|
|
|
|
struct hurd_userlink ulink;
|
|
|
|
|
io_t port;
|
|
|
|
|
mach_port_t asyncid;
|
|
|
|
|
if (_hurd_dtable[d] == NULL)
|
|
|
|
|
continue;
|
|
|
|
|
port = _hurd_port_get (&_hurd_dtable[d]->port, &ulink);
|
|
|
|
|
if (! __io_get_icky_async_id (port, &asyncid))
|
|
|
|
|
{
|
|
|
|
|
if (refport == asyncid)
|
|
|
|
|
/* Break out of the loop on the next iteration. */
|
1996-04-24 03:28:51 +00:00
|
|
|
|
lucky = 1;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
__mach_port_deallocate (__mach_task_self (), asyncid);
|
|
|
|
|
}
|
|
|
|
|
_hurd_port_free (&_hurd_dtable[d]->port, &ulink, port);
|
|
|
|
|
}
|
2009-01-07 01:59:43 +00:00
|
|
|
|
__mutex_unlock (&_hurd_dtable_lock);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* If we found a lucky winner, we've set D to -1 in the loop. */
|
1996-04-24 03:28:51 +00:00
|
|
|
|
if (lucky)
|
1995-02-18 01:27:10 +00:00
|
|
|
|
goto win;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If this signal is legit, we have done `goto win' by now.
|
|
|
|
|
When we return the error, mig deallocates REFPORT. */
|
|
|
|
|
return EPERM;
|
|
|
|
|
|
|
|
|
|
win:
|
|
|
|
|
/* Deallocate the REFPORT send right; we are done with it. */
|
|
|
|
|
__mach_port_deallocate (__mach_task_self (), refport);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Implement the sig_post RPC from <hurd/msg.defs>;
|
|
|
|
|
sent when someone wants us to get a signal. */
|
|
|
|
|
kern_return_t
|
|
|
|
|
_S_msg_sig_post (mach_port_t me,
|
|
|
|
|
mach_port_t reply_port, mach_msg_type_name_t reply_port_type,
|
1996-05-04 09:46:57 +00:00
|
|
|
|
int signo, natural_t sigcode,
|
1995-02-18 01:27:10 +00:00
|
|
|
|
mach_port_t refport)
|
|
|
|
|
{
|
|
|
|
|
error_t err;
|
1996-05-07 14:57:38 +00:00
|
|
|
|
struct hurd_signal_detail d;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
if (err = signal_allowed (signo, refport))
|
|
|
|
|
return err;
|
|
|
|
|
|
1996-05-07 14:57:38 +00:00
|
|
|
|
d.code = sigcode;
|
|
|
|
|
d.exc = 0;
|
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* Post the signal to the designated signal-receiving thread. This will
|
|
|
|
|
reply when the signal can be considered delivered. */
|
|
|
|
|
_hurd_internal_post_signal (_hurd_thread_sigstate (_hurd_sigthread),
|
1996-05-07 14:57:38 +00:00
|
|
|
|
signo, &d, reply_port, reply_port_type,
|
1995-02-18 01:27:10 +00:00
|
|
|
|
0); /* Stop if traced. */
|
|
|
|
|
|
|
|
|
|
return MIG_NO_REPLY; /* Already replied. */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Implement the sig_post_untraced RPC from <hurd/msg.defs>;
|
|
|
|
|
sent when the debugger wants us to really get a signal
|
|
|
|
|
even if we are traced. */
|
|
|
|
|
kern_return_t
|
|
|
|
|
_S_msg_sig_post_untraced (mach_port_t me,
|
|
|
|
|
mach_port_t reply_port,
|
|
|
|
|
mach_msg_type_name_t reply_port_type,
|
1996-05-04 09:46:57 +00:00
|
|
|
|
int signo, natural_t sigcode,
|
1995-02-18 01:27:10 +00:00
|
|
|
|
mach_port_t refport)
|
|
|
|
|
{
|
|
|
|
|
error_t err;
|
1996-05-07 14:57:38 +00:00
|
|
|
|
struct hurd_signal_detail d;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
if (err = signal_allowed (signo, refport))
|
|
|
|
|
return err;
|
|
|
|
|
|
1996-05-07 14:57:38 +00:00
|
|
|
|
d.code = sigcode;
|
|
|
|
|
d.exc = 0;
|
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* Post the signal to the designated signal-receiving thread. This will
|
|
|
|
|
reply when the signal can be considered delivered. */
|
|
|
|
|
_hurd_internal_post_signal (_hurd_thread_sigstate (_hurd_sigthread),
|
1996-05-07 14:57:38 +00:00
|
|
|
|
signo, &d, reply_port, reply_port_type,
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1); /* Untraced flag. */
|
|
|
|
|
|
|
|
|
|
return MIG_NO_REPLY; /* Already replied. */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern void __mig_init (void *);
|
|
|
|
|
|
|
|
|
|
#include <mach/task_special_ports.h>
|
|
|
|
|
|
|
|
|
|
/* Initialize the message port and _hurd_sigthread and start the signal
|
|
|
|
|
thread. */
|
|
|
|
|
|
|
|
|
|
void
|
1998-11-11 09:56:51 +00:00
|
|
|
|
_hurdsig_init (const int *intarray, size_t intarraysize)
|
1995-02-18 01:27:10 +00:00
|
|
|
|
{
|
|
|
|
|
error_t err;
|
|
|
|
|
vm_size_t stacksize;
|
1998-11-11 09:56:51 +00:00
|
|
|
|
struct hurd_sigstate *ss;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
__mutex_init (&_hurd_siglock);
|
|
|
|
|
|
1995-11-18 10:00:22 +00:00
|
|
|
|
err = __mach_port_allocate (__mach_task_self (),
|
|
|
|
|
MACH_PORT_RIGHT_RECEIVE,
|
|
|
|
|
&_hurd_msgport);
|
|
|
|
|
assert_perror (err);
|
1995-11-10 20:38:31 +00:00
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* Make a send right to the signal port. */
|
1995-11-18 10:00:22 +00:00
|
|
|
|
err = __mach_port_insert_right (__mach_task_self (),
|
|
|
|
|
_hurd_msgport,
|
|
|
|
|
_hurd_msgport,
|
|
|
|
|
MACH_MSG_TYPE_MAKE_SEND);
|
|
|
|
|
assert_perror (err);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1998-11-11 09:56:51 +00:00
|
|
|
|
/* Initialize the main thread's signal state. */
|
|
|
|
|
ss = _hurd_self_sigstate ();
|
|
|
|
|
|
|
|
|
|
/* Copy inherited values from our parent (or pre-exec process state)
|
|
|
|
|
into the signal settings of the main thread. */
|
|
|
|
|
if (intarraysize > INIT_SIGMASK)
|
|
|
|
|
ss->blocked = intarray[INIT_SIGMASK];
|
|
|
|
|
if (intarraysize > INIT_SIGPENDING)
|
2001-07-24 04:59:07 +00:00
|
|
|
|
ss->pending = intarray[INIT_SIGPENDING];
|
1998-11-11 09:56:51 +00:00
|
|
|
|
if (intarraysize > INIT_SIGIGN && intarray[INIT_SIGIGN] != 0)
|
|
|
|
|
{
|
|
|
|
|
int signo;
|
|
|
|
|
for (signo = 1; signo < NSIG; ++signo)
|
|
|
|
|
if (intarray[INIT_SIGIGN] & __sigmask(signo))
|
|
|
|
|
ss->actions[signo].sa_handler = SIG_IGN;
|
|
|
|
|
}
|
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* Set the default thread to receive task-global signals
|
|
|
|
|
to this one, the main (first) user thread. */
|
1998-11-11 09:56:51 +00:00
|
|
|
|
_hurd_sigthread = ss->thread;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
|
|
/* Start the signal thread listening on the message port. */
|
|
|
|
|
|
hurd: Fix link cthread/pthread symbol exposition.
* hurd/Versions (HURD_CTHREADS_0.3): Rename weak refs cthread_fork,
cthread_detach, pthread_getattr_np, pthread_attr_getstack,
cthread_keycreate, cthread_getspecific, cthread_setspecific to
__cthread_fork, __cthread_detach, __pthread_getattr_np,
__pthread_attr_getstack, __cthread_keycreate, __cthread_getspecific,
__cthread_setspecific.
* hurd/hurdsig.c (_hurdsig_init): Use __cthread_fork,
__cthread_detach, __pthread_getattr_np, __pthread_attr_getstack,
__cthread_t instead of cthread_fork, cthread_detach,
pthread_getattr_np, pthread_attr_getstack.
* sysdeps/mach/hurd/cthreads.c (cthread_keycreate): Rename to
__cthread_keycreate.
(cthread_getspecific): Rename to __cthread_getspecific.
(cthread_setspecific): Rename to __cthread_setspecific.
(__libc_getspecific): Use __cthread_getspecific instead of
cthread_getspecific.
* sysdeps/mach/hurd/libc-lock.h (__libc_key_create): Use
__cthread_keycreate instead of cthread_keycreate.
(__libc_setspecific): Use __cthread_setspecific instead of
cthread_setspecific.
* sysdeps/mach/libc-lock.h (__libc_key_create, __libc_setspecific):
Likewise.
2018-03-17 22:53:39 +00:00
|
|
|
|
#pragma weak __cthread_fork
|
|
|
|
|
if (!__cthread_fork)
|
1999-11-18 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdsig.c (_hurdsig_init): If __hurd_threadvar_stack_mask is
nonzero, use cthread_fork to create the signal thread.
* hurd/msgportdemux.c (_hurd_msgport_receive): Initialize
_hurd_msgport_thread here (to self).
* sysdeps/mach/hurd/fork.c (__fork): When __hurd_sigthread_stack_end
is zero, instead compute child signal thread's starting SP from parent
signal thread's current SP and the threadvar_stack variables.
* hurd/Versions (GLIBC_2.1.3): Add cthread_fork, cthread_detach.
These are now referenced weakly by _hurdsig_init.
* hurd/report-wait.c (_S_msg_report_wait): Fix typo:
&_hurd_itimer_thread not &_hurd_msgport_thread.
1999-10-01 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdfchdir.c (_hurd_change_directory_port_from_fd): Rewrite
without HURD_DPORT_USE to clean up warnings.
* hurd/dtable.c (get_dtable_port): Likewise.
* hurd/hurdioctl.c (rectty_dtable): Renamed to install_ctty.
(install_ctty): Do the changing of the cttyid port cell here, inside
the critical section while we holding the dtable lock.
(_hurd_setcttyid, tiocsctty, tiocnotty): Use that instead of changing
the port cell and calling rectty_dtable.
(_hurd_locked_install_cttyid): New function, split out of install_ctty.
(install_ctty): Use it inside a critical section, with the lock held.
* sysdeps/mach/hurd/setsid.c (__setsid): Use
_hurd_locked_install_cttyid to effect the cttyid and dtable changes
after proc_setsid, having held the dtable lock throughout.
* hurd/dtable.c (ctty_new_pgrp): With the dtable lock held, check the
cttyid port for null and bail out early if so. The dtable lock
serializes us after any cttyid change and its associated dtable update.
1999-12-03 05:01:23 +00:00
|
|
|
|
{
|
|
|
|
|
err = __thread_create (__mach_task_self (), &_hurd_msgport_thread);
|
|
|
|
|
assert_perror (err);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1999-11-18 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdsig.c (_hurdsig_init): If __hurd_threadvar_stack_mask is
nonzero, use cthread_fork to create the signal thread.
* hurd/msgportdemux.c (_hurd_msgport_receive): Initialize
_hurd_msgport_thread here (to self).
* sysdeps/mach/hurd/fork.c (__fork): When __hurd_sigthread_stack_end
is zero, instead compute child signal thread's starting SP from parent
signal thread's current SP and the threadvar_stack variables.
* hurd/Versions (GLIBC_2.1.3): Add cthread_fork, cthread_detach.
These are now referenced weakly by _hurdsig_init.
* hurd/report-wait.c (_S_msg_report_wait): Fix typo:
&_hurd_itimer_thread not &_hurd_msgport_thread.
1999-10-01 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdfchdir.c (_hurd_change_directory_port_from_fd): Rewrite
without HURD_DPORT_USE to clean up warnings.
* hurd/dtable.c (get_dtable_port): Likewise.
* hurd/hurdioctl.c (rectty_dtable): Renamed to install_ctty.
(install_ctty): Do the changing of the cttyid port cell here, inside
the critical section while we holding the dtable lock.
(_hurd_setcttyid, tiocsctty, tiocnotty): Use that instead of changing
the port cell and calling rectty_dtable.
(_hurd_locked_install_cttyid): New function, split out of install_ctty.
(install_ctty): Use it inside a critical section, with the lock held.
* sysdeps/mach/hurd/setsid.c (__setsid): Use
_hurd_locked_install_cttyid to effect the cttyid and dtable changes
after proc_setsid, having held the dtable lock throughout.
* hurd/dtable.c (ctty_new_pgrp): With the dtable lock held, check the
cttyid port for null and bail out early if so. The dtable lock
serializes us after any cttyid change and its associated dtable update.
1999-12-03 05:01:23 +00:00
|
|
|
|
stacksize = __vm_page_size * 8; /* Small stack for signal thread. */
|
|
|
|
|
err = __mach_setup_thread (__mach_task_self (), _hurd_msgport_thread,
|
|
|
|
|
_hurd_msgport_receive,
|
|
|
|
|
(vm_address_t *) &__hurd_sigthread_stack_base,
|
|
|
|
|
&stacksize);
|
|
|
|
|
assert_perror (err);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1999-11-18 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdsig.c (_hurdsig_init): If __hurd_threadvar_stack_mask is
nonzero, use cthread_fork to create the signal thread.
* hurd/msgportdemux.c (_hurd_msgport_receive): Initialize
_hurd_msgport_thread here (to self).
* sysdeps/mach/hurd/fork.c (__fork): When __hurd_sigthread_stack_end
is zero, instead compute child signal thread's starting SP from parent
signal thread's current SP and the threadvar_stack variables.
* hurd/Versions (GLIBC_2.1.3): Add cthread_fork, cthread_detach.
These are now referenced weakly by _hurdsig_init.
* hurd/report-wait.c (_S_msg_report_wait): Fix typo:
&_hurd_itimer_thread not &_hurd_msgport_thread.
1999-10-01 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdfchdir.c (_hurd_change_directory_port_from_fd): Rewrite
without HURD_DPORT_USE to clean up warnings.
* hurd/dtable.c (get_dtable_port): Likewise.
* hurd/hurdioctl.c (rectty_dtable): Renamed to install_ctty.
(install_ctty): Do the changing of the cttyid port cell here, inside
the critical section while we holding the dtable lock.
(_hurd_setcttyid, tiocsctty, tiocnotty): Use that instead of changing
the port cell and calling rectty_dtable.
(_hurd_locked_install_cttyid): New function, split out of install_ctty.
(install_ctty): Use it inside a critical section, with the lock held.
* sysdeps/mach/hurd/setsid.c (__setsid): Use
_hurd_locked_install_cttyid to effect the cttyid and dtable changes
after proc_setsid, having held the dtable lock throughout.
* hurd/dtable.c (ctty_new_pgrp): With the dtable lock held, check the
cttyid port for null and bail out early if so. The dtable lock
serializes us after any cttyid change and its associated dtable update.
1999-12-03 05:01:23 +00:00
|
|
|
|
__hurd_sigthread_stack_end = __hurd_sigthread_stack_base + stacksize;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1999-11-18 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdsig.c (_hurdsig_init): If __hurd_threadvar_stack_mask is
nonzero, use cthread_fork to create the signal thread.
* hurd/msgportdemux.c (_hurd_msgport_receive): Initialize
_hurd_msgport_thread here (to self).
* sysdeps/mach/hurd/fork.c (__fork): When __hurd_sigthread_stack_end
is zero, instead compute child signal thread's starting SP from parent
signal thread's current SP and the threadvar_stack variables.
* hurd/Versions (GLIBC_2.1.3): Add cthread_fork, cthread_detach.
These are now referenced weakly by _hurdsig_init.
* hurd/report-wait.c (_S_msg_report_wait): Fix typo:
&_hurd_itimer_thread not &_hurd_msgport_thread.
1999-10-01 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdfchdir.c (_hurd_change_directory_port_from_fd): Rewrite
without HURD_DPORT_USE to clean up warnings.
* hurd/dtable.c (get_dtable_port): Likewise.
* hurd/hurdioctl.c (rectty_dtable): Renamed to install_ctty.
(install_ctty): Do the changing of the cttyid port cell here, inside
the critical section while we holding the dtable lock.
(_hurd_setcttyid, tiocsctty, tiocnotty): Use that instead of changing
the port cell and calling rectty_dtable.
(_hurd_locked_install_cttyid): New function, split out of install_ctty.
(install_ctty): Use it inside a critical section, with the lock held.
* sysdeps/mach/hurd/setsid.c (__setsid): Use
_hurd_locked_install_cttyid to effect the cttyid and dtable changes
after proc_setsid, having held the dtable lock throughout.
* hurd/dtable.c (ctty_new_pgrp): With the dtable lock held, check the
cttyid port for null and bail out early if so. The dtable lock
serializes us after any cttyid change and its associated dtable update.
1999-12-03 05:01:23 +00:00
|
|
|
|
/* Reinitialize the MiG support routines so they will use a per-thread
|
|
|
|
|
variable for the cached reply port. */
|
|
|
|
|
__mig_init ((void *) __hurd_sigthread_stack_base);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
1999-11-18 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdsig.c (_hurdsig_init): If __hurd_threadvar_stack_mask is
nonzero, use cthread_fork to create the signal thread.
* hurd/msgportdemux.c (_hurd_msgport_receive): Initialize
_hurd_msgport_thread here (to self).
* sysdeps/mach/hurd/fork.c (__fork): When __hurd_sigthread_stack_end
is zero, instead compute child signal thread's starting SP from parent
signal thread's current SP and the threadvar_stack variables.
* hurd/Versions (GLIBC_2.1.3): Add cthread_fork, cthread_detach.
These are now referenced weakly by _hurdsig_init.
* hurd/report-wait.c (_S_msg_report_wait): Fix typo:
&_hurd_itimer_thread not &_hurd_msgport_thread.
1999-10-01 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdfchdir.c (_hurd_change_directory_port_from_fd): Rewrite
without HURD_DPORT_USE to clean up warnings.
* hurd/dtable.c (get_dtable_port): Likewise.
* hurd/hurdioctl.c (rectty_dtable): Renamed to install_ctty.
(install_ctty): Do the changing of the cttyid port cell here, inside
the critical section while we holding the dtable lock.
(_hurd_setcttyid, tiocsctty, tiocnotty): Use that instead of changing
the port cell and calling rectty_dtable.
(_hurd_locked_install_cttyid): New function, split out of install_ctty.
(install_ctty): Use it inside a critical section, with the lock held.
* sysdeps/mach/hurd/setsid.c (__setsid): Use
_hurd_locked_install_cttyid to effect the cttyid and dtable changes
after proc_setsid, having held the dtable lock throughout.
* hurd/dtable.c (ctty_new_pgrp): With the dtable lock held, check the
cttyid port for null and bail out early if so. The dtable lock
serializes us after any cttyid change and its associated dtable update.
1999-12-03 05:01:23 +00:00
|
|
|
|
err = __thread_resume (_hurd_msgport_thread);
|
|
|
|
|
assert_perror (err);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* When cthreads is being used, we need to make the signal thread a
|
|
|
|
|
proper cthread. Otherwise it cannot use mutex_lock et al, which
|
|
|
|
|
will be the cthreads versions. Various of the message port RPC
|
|
|
|
|
handlers need to take locks, so we need to be able to call into
|
|
|
|
|
cthreads code and meet its assumptions about how our thread and
|
|
|
|
|
its stack are arranged. Since cthreads puts it there anyway,
|
|
|
|
|
we'll let the signal thread's per-thread variables be found as for
|
|
|
|
|
any normal cthread, and just leave the magic __hurd_sigthread_*
|
|
|
|
|
values all zero so they'll be ignored. */
|
hurd: Fix link cthread/pthread symbol exposition.
* hurd/Versions (HURD_CTHREADS_0.3): Rename weak refs cthread_fork,
cthread_detach, pthread_getattr_np, pthread_attr_getstack,
cthread_keycreate, cthread_getspecific, cthread_setspecific to
__cthread_fork, __cthread_detach, __pthread_getattr_np,
__pthread_attr_getstack, __cthread_keycreate, __cthread_getspecific,
__cthread_setspecific.
* hurd/hurdsig.c (_hurdsig_init): Use __cthread_fork,
__cthread_detach, __pthread_getattr_np, __pthread_attr_getstack,
__cthread_t instead of cthread_fork, cthread_detach,
pthread_getattr_np, pthread_attr_getstack.
* sysdeps/mach/hurd/cthreads.c (cthread_keycreate): Rename to
__cthread_keycreate.
(cthread_getspecific): Rename to __cthread_getspecific.
(cthread_setspecific): Rename to __cthread_setspecific.
(__libc_getspecific): Use __cthread_getspecific instead of
cthread_getspecific.
* sysdeps/mach/hurd/libc-lock.h (__libc_key_create): Use
__cthread_keycreate instead of cthread_keycreate.
(__libc_setspecific): Use __cthread_setspecific instead of
cthread_setspecific.
* sysdeps/mach/libc-lock.h (__libc_key_create, __libc_setspecific):
Likewise.
2018-03-17 22:53:39 +00:00
|
|
|
|
#pragma weak __cthread_detach
|
|
|
|
|
#pragma weak __pthread_getattr_np
|
|
|
|
|
#pragma weak __pthread_attr_getstack
|
|
|
|
|
__cthread_t thread = __cthread_fork (
|
|
|
|
|
(cthread_fn_t) &_hurd_msgport_receive, 0);
|
|
|
|
|
__cthread_detach (thread);
|
|
|
|
|
|
|
|
|
|
if (__pthread_getattr_np)
|
2018-03-17 21:50:09 +00:00
|
|
|
|
{
|
|
|
|
|
/* Record signal thread stack layout for fork() */
|
|
|
|
|
pthread_attr_t attr;
|
|
|
|
|
void *addr;
|
|
|
|
|
size_t size;
|
|
|
|
|
|
hurd: Fix link cthread/pthread symbol exposition.
* hurd/Versions (HURD_CTHREADS_0.3): Rename weak refs cthread_fork,
cthread_detach, pthread_getattr_np, pthread_attr_getstack,
cthread_keycreate, cthread_getspecific, cthread_setspecific to
__cthread_fork, __cthread_detach, __pthread_getattr_np,
__pthread_attr_getstack, __cthread_keycreate, __cthread_getspecific,
__cthread_setspecific.
* hurd/hurdsig.c (_hurdsig_init): Use __cthread_fork,
__cthread_detach, __pthread_getattr_np, __pthread_attr_getstack,
__cthread_t instead of cthread_fork, cthread_detach,
pthread_getattr_np, pthread_attr_getstack.
* sysdeps/mach/hurd/cthreads.c (cthread_keycreate): Rename to
__cthread_keycreate.
(cthread_getspecific): Rename to __cthread_getspecific.
(cthread_setspecific): Rename to __cthread_setspecific.
(__libc_getspecific): Use __cthread_getspecific instead of
cthread_getspecific.
* sysdeps/mach/hurd/libc-lock.h (__libc_key_create): Use
__cthread_keycreate instead of cthread_keycreate.
(__libc_setspecific): Use __cthread_setspecific instead of
cthread_setspecific.
* sysdeps/mach/libc-lock.h (__libc_key_create, __libc_setspecific):
Likewise.
2018-03-17 22:53:39 +00:00
|
|
|
|
__pthread_getattr_np ((pthread_t) thread, &attr);
|
|
|
|
|
__pthread_attr_getstack (&attr, &addr, &size);
|
2018-03-17 21:50:09 +00:00
|
|
|
|
__hurd_sigthread_stack_base = (uintptr_t) addr;
|
|
|
|
|
__hurd_sigthread_stack_end = __hurd_sigthread_stack_base + size;
|
|
|
|
|
}
|
2000-08-22 19:31:27 +00:00
|
|
|
|
|
|
|
|
|
/* XXX We need the thread port for the signal thread further on
|
|
|
|
|
in this thread (see hurdfault.c:_hurdsigfault_init).
|
|
|
|
|
Therefore we block until _hurd_msgport_thread is initialized
|
|
|
|
|
by the newly created thread. This really shouldn't be
|
|
|
|
|
necessary; we should be able to fetch the thread port for a
|
|
|
|
|
cthread from here. */
|
|
|
|
|
while (_hurd_msgport_thread == 0)
|
|
|
|
|
__swtch_pri (0);
|
1999-11-18 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdsig.c (_hurdsig_init): If __hurd_threadvar_stack_mask is
nonzero, use cthread_fork to create the signal thread.
* hurd/msgportdemux.c (_hurd_msgport_receive): Initialize
_hurd_msgport_thread here (to self).
* sysdeps/mach/hurd/fork.c (__fork): When __hurd_sigthread_stack_end
is zero, instead compute child signal thread's starting SP from parent
signal thread's current SP and the threadvar_stack variables.
* hurd/Versions (GLIBC_2.1.3): Add cthread_fork, cthread_detach.
These are now referenced weakly by _hurdsig_init.
* hurd/report-wait.c (_S_msg_report_wait): Fix typo:
&_hurd_itimer_thread not &_hurd_msgport_thread.
1999-10-01 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdfchdir.c (_hurd_change_directory_port_from_fd): Rewrite
without HURD_DPORT_USE to clean up warnings.
* hurd/dtable.c (get_dtable_port): Likewise.
* hurd/hurdioctl.c (rectty_dtable): Renamed to install_ctty.
(install_ctty): Do the changing of the cttyid port cell here, inside
the critical section while we holding the dtable lock.
(_hurd_setcttyid, tiocsctty, tiocnotty): Use that instead of changing
the port cell and calling rectty_dtable.
(_hurd_locked_install_cttyid): New function, split out of install_ctty.
(install_ctty): Use it inside a critical section, with the lock held.
* sysdeps/mach/hurd/setsid.c (__setsid): Use
_hurd_locked_install_cttyid to effect the cttyid and dtable changes
after proc_setsid, having held the dtable lock throughout.
* hurd/dtable.c (ctty_new_pgrp): With the dtable lock held, check the
cttyid port for null and bail out early if so. The dtable lock
serializes us after any cttyid change and its associated dtable update.
1999-12-03 05:01:23 +00:00
|
|
|
|
}
|
1995-11-10 20:38:31 +00:00
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* Receive exceptions on the signal port. */
|
2002-01-02 10:23:33 +00:00
|
|
|
|
#ifdef TASK_EXCEPTION_PORT
|
1995-02-18 01:27:10 +00:00
|
|
|
|
__task_set_special_port (__mach_task_self (),
|
|
|
|
|
TASK_EXCEPTION_PORT, _hurd_msgport);
|
2002-01-02 10:23:33 +00:00
|
|
|
|
#elif defined (EXC_MASK_ALL)
|
|
|
|
|
__task_set_exception_ports (__mach_task_self (),
|
|
|
|
|
EXC_MASK_ALL & ~(EXC_MASK_SYSCALL
|
|
|
|
|
| EXC_MASK_MACH_SYSCALL
|
|
|
|
|
| EXC_MASK_RPC_ALERT),
|
|
|
|
|
_hurd_msgport,
|
|
|
|
|
EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
|
|
|
|
|
#else
|
|
|
|
|
# error task_set_exception_port?
|
|
|
|
|
#endif
|
1998-11-11 11:28:20 +00:00
|
|
|
|
|
|
|
|
|
/* Sanity check. Any pending, unblocked signals should have been
|
|
|
|
|
taken by our predecessor incarnation (i.e. parent or pre-exec state)
|
|
|
|
|
before packing up our init ints. This assert is last (not above)
|
|
|
|
|
so that signal handling is all set up to handle the abort. */
|
|
|
|
|
assert ((ss->pending &~ ss->blocked) == 0);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
}
|
|
|
|
|
/* XXXX */
|
|
|
|
|
/* Reauthenticate with the proc server. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
reauth_proc (mach_port_t new)
|
|
|
|
|
{
|
|
|
|
|
mach_port_t ref, ignore;
|
|
|
|
|
|
|
|
|
|
ref = __mach_reply_port ();
|
|
|
|
|
if (! HURD_PORT_USE (&_hurd_ports[INIT_PORT_PROC],
|
|
|
|
|
__proc_reauthenticate (port, ref,
|
|
|
|
|
MACH_MSG_TYPE_MAKE_SEND) ||
|
1996-05-04 09:46:57 +00:00
|
|
|
|
__auth_user_authenticate (new, ref,
|
1995-02-18 01:27:10 +00:00
|
|
|
|
MACH_MSG_TYPE_MAKE_SEND,
|
|
|
|
|
&ignore))
|
|
|
|
|
&& ignore != MACH_PORT_NULL)
|
|
|
|
|
__mach_port_deallocate (__mach_task_self (), ignore);
|
|
|
|
|
__mach_port_destroy (__mach_task_self (), ref);
|
|
|
|
|
|
1997-07-06 22:02:42 +00:00
|
|
|
|
/* Set the owner of the process here too. */
|
hurd: Reimplement libc locks using mach's gsync
* hurd/Makefile (routines): Add hurdlock.
* hurd/Versions (GLIBC_PRIVATE): Added new entry to export the above
interface.
(HURD_CTHREADS_0.3): Remove __libc_getspecific.
* hurd/hurdpid.c: Include <lowlevellock.h>
(_S_msg_proc_newids): Use lll_wait to synchronize.
* hurd/hurdsig.c: (reauth_proc): Use __mutex_lock and __mutex_unlock.
* hurd/setauth.c: Include <hurdlock.h>, use integer for synchronization.
* mach/Makefile (lock-headers): Remove machine-lock.h.
* mach/lock-intern.h: Include <lowlevellock.h> instead of
<machine-lock.h>.
(__spin_lock_t): New type.
(__SPIN_LOCK_INITIALIZER): New macro.
(__spin_lock, __spin_unlock, __spin_try_lock, __spin_lock_locked,
__mutex_init, __mutex_lock_solid, __mutex_unlock_solid, __mutex_lock,
__mutex_unlock, __mutex_trylock): Use lll to implement locks.
* mach/mutex-init.c: Include <lowlevellock.h> instead of <cthreads.h>.
(__mutex_init): Initialize with lll.
* manual/errno.texi (EOWNERDEAD, ENOTRECOVERABLE): New errno values.
* sysdeps/mach/Makefile: Add libmachuser as dependencies for libs
needing lll.
* sysdeps/mach/hurd/bits/errno.h: Regenerate.
* sysdeps/mach/hurd/cthreads.c (__libc_getspecific): Remove function.
* sysdeps/mach/hurd/bits/libc-lock.h: Remove file.
* sysdeps/mach/hurd/setpgid.c: Include <lowlevellock.h>.
(__setpgid): Use lll for synchronization.
* sysdeps/mach/hurd/setsid.c: Likewise with __setsid.
* sysdeps/mach/bits/libc-lock.h: Include <tls.h> and <lowlevellock.h>
instead of <cthreads.h>.
(_IO_lock_inexpensive): New macro
(__libc_lock_recursive_t, __rtld_lock_recursive_t): New structures.
(__libc_lock_self0): New declaration.
(__libc_lock_owner_self): New macro.
(__libc_key_t): Remove type.
(_LIBC_LOCK_INITIALIZER): New macro.
(__libc_lock_define_initialized, __libc_lock_init, __libc_lock_fini,
__libc_lock_fini_recursive, __rtld_lock_fini_recursive,
__libc_lock_lock, __libc_lock_trylock, __libc_lock_unlock,
__libc_lock_define_initialized_recursive,
__rtld_lock_define_initialized_recursive,
__libc_lock_init_recursive, __libc_lock_trylock_recursive,
__libc_lock_lock_recursive, __libc_lock_unlock_recursive,
__rtld_lock_initialize, __rtld_lock_trylock_recursive,
__rtld_lock_lock_recursive, __rtld_lock_unlock_recursive
__libc_once_define, __libc_mutex_unlock): Reimplement with lll.
(__libc_lock_define_recursive, __rtld_lock_define_recursive,
_LIBC_LOCK_RECURSIVE_INITIALIZER, _RTLD_LOCK_RECURSIVE_INITIALIZER):
New macros.
Include <libc-lockP.h> to reimplement libc_key* with pthread_key*.
* hurd/hurdlock.c: New file.
* hurd/hurdlock.h: New file.
* mach/lowlevellock.h: New file
2018-03-18 17:22:55 +00:00
|
|
|
|
__mutex_lock (&_hurd_id.lock);
|
1997-07-06 22:02:42 +00:00
|
|
|
|
if (!_hurd_check_ids ())
|
|
|
|
|
HURD_PORT_USE (&_hurd_ports[INIT_PORT_PROC],
|
|
|
|
|
__proc_setowner (port,
|
|
|
|
|
(_hurd_id.gen.nuids
|
|
|
|
|
? _hurd_id.gen.uids[0] : 0),
|
|
|
|
|
!_hurd_id.gen.nuids));
|
hurd: Reimplement libc locks using mach's gsync
* hurd/Makefile (routines): Add hurdlock.
* hurd/Versions (GLIBC_PRIVATE): Added new entry to export the above
interface.
(HURD_CTHREADS_0.3): Remove __libc_getspecific.
* hurd/hurdpid.c: Include <lowlevellock.h>
(_S_msg_proc_newids): Use lll_wait to synchronize.
* hurd/hurdsig.c: (reauth_proc): Use __mutex_lock and __mutex_unlock.
* hurd/setauth.c: Include <hurdlock.h>, use integer for synchronization.
* mach/Makefile (lock-headers): Remove machine-lock.h.
* mach/lock-intern.h: Include <lowlevellock.h> instead of
<machine-lock.h>.
(__spin_lock_t): New type.
(__SPIN_LOCK_INITIALIZER): New macro.
(__spin_lock, __spin_unlock, __spin_try_lock, __spin_lock_locked,
__mutex_init, __mutex_lock_solid, __mutex_unlock_solid, __mutex_lock,
__mutex_unlock, __mutex_trylock): Use lll to implement locks.
* mach/mutex-init.c: Include <lowlevellock.h> instead of <cthreads.h>.
(__mutex_init): Initialize with lll.
* manual/errno.texi (EOWNERDEAD, ENOTRECOVERABLE): New errno values.
* sysdeps/mach/Makefile: Add libmachuser as dependencies for libs
needing lll.
* sysdeps/mach/hurd/bits/errno.h: Regenerate.
* sysdeps/mach/hurd/cthreads.c (__libc_getspecific): Remove function.
* sysdeps/mach/hurd/bits/libc-lock.h: Remove file.
* sysdeps/mach/hurd/setpgid.c: Include <lowlevellock.h>.
(__setpgid): Use lll for synchronization.
* sysdeps/mach/hurd/setsid.c: Likewise with __setsid.
* sysdeps/mach/bits/libc-lock.h: Include <tls.h> and <lowlevellock.h>
instead of <cthreads.h>.
(_IO_lock_inexpensive): New macro
(__libc_lock_recursive_t, __rtld_lock_recursive_t): New structures.
(__libc_lock_self0): New declaration.
(__libc_lock_owner_self): New macro.
(__libc_key_t): Remove type.
(_LIBC_LOCK_INITIALIZER): New macro.
(__libc_lock_define_initialized, __libc_lock_init, __libc_lock_fini,
__libc_lock_fini_recursive, __rtld_lock_fini_recursive,
__libc_lock_lock, __libc_lock_trylock, __libc_lock_unlock,
__libc_lock_define_initialized_recursive,
__rtld_lock_define_initialized_recursive,
__libc_lock_init_recursive, __libc_lock_trylock_recursive,
__libc_lock_lock_recursive, __libc_lock_unlock_recursive,
__rtld_lock_initialize, __rtld_lock_trylock_recursive,
__rtld_lock_lock_recursive, __rtld_lock_unlock_recursive
__libc_once_define, __libc_mutex_unlock): Reimplement with lll.
(__libc_lock_define_recursive, __rtld_lock_define_recursive,
_LIBC_LOCK_RECURSIVE_INITIALIZER, _RTLD_LOCK_RECURSIVE_INITIALIZER):
New macros.
Include <libc-lockP.h> to reimplement libc_key* with pthread_key*.
* hurd/hurdlock.c: New file.
* hurd/hurdlock.h: New file.
* mach/lowlevellock.h: New file
2018-03-18 17:22:55 +00:00
|
|
|
|
__mutex_unlock (&_hurd_id.lock);
|
1997-07-06 22:02:42 +00:00
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
(void) &reauth_proc; /* Silence compiler warning. */
|
|
|
|
|
}
|
|
|
|
|
text_set_element (_hurd_reauth_hook, reauth_proc);
|
|
|
|
|
|
|
|
|
|
/* Like `getenv', but safe for the signal thread to run.
|
|
|
|
|
If the environment is trashed, this will just return NULL. */
|
|
|
|
|
|
|
|
|
|
const char *
|
|
|
|
|
_hurdsig_getenv (const char *variable)
|
|
|
|
|
{
|
2002-07-24 23:05:17 +00:00
|
|
|
|
if (__libc_enable_secure)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
1996-01-04 10:00:22 +00:00
|
|
|
|
if (_hurdsig_catch_memory_fault (__environ))
|
1995-02-18 01:27:10 +00:00
|
|
|
|
/* We bombed in getenv. */
|
|
|
|
|
return NULL;
|
|
|
|
|
else
|
|
|
|
|
{
|
1996-01-04 10:00:22 +00:00
|
|
|
|
const size_t len = strlen (variable);
|
|
|
|
|
char *value = NULL;
|
|
|
|
|
char *volatile *ep = __environ;
|
|
|
|
|
while (*ep)
|
|
|
|
|
{
|
|
|
|
|
const char *p = *ep;
|
update from main archive 961217
Wed Dec 18 03:31:58 1996 Ulrich Drepper <drepper@cygnus.com>
* dirent/scandir.c: Undo change from Mon Dec 2 15:32:15 1996.
The stream is private and usages outside glibc don't care about
reentrancy.
* io/fts.c: Likewise.
* io/ftw.c: Likewise.
* sysdeps/posix/getcwd.c: Likewise.
* sysdeps/posix/ttyname.c: Likewise.
* sysdeps/posix/ttyname_r.c: Likewise.
* sysdeps/posix/glob.c: Likewise.
* libio/iovsprintf.c: Add cast to prevent warning.
* libio/iovsscanf.c: Likewise.
* libio/libioP.h: Define mmap to __mmap and munmap to __munmap
to keep namespace clean.
* new-malloc/malloc.c: Update to last version from Wolfram Gloger.
Add hooks and check functions from old GNU malloc.
* new-malloc/malloc.h: Likewise.
* nis/ypclnt.c: Remove prototype for xdr_free.
* snrpc/rpc/xdr.h: Add prototype for xdr_free.
* manual/nss.texi: Correct description of default values and don't
meantion NSS as an add-on.
* nss/grp-lookup.c: Provide default value as
"compat [NOTFOUND=return] files".
* nss/pwd-lookup.c: Likewise.
* nss/spwd-lookup.c: Likewise.
* nss/network-lookup.c: Correct default to
"dns [!UNAVAIL=return] files".
* nss/nsswitch.c: Change default-default value to "nis
[NOTFOUND=return] files" since compat is only available for group,
passwd, and shadow.
* stdlib/on_exit.c (on_exit): Rename to __on_exit and make old name
a weak alias.
* stdlib/stdlib.h: Add prototype for __on_exit.
* sysdeps/unix/sysv/linux/schedbits.h: Add prototype for __clone.
* time/Makefile: Undo change from Sun Dec 8 06:56:49 1996.
The new malloc now has mcheck.
* time/ap.c: Likewise.
* time/tzset.c (__tzset): Rename to __tzset_internal.
(tzset): Rename to __tzset. Make tzset a weak alias for __tzset.
* time/localtime.c: Use __tzset_internal not __tzset.
* time/strftime.c [_LIBC]: Define tzname as __tzname and tzset
as __tzset to prevent namespace pollution.
* wctype/iswctype.h (icwctype): Rename to __iswctype. Make iswctype
a weak alias of __iswctype.
* wctype/wctype.h: Add prototype for __iswctype.
(iswalnum, iswalpha, iswcntrl, iswdigit, iswlower, iswgraph,
iswprint, iswpunct, iswspace, iswupper, iswxdigit, iswblank):
Use __iswctype for the test, not iswctype.
1996-12-16 Paul Eggert <eggert@twinsun.com>
* hurd/hurd/sigpreempt.h
(struct hurd_signal_preemptor.preemptor, _hurdsig_preemptors),
hurd/hurd/signal.h (struct hurd_sigstate.preemptors),
hurd/hurdfault.c, hurd/hurdfault.h (_hurdsig_fault_preemptor),
hurd/hurdsig.c (_hurdsig_preempters):
Renamed to fix spelling from `preempter' to `preemptor'.
All uses changed.
1996-12-15 Paul Eggert <eggert@twinsun.com>
* ctime.c (ctime): Return asctime (localtime (t)), as the C
standard requires.
Tue Dec 17 02:05:48 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/libc-lock.h (__libc_lock_trylock): Invert return
value because Mach/cthreads uses the opposite convention from
Posix/glibc.
Mon Dec 16 22:41:01 1996 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/fcloseall.c: Correct test of already_called.
Reported by Thomas Bushnell, n/BSG.
Mon Dec 16 14:52:07 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* mach/lock-intern.h (__mutex_try_lock): New function.
Sun Dec 15 16:33:44 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* termios/sys/ttydefaults.h (TTYDEF_OFLAG): Only use OXTABS if
defined, else XTABS.
(CEOL, CSTATUS): Use _POSIX_VDISABLE if defined.
Sun Dec 15 11:56:19 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/m68k/mremap.S: New file.
* sysdeps/unix/sysv/linux/m68k/Dist: Distribute it.
* sysdeps/unix/sysv/linux/m68k/Makefile (sysdep_routines): Add mremap.
1996-12-18 03:23:47 +00:00
|
|
|
|
_hurdsig_fault_preemptor.first = (long int) p;
|
|
|
|
|
_hurdsig_fault_preemptor.last = VM_MAX_ADDRESS;
|
1996-01-04 10:00:22 +00:00
|
|
|
|
if (! strncmp (p, variable, len) && p[len] == '=')
|
|
|
|
|
{
|
|
|
|
|
size_t valuelen;
|
|
|
|
|
p += len + 1;
|
|
|
|
|
valuelen = strlen (p);
|
update from main archive 961217
Wed Dec 18 03:31:58 1996 Ulrich Drepper <drepper@cygnus.com>
* dirent/scandir.c: Undo change from Mon Dec 2 15:32:15 1996.
The stream is private and usages outside glibc don't care about
reentrancy.
* io/fts.c: Likewise.
* io/ftw.c: Likewise.
* sysdeps/posix/getcwd.c: Likewise.
* sysdeps/posix/ttyname.c: Likewise.
* sysdeps/posix/ttyname_r.c: Likewise.
* sysdeps/posix/glob.c: Likewise.
* libio/iovsprintf.c: Add cast to prevent warning.
* libio/iovsscanf.c: Likewise.
* libio/libioP.h: Define mmap to __mmap and munmap to __munmap
to keep namespace clean.
* new-malloc/malloc.c: Update to last version from Wolfram Gloger.
Add hooks and check functions from old GNU malloc.
* new-malloc/malloc.h: Likewise.
* nis/ypclnt.c: Remove prototype for xdr_free.
* snrpc/rpc/xdr.h: Add prototype for xdr_free.
* manual/nss.texi: Correct description of default values and don't
meantion NSS as an add-on.
* nss/grp-lookup.c: Provide default value as
"compat [NOTFOUND=return] files".
* nss/pwd-lookup.c: Likewise.
* nss/spwd-lookup.c: Likewise.
* nss/network-lookup.c: Correct default to
"dns [!UNAVAIL=return] files".
* nss/nsswitch.c: Change default-default value to "nis
[NOTFOUND=return] files" since compat is only available for group,
passwd, and shadow.
* stdlib/on_exit.c (on_exit): Rename to __on_exit and make old name
a weak alias.
* stdlib/stdlib.h: Add prototype for __on_exit.
* sysdeps/unix/sysv/linux/schedbits.h: Add prototype for __clone.
* time/Makefile: Undo change from Sun Dec 8 06:56:49 1996.
The new malloc now has mcheck.
* time/ap.c: Likewise.
* time/tzset.c (__tzset): Rename to __tzset_internal.
(tzset): Rename to __tzset. Make tzset a weak alias for __tzset.
* time/localtime.c: Use __tzset_internal not __tzset.
* time/strftime.c [_LIBC]: Define tzname as __tzname and tzset
as __tzset to prevent namespace pollution.
* wctype/iswctype.h (icwctype): Rename to __iswctype. Make iswctype
a weak alias of __iswctype.
* wctype/wctype.h: Add prototype for __iswctype.
(iswalnum, iswalpha, iswcntrl, iswdigit, iswlower, iswgraph,
iswprint, iswpunct, iswspace, iswupper, iswxdigit, iswblank):
Use __iswctype for the test, not iswctype.
1996-12-16 Paul Eggert <eggert@twinsun.com>
* hurd/hurd/sigpreempt.h
(struct hurd_signal_preemptor.preemptor, _hurdsig_preemptors),
hurd/hurd/signal.h (struct hurd_sigstate.preemptors),
hurd/hurdfault.c, hurd/hurdfault.h (_hurdsig_fault_preemptor),
hurd/hurdsig.c (_hurdsig_preempters):
Renamed to fix spelling from `preempter' to `preemptor'.
All uses changed.
1996-12-15 Paul Eggert <eggert@twinsun.com>
* ctime.c (ctime): Return asctime (localtime (t)), as the C
standard requires.
Tue Dec 17 02:05:48 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/libc-lock.h (__libc_lock_trylock): Invert return
value because Mach/cthreads uses the opposite convention from
Posix/glibc.
Mon Dec 16 22:41:01 1996 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/fcloseall.c: Correct test of already_called.
Reported by Thomas Bushnell, n/BSG.
Mon Dec 16 14:52:07 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* mach/lock-intern.h (__mutex_try_lock): New function.
Sun Dec 15 16:33:44 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* termios/sys/ttydefaults.h (TTYDEF_OFLAG): Only use OXTABS if
defined, else XTABS.
(CEOL, CSTATUS): Use _POSIX_VDISABLE if defined.
Sun Dec 15 11:56:19 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/m68k/mremap.S: New file.
* sysdeps/unix/sysv/linux/m68k/Dist: Distribute it.
* sysdeps/unix/sysv/linux/m68k/Makefile (sysdep_routines): Add mremap.
1996-12-18 03:23:47 +00:00
|
|
|
|
_hurdsig_fault_preemptor.last = (long int) (p + valuelen);
|
1996-01-04 10:00:22 +00:00
|
|
|
|
value = malloc (++valuelen);
|
|
|
|
|
if (value)
|
|
|
|
|
memcpy (value, p, valuelen);
|
|
|
|
|
break;
|
|
|
|
|
}
|
update from main archive 961217
Wed Dec 18 03:31:58 1996 Ulrich Drepper <drepper@cygnus.com>
* dirent/scandir.c: Undo change from Mon Dec 2 15:32:15 1996.
The stream is private and usages outside glibc don't care about
reentrancy.
* io/fts.c: Likewise.
* io/ftw.c: Likewise.
* sysdeps/posix/getcwd.c: Likewise.
* sysdeps/posix/ttyname.c: Likewise.
* sysdeps/posix/ttyname_r.c: Likewise.
* sysdeps/posix/glob.c: Likewise.
* libio/iovsprintf.c: Add cast to prevent warning.
* libio/iovsscanf.c: Likewise.
* libio/libioP.h: Define mmap to __mmap and munmap to __munmap
to keep namespace clean.
* new-malloc/malloc.c: Update to last version from Wolfram Gloger.
Add hooks and check functions from old GNU malloc.
* new-malloc/malloc.h: Likewise.
* nis/ypclnt.c: Remove prototype for xdr_free.
* snrpc/rpc/xdr.h: Add prototype for xdr_free.
* manual/nss.texi: Correct description of default values and don't
meantion NSS as an add-on.
* nss/grp-lookup.c: Provide default value as
"compat [NOTFOUND=return] files".
* nss/pwd-lookup.c: Likewise.
* nss/spwd-lookup.c: Likewise.
* nss/network-lookup.c: Correct default to
"dns [!UNAVAIL=return] files".
* nss/nsswitch.c: Change default-default value to "nis
[NOTFOUND=return] files" since compat is only available for group,
passwd, and shadow.
* stdlib/on_exit.c (on_exit): Rename to __on_exit and make old name
a weak alias.
* stdlib/stdlib.h: Add prototype for __on_exit.
* sysdeps/unix/sysv/linux/schedbits.h: Add prototype for __clone.
* time/Makefile: Undo change from Sun Dec 8 06:56:49 1996.
The new malloc now has mcheck.
* time/ap.c: Likewise.
* time/tzset.c (__tzset): Rename to __tzset_internal.
(tzset): Rename to __tzset. Make tzset a weak alias for __tzset.
* time/localtime.c: Use __tzset_internal not __tzset.
* time/strftime.c [_LIBC]: Define tzname as __tzname and tzset
as __tzset to prevent namespace pollution.
* wctype/iswctype.h (icwctype): Rename to __iswctype. Make iswctype
a weak alias of __iswctype.
* wctype/wctype.h: Add prototype for __iswctype.
(iswalnum, iswalpha, iswcntrl, iswdigit, iswlower, iswgraph,
iswprint, iswpunct, iswspace, iswupper, iswxdigit, iswblank):
Use __iswctype for the test, not iswctype.
1996-12-16 Paul Eggert <eggert@twinsun.com>
* hurd/hurd/sigpreempt.h
(struct hurd_signal_preemptor.preemptor, _hurdsig_preemptors),
hurd/hurd/signal.h (struct hurd_sigstate.preemptors),
hurd/hurdfault.c, hurd/hurdfault.h (_hurdsig_fault_preemptor),
hurd/hurdsig.c (_hurdsig_preempters):
Renamed to fix spelling from `preempter' to `preemptor'.
All uses changed.
1996-12-15 Paul Eggert <eggert@twinsun.com>
* ctime.c (ctime): Return asctime (localtime (t)), as the C
standard requires.
Tue Dec 17 02:05:48 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/libc-lock.h (__libc_lock_trylock): Invert return
value because Mach/cthreads uses the opposite convention from
Posix/glibc.
Mon Dec 16 22:41:01 1996 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/fcloseall.c: Correct test of already_called.
Reported by Thomas Bushnell, n/BSG.
Mon Dec 16 14:52:07 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* mach/lock-intern.h (__mutex_try_lock): New function.
Sun Dec 15 16:33:44 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* termios/sys/ttydefaults.h (TTYDEF_OFLAG): Only use OXTABS if
defined, else XTABS.
(CEOL, CSTATUS): Use _POSIX_VDISABLE if defined.
Sun Dec 15 11:56:19 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/m68k/mremap.S: New file.
* sysdeps/unix/sysv/linux/m68k/Dist: Distribute it.
* sysdeps/unix/sysv/linux/m68k/Makefile (sysdep_routines): Add mremap.
1996-12-18 03:23:47 +00:00
|
|
|
|
_hurdsig_fault_preemptor.first = (long int) ++ep;
|
|
|
|
|
_hurdsig_fault_preemptor.last = (long int) (ep + 1);
|
1996-01-04 10:00:22 +00:00
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
_hurdsig_end_catch_fault ();
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
}
|