1995-05-11 01:02:23 +00:00
|
|
|
|
/* Operating system support for run-time dynamic linker. Hurd version.
|
1998-03-31 22:04:32 +00:00
|
|
|
|
Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
1996-12-20 01:39:50 +00:00
|
|
|
|
This file is part of the GNU C Library.
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
1996-12-20 01:39:50 +00:00
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU Library General Public License as
|
|
|
|
|
published by the Free Software Foundation; either version 2 of the
|
|
|
|
|
License, or (at your option) any later version.
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
1996-12-20 01:39:50 +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
|
|
|
|
|
Library General Public License for more details.
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
1996-12-20 01:39:50 +00:00
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
|
|
|
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
|
|
|
|
#include <hurd.h>
|
|
|
|
|
#include <link.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <sys/mman.h>
|
1998-03-31 22:04:32 +00:00
|
|
|
|
#include <elf/ldsodefs.h>
|
1995-05-11 01:02:23 +00:00
|
|
|
|
#include <sys/wait.h>
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
#include <sysdep.h>
|
|
|
|
|
#include <mach/mig_support.h>
|
|
|
|
|
#include "hurdstartup.h"
|
|
|
|
|
#include <mach/host_info.h>
|
1997-07-26 02:33:30 +00:00
|
|
|
|
#include <stdio-common/_itoa.h>
|
1995-05-11 01:02:23 +00:00
|
|
|
|
#include <hurd/auth.h>
|
|
|
|
|
#include <hurd/term.h>
|
|
|
|
|
#include <stdarg.h>
|
1996-05-04 13:57:05 +00:00
|
|
|
|
#include <ctype.h>
|
1996-07-30 19:23:06 +00:00
|
|
|
|
#include <sys/stat.h>
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
|
|
|
|
#include "dl-machine.h"
|
|
|
|
|
|
1995-05-31 13:23:14 +00:00
|
|
|
|
extern void __mach_init (void);
|
|
|
|
|
|
1995-05-11 01:02:23 +00:00
|
|
|
|
extern int _dl_argc;
|
|
|
|
|
extern char **_dl_argv;
|
|
|
|
|
extern char **_environ;
|
|
|
|
|
|
Update.
1997-12-03 23:50 Ulrich Drepper <drepper@cygnus.com>
* Makeconfig: Add shared-thread-library variable.
* math/Makfile (CPPFLAGS): Add -D__LIBC_INTERNAL_MATH_INLINES.
* sysdeps/i386/Makefile: Don't define ___LIBC_INTERNAL_MATH_INLINES
here.
* sysdeps/m68k/fpu/e_acos.c: Likewise.
* sysdeps/m68k/fpu/e_atan2.c: Likewise.
* sysdeps/m68k/fpu/e_fmod.c: Likewise.
* sysdeps/m68k/fpu/e_pow.c: Likewise.
* sysdeps/m68k/fpu/e_scalb.c: Likewise.
* sysdeps/m68k/fpu/k_cos.c: Likewise.
* sysdeps/m68k/fpu/k_sin.c: Likewise.
* sysdeps/m68k/fpu/k_tan.c: Likewise.
* sysdeps/m68k/fpu/s_atan.c: Likewise.
* sysdeps/m68k/fpu/s_ccos.c: Likewise.
* sysdeps/m68k/fpu/s_ccosh.c: Likewise.
* sysdeps/m68k/fpu/s_cexp.c: Likewise.
* sysdeps/m68k/fpu/s_csin.c: Likewise.
* sysdeps/m68k/fpu/s_csinh.c: Likewise.
* sysdeps/m68k/fpu/s_frexp.c: Likewise.
* sysdeps/m68k/fpu/s_ilogb.c: Likewise.
* sysdeps/m68k/fpu/s_isinf.c: Likewise.
* sysdeps/m68k/fpu/s_llrint.c: Likewise.
* sysdeps/m68k/fpu/s_llrintf.c: Likewise.
* sysdeps/m68k/fpu/s_llrintl.c: Likewise.
* sysdeps/m68k/fpu/s_lrint.c: Likewise.
* sysdeps/m68k/fpu/s_modf.c: Likewise.
* sysdeps/m68k/fpu/s_remquo.c: Likewise.
* sysdeps/m68k/fpu/s_scalbn.c: Likewise.
* sysdeps/m68k/fpu/s_sincos.c: Likewise.
* libc.map: Add __libc_current_sigrtmin, __libc_current_sigrtmax,
__libc_allocate_rtsig, sigqueue, sigtimedwait, sigwaitinfo.
* signal/Makefile (headers): Add bits/siginfo.h.
(routines): Add allocrtsig, sigtimedwait, sigwaitinfo, sigqueue.
(distribute): Add testrtsig.h.
* signal/allocrtsig.c: New file.
* signal/signal.h: Define `union sigval'. Include <bits/siginfo.h>.
Declare sigwaitinfo, sigtimedwait, sigqueue, __libc_current_sigrtmin,
__libc_current_sigrtmax.
* sysdeps/generic/sigqueue.c: New file.
* sysdeps/generic/sigtimedwait.c: New file.
* sysdeps/generic/sigwaitinfo.c: New file.
* sysdeps/generic/testrtsig.h: New file.
* sysdeps/generic/bits/siginfo.h: New file.
* sysdeps/unix/sysv/linux/bits/siginfo.h: New file.
* sysdeps/unix/sysv/linux/kernel_sigaction.h: Define struct as
old_kernel_sigaction and rename sa_handler member to k_sa_handler.
* sysdeps/unix/sysv/linux/rt_sigaction.c: New file.
* sysdeps/unix/sysv/linux/rt_sigprocmask.c: New file.
* sysdeps/unix/sysv/linux/rt_sigqueueinfo.c: New file.
* sysdeps/unix/sysv/linux/rt_sigreturn.c: New file.
* sysdeps/unix/sysv/linux/rt_sigsuspend.c: New file.
* sysdeps/unix/sysv/linux/rt_sigtimedwait.c: New file.
* sysdeps/unix/sysv/linux/sigpending.c: New file.
* sysdeps/unix/sysv/linux/sigprocmask.c: New file.
* sysdeps/unix/sysv/linux/sigqueue.c: New file.
* sysdeps/unix/sysv/linux/sigreturn.c: New file.
* sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
* sysdeps/unix/sysv/linux/testrtsig.h: New file.
* sysdeps/unix/sysv/linux/sigsuspend.c: Update for AIO.
* sysdeps/unix/sysv/linux/syscalls.list: Update for AIO.
* sysdeps/unix/sysv/linux/sigaction.c: Update for AIO.
* sysdeps/unix/sysv/linux/bits/local_lim.h: Define AIO_PRIO_DELTA_MAX.
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _XOPEN_REALTIME
and _POSIX_REALTIME_SIGNALS.
* sysdeps/unix/sysv/linux/bits/sigaction.h: Update for AIO.
* sysdeps/unix/sysv/linux/bits/signum.h: Define SIGRTMIN/MAX and
update _NSIG.
* sysdeps/unix/sysv/linux/i386/sigaction.c: Update for AIO.
* sysdeps/unix/sysv/linux/i386/sys/ucontext.h: Linux/i386 specific
definitions.
* Makefile (subdirs): Add rt.
* shlib-versions: Add entry for librt.
* rt/Makefile: New file.
* rt/aio.h: New file.
* rt/aio_cancel.c: New file.
* rt/aio_error.c: New file.
* rt/aio_fsync.c: New file.
* rt/aio_misc.c: New file.
* rt/aio_misc.h: New file.
* rt/aio_read.c: New file.
* rt/aio_read64.c: New file.
* rt/aio_return.c: New file.
* rt/aio_suspend.c: New file.
* rt/aio_write.c: New file.
* rt/aio_write64.c: New file.
* rt/lio_listio.c: New file.
* rt/lio_listio64.c: New file.
* sysdeps/generic/aio_sigqueue.c: New file.
* sysdeps/unix/sysv/linux/aio_sigqueue.c: New file.
* sysdeps/unix/sysv/linux/Dist: Add new files
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=signal]
(sysdep_routines): Add rt_sigsuspend, rt_sigprocmask, rt_sigtimedwait,
rt_sigqueueinfo, rt_sigaction.
* posix/Makefile (headers): Add bits/environments.h.
* posix/confstr.c: Correctly handle _CS_XBS5_ILP32_OFFBIG_CFLAGS
and _CS_LFS_CFLAGS on 64bit platforms.
* posix/unistd.h: Define _XOPEN_LEGACY. Explain _XOPEN_REALTIME
and _XOPEN_REALTIME_THREADS. Include bits/environments.h.
* sysdeps/generic/bits/confname.h: Define _SC_* constants for
compilation modules.
* sysdeps/wordsize-32/bits/environments.h: New file.
* sysdeps/wordsize-64/bits/environments.h: New file.
* posix/getopt.c: Remove declaration of getpid and __libc_pid.
* posix/getopt_init.c: Test for value 0xf00baa of uninitialized
__libc_pid.
* sysdeps/unix/sysv/linux/init-first.c: Initialize __libc_pid to
0xf00baa.
* string/string.h: Add declaration of __strverscmp.
* string/strverscmp.c: Rename function ot __strverscmp and make old
name weak alias.
* sysdeps/generic/dl-sysdep.c: Declare and define __libc_uid.
* sysdeps/generic/enbl-secure.c: Likewise.
* sysdeps/mach/hurd/dl-sysdep.c: Likewise.
* sysdeps/unix/sysv/linux/bits/sigset.h: Pretty print.
* sysdeps/unix/sysv/linux/sys/pci.h: New file.
1997-12-03 Ulrich Drepper <drepper@cygnus.com>
* posix/sys/wait.h: Use __transparent_union__ instead of
transparent_union. Reported by Roland McGrath.
1997-12-03 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* resolv/inet_neta.c (inet_neta): Change type of first parameter
to u_int32_t. Suggested by John Lavagnino <John_Lavagnino@Brown.edu>
[PR libc/366].
* resolv/inet_addr.c (inet_addr): Change return type to u_int32_t.
* inet/arpa/inet.h: Change types of inet_neta and inet_addr.
1997-12-03 20:40 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
* grp/initgroups.c: Increase buffer if it is too small.
1997-12-03 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/netinet/ip.h: Don't use u_int8_t for bit
fields, this is no ISO C. Reported by Andreas Jaeger.
1997-12-03 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/i386/sys/ucontext.h (enum): Add missing commata.
1997-12-03 08:58 Philip Blundell <pb@nexus.co.uk>
* sysdeps/generic/bits/utsname.h: <sys/utsname.h> defines
_SYS_UTSNAME_H not _UTSNAME_H.
1997-11-28 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* elf/dl-profile.c (_dl_start_profile): Avoid overflow when
computing s_scale.
1997-11-29 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/libm-ieee754/s_csqrt.c: Use different formula for now.
* sysdeps/libm-ieee754/s_csqrtf.c: Likewise.
* sysdeps/libm-ieee754/s_csqrtl.c: Likewise.
* math/libm-test.c (csqrt_test): Add testcase.
1997-12-03 15:44 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/sys/ultrasound.h: New file.
* sysdeps/unix/sysv/linux/sys/Dist: Add it.
* sysdeps/unix/sysv/linux/sys/Makefile [$(subdir)=misc]: Likewise.
1997-11-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/sys/timex.h: Fix declaration.
1997-12-01 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* math/libm-test.c (acos_test): Add more tests.
(asin_test): Likewise.
(atan_test): Likewise.
(exp_test): Likewise.
(sin_test): Likewise.
(sqrt_test): Likewise.
(cpow_test): Likewise.
(csqrt_test): Likewise.
(cexp_test): Correct typo in gcc version test.
1997-12-02 17:14 Philip Blundell <pb@nexus.co.uk>
* sysdeps/arm/__longjmp.S: Define _SETJMP_H before including
<bits/setjmp.h>.
* sysdeps/arm/setjmp.S: Likewise.
* sysdeps/unix/sysv/linux/arm/bits/mman.h: New file.
1997-12-02 18:07 Philip Blundell <pb@nexus.co.uk>
* stdio/stdio.h: Add prototype for tmpfile64().
1997-12-02 17:47 Philip Blundell <pb@nexus.co.uk>
* stdio/stdio.h (__stdio_gen_tempname): Add extra argument to
prototype to keep in step with libio version.
* stdio-common/tmpfile64.c: Include <errno.h> for ENOSYS.
1997-12-02 17:41 Philip Blundell <pb@nexus.co.uk>
* sysdeps/generic/Makefile: Don't try to use make_siglist if
cross-compiling.
1997-12-02 01:18 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/i386/clone.S: When cloned process returns
load GOT ptr before jumping to _exit.
Reported by Xavier Leroy.
1997-12-04 00:12:34 +00:00
|
|
|
|
uid_t __libc_uid;
|
1996-07-29 03:49:00 +00:00
|
|
|
|
int __libc_enable_secure;
|
|
|
|
|
|
1995-05-11 01:02:23 +00:00
|
|
|
|
struct hurd_startup_data *_dl_hurd_data;
|
|
|
|
|
|
1995-06-08 09:00:23 +00:00
|
|
|
|
unsigned int __hurd_threadvar_max = _HURD_THREADVAR_MAX;
|
|
|
|
|
static unsigned long int threadvars[_HURD_THREADVAR_MAX];
|
|
|
|
|
unsigned long int __hurd_threadvar_stack_offset
|
|
|
|
|
= (unsigned long int) &threadvars;
|
1996-02-08 02:10:15 +00:00
|
|
|
|
unsigned long int __hurd_threadvar_stack_mask;
|
1995-06-08 09:00:23 +00:00
|
|
|
|
|
|
|
|
|
/* XXX loser kludge for vm_map kernel bug */
|
|
|
|
|
static vm_address_t fmha;
|
|
|
|
|
static vm_size_t fmhs;
|
1996-02-08 02:10:15 +00:00
|
|
|
|
static void unfmh(void){
|
1995-06-08 09:00:23 +00:00
|
|
|
|
__vm_deallocate(__mach_task_self(),fmha,fmhs);}
|
1996-02-08 02:10:15 +00:00
|
|
|
|
static void fmh(void) {
|
1995-06-08 09:00:23 +00:00
|
|
|
|
error_t err;int x;mach_port_t p;
|
|
|
|
|
vm_address_t a=0x08000000U,max=VM_MAX_ADDRESS;
|
|
|
|
|
while (!(err=__vm_region(__mach_task_self(),&a,&fmhs,&x,&x,&x,&x,&p,&x))){
|
|
|
|
|
__mach_port_deallocate(__mach_task_self(),p);
|
|
|
|
|
if (a+fmhs>=0x80000000U){
|
1995-07-10 09:40:15 +00:00
|
|
|
|
max=a; break;}
|
1995-06-08 09:00:23 +00:00
|
|
|
|
fmha=a+=fmhs;}
|
|
|
|
|
if (err) assert(err==KERN_NO_SPACE);
|
1995-07-10 09:40:15 +00:00
|
|
|
|
if (!fmha)fmhs=0;else{
|
1995-06-08 09:00:23 +00:00
|
|
|
|
fmhs=max-fmha;
|
|
|
|
|
err = __vm_map (__mach_task_self (),
|
|
|
|
|
&fmha, fmhs, 0, 0, MACH_PORT_NULL, 0, 1,
|
|
|
|
|
VM_PROT_NONE, VM_PROT_NONE, VM_INHERIT_COPY);
|
1995-07-10 09:40:15 +00:00
|
|
|
|
assert_perror(err);}
|
1995-06-08 09:00:23 +00:00
|
|
|
|
}
|
|
|
|
|
/* XXX loser kludge for vm_map kernel bug */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1995-05-11 01:02:23 +00:00
|
|
|
|
Elf32_Addr
|
|
|
|
|
_dl_sysdep_start (void **start_argptr,
|
|
|
|
|
void (*dl_main) (const Elf32_Phdr *phdr, Elf32_Word phent,
|
|
|
|
|
Elf32_Addr *user_entry))
|
|
|
|
|
{
|
1995-09-30 21:18:30 +00:00
|
|
|
|
extern void _start ();
|
|
|
|
|
|
1995-05-11 01:02:23 +00:00
|
|
|
|
void go (int *argdata)
|
|
|
|
|
{
|
1995-09-30 21:18:30 +00:00
|
|
|
|
extern unsigned int _dl_skip_args; /* rtld.c */
|
1995-05-11 01:02:23 +00:00
|
|
|
|
char **p;
|
|
|
|
|
|
|
|
|
|
/* Cache the information in various global variables. */
|
1995-05-31 13:23:14 +00:00
|
|
|
|
_dl_argc = *argdata;
|
1995-09-30 21:18:30 +00:00
|
|
|
|
_dl_argv = 1 + (char **) argdata;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
_environ = &_dl_argv[_dl_argc + 1];
|
1995-09-30 21:18:30 +00:00
|
|
|
|
for (p = _environ; *p++;); /* Skip environ pointers and terminator. */
|
|
|
|
|
|
|
|
|
|
if ((void *) p == _dl_argv[0])
|
|
|
|
|
{
|
|
|
|
|
static struct hurd_startup_data nodata;
|
|
|
|
|
_dl_hurd_data = &nodata;
|
|
|
|
|
nodata.user_entry = (vm_address_t) &_start;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
_dl_hurd_data = (void *) p;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
Update.
1997-12-03 23:50 Ulrich Drepper <drepper@cygnus.com>
* Makeconfig: Add shared-thread-library variable.
* math/Makfile (CPPFLAGS): Add -D__LIBC_INTERNAL_MATH_INLINES.
* sysdeps/i386/Makefile: Don't define ___LIBC_INTERNAL_MATH_INLINES
here.
* sysdeps/m68k/fpu/e_acos.c: Likewise.
* sysdeps/m68k/fpu/e_atan2.c: Likewise.
* sysdeps/m68k/fpu/e_fmod.c: Likewise.
* sysdeps/m68k/fpu/e_pow.c: Likewise.
* sysdeps/m68k/fpu/e_scalb.c: Likewise.
* sysdeps/m68k/fpu/k_cos.c: Likewise.
* sysdeps/m68k/fpu/k_sin.c: Likewise.
* sysdeps/m68k/fpu/k_tan.c: Likewise.
* sysdeps/m68k/fpu/s_atan.c: Likewise.
* sysdeps/m68k/fpu/s_ccos.c: Likewise.
* sysdeps/m68k/fpu/s_ccosh.c: Likewise.
* sysdeps/m68k/fpu/s_cexp.c: Likewise.
* sysdeps/m68k/fpu/s_csin.c: Likewise.
* sysdeps/m68k/fpu/s_csinh.c: Likewise.
* sysdeps/m68k/fpu/s_frexp.c: Likewise.
* sysdeps/m68k/fpu/s_ilogb.c: Likewise.
* sysdeps/m68k/fpu/s_isinf.c: Likewise.
* sysdeps/m68k/fpu/s_llrint.c: Likewise.
* sysdeps/m68k/fpu/s_llrintf.c: Likewise.
* sysdeps/m68k/fpu/s_llrintl.c: Likewise.
* sysdeps/m68k/fpu/s_lrint.c: Likewise.
* sysdeps/m68k/fpu/s_modf.c: Likewise.
* sysdeps/m68k/fpu/s_remquo.c: Likewise.
* sysdeps/m68k/fpu/s_scalbn.c: Likewise.
* sysdeps/m68k/fpu/s_sincos.c: Likewise.
* libc.map: Add __libc_current_sigrtmin, __libc_current_sigrtmax,
__libc_allocate_rtsig, sigqueue, sigtimedwait, sigwaitinfo.
* signal/Makefile (headers): Add bits/siginfo.h.
(routines): Add allocrtsig, sigtimedwait, sigwaitinfo, sigqueue.
(distribute): Add testrtsig.h.
* signal/allocrtsig.c: New file.
* signal/signal.h: Define `union sigval'. Include <bits/siginfo.h>.
Declare sigwaitinfo, sigtimedwait, sigqueue, __libc_current_sigrtmin,
__libc_current_sigrtmax.
* sysdeps/generic/sigqueue.c: New file.
* sysdeps/generic/sigtimedwait.c: New file.
* sysdeps/generic/sigwaitinfo.c: New file.
* sysdeps/generic/testrtsig.h: New file.
* sysdeps/generic/bits/siginfo.h: New file.
* sysdeps/unix/sysv/linux/bits/siginfo.h: New file.
* sysdeps/unix/sysv/linux/kernel_sigaction.h: Define struct as
old_kernel_sigaction and rename sa_handler member to k_sa_handler.
* sysdeps/unix/sysv/linux/rt_sigaction.c: New file.
* sysdeps/unix/sysv/linux/rt_sigprocmask.c: New file.
* sysdeps/unix/sysv/linux/rt_sigqueueinfo.c: New file.
* sysdeps/unix/sysv/linux/rt_sigreturn.c: New file.
* sysdeps/unix/sysv/linux/rt_sigsuspend.c: New file.
* sysdeps/unix/sysv/linux/rt_sigtimedwait.c: New file.
* sysdeps/unix/sysv/linux/sigpending.c: New file.
* sysdeps/unix/sysv/linux/sigprocmask.c: New file.
* sysdeps/unix/sysv/linux/sigqueue.c: New file.
* sysdeps/unix/sysv/linux/sigreturn.c: New file.
* sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
* sysdeps/unix/sysv/linux/testrtsig.h: New file.
* sysdeps/unix/sysv/linux/sigsuspend.c: Update for AIO.
* sysdeps/unix/sysv/linux/syscalls.list: Update for AIO.
* sysdeps/unix/sysv/linux/sigaction.c: Update for AIO.
* sysdeps/unix/sysv/linux/bits/local_lim.h: Define AIO_PRIO_DELTA_MAX.
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _XOPEN_REALTIME
and _POSIX_REALTIME_SIGNALS.
* sysdeps/unix/sysv/linux/bits/sigaction.h: Update for AIO.
* sysdeps/unix/sysv/linux/bits/signum.h: Define SIGRTMIN/MAX and
update _NSIG.
* sysdeps/unix/sysv/linux/i386/sigaction.c: Update for AIO.
* sysdeps/unix/sysv/linux/i386/sys/ucontext.h: Linux/i386 specific
definitions.
* Makefile (subdirs): Add rt.
* shlib-versions: Add entry for librt.
* rt/Makefile: New file.
* rt/aio.h: New file.
* rt/aio_cancel.c: New file.
* rt/aio_error.c: New file.
* rt/aio_fsync.c: New file.
* rt/aio_misc.c: New file.
* rt/aio_misc.h: New file.
* rt/aio_read.c: New file.
* rt/aio_read64.c: New file.
* rt/aio_return.c: New file.
* rt/aio_suspend.c: New file.
* rt/aio_write.c: New file.
* rt/aio_write64.c: New file.
* rt/lio_listio.c: New file.
* rt/lio_listio64.c: New file.
* sysdeps/generic/aio_sigqueue.c: New file.
* sysdeps/unix/sysv/linux/aio_sigqueue.c: New file.
* sysdeps/unix/sysv/linux/Dist: Add new files
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=signal]
(sysdep_routines): Add rt_sigsuspend, rt_sigprocmask, rt_sigtimedwait,
rt_sigqueueinfo, rt_sigaction.
* posix/Makefile (headers): Add bits/environments.h.
* posix/confstr.c: Correctly handle _CS_XBS5_ILP32_OFFBIG_CFLAGS
and _CS_LFS_CFLAGS on 64bit platforms.
* posix/unistd.h: Define _XOPEN_LEGACY. Explain _XOPEN_REALTIME
and _XOPEN_REALTIME_THREADS. Include bits/environments.h.
* sysdeps/generic/bits/confname.h: Define _SC_* constants for
compilation modules.
* sysdeps/wordsize-32/bits/environments.h: New file.
* sysdeps/wordsize-64/bits/environments.h: New file.
* posix/getopt.c: Remove declaration of getpid and __libc_pid.
* posix/getopt_init.c: Test for value 0xf00baa of uninitialized
__libc_pid.
* sysdeps/unix/sysv/linux/init-first.c: Initialize __libc_pid to
0xf00baa.
* string/string.h: Add declaration of __strverscmp.
* string/strverscmp.c: Rename function ot __strverscmp and make old
name weak alias.
* sysdeps/generic/dl-sysdep.c: Declare and define __libc_uid.
* sysdeps/generic/enbl-secure.c: Likewise.
* sysdeps/mach/hurd/dl-sysdep.c: Likewise.
* sysdeps/unix/sysv/linux/bits/sigset.h: Pretty print.
* sysdeps/unix/sysv/linux/sys/pci.h: New file.
1997-12-03 Ulrich Drepper <drepper@cygnus.com>
* posix/sys/wait.h: Use __transparent_union__ instead of
transparent_union. Reported by Roland McGrath.
1997-12-03 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* resolv/inet_neta.c (inet_neta): Change type of first parameter
to u_int32_t. Suggested by John Lavagnino <John_Lavagnino@Brown.edu>
[PR libc/366].
* resolv/inet_addr.c (inet_addr): Change return type to u_int32_t.
* inet/arpa/inet.h: Change types of inet_neta and inet_addr.
1997-12-03 20:40 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
* grp/initgroups.c: Increase buffer if it is too small.
1997-12-03 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/netinet/ip.h: Don't use u_int8_t for bit
fields, this is no ISO C. Reported by Andreas Jaeger.
1997-12-03 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/i386/sys/ucontext.h (enum): Add missing commata.
1997-12-03 08:58 Philip Blundell <pb@nexus.co.uk>
* sysdeps/generic/bits/utsname.h: <sys/utsname.h> defines
_SYS_UTSNAME_H not _UTSNAME_H.
1997-11-28 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* elf/dl-profile.c (_dl_start_profile): Avoid overflow when
computing s_scale.
1997-11-29 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/libm-ieee754/s_csqrt.c: Use different formula for now.
* sysdeps/libm-ieee754/s_csqrtf.c: Likewise.
* sysdeps/libm-ieee754/s_csqrtl.c: Likewise.
* math/libm-test.c (csqrt_test): Add testcase.
1997-12-03 15:44 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/sys/ultrasound.h: New file.
* sysdeps/unix/sysv/linux/sys/Dist: Add it.
* sysdeps/unix/sysv/linux/sys/Makefile [$(subdir)=misc]: Likewise.
1997-11-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/sys/timex.h: Fix declaration.
1997-12-01 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* math/libm-test.c (acos_test): Add more tests.
(asin_test): Likewise.
(atan_test): Likewise.
(exp_test): Likewise.
(sin_test): Likewise.
(sqrt_test): Likewise.
(cpow_test): Likewise.
(csqrt_test): Likewise.
(cexp_test): Correct typo in gcc version test.
1997-12-02 17:14 Philip Blundell <pb@nexus.co.uk>
* sysdeps/arm/__longjmp.S: Define _SETJMP_H before including
<bits/setjmp.h>.
* sysdeps/arm/setjmp.S: Likewise.
* sysdeps/unix/sysv/linux/arm/bits/mman.h: New file.
1997-12-02 18:07 Philip Blundell <pb@nexus.co.uk>
* stdio/stdio.h: Add prototype for tmpfile64().
1997-12-02 17:47 Philip Blundell <pb@nexus.co.uk>
* stdio/stdio.h (__stdio_gen_tempname): Add extra argument to
prototype to keep in step with libio version.
* stdio-common/tmpfile64.c: Include <errno.h> for ENOSYS.
1997-12-02 17:41 Philip Blundell <pb@nexus.co.uk>
* sysdeps/generic/Makefile: Don't try to use make_siglist if
cross-compiling.
1997-12-02 01:18 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/i386/clone.S: When cloned process returns
load GOT ptr before jumping to _exit.
Reported by Xavier Leroy.
1997-12-04 00:12:34 +00:00
|
|
|
|
__libc_uid = __getuid ();
|
1996-07-29 00:18:42 +00:00
|
|
|
|
__libc_enable_secure = _dl_hurd_data->flags & EXEC_SECURE;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
1995-11-16 00:44:18 +00:00
|
|
|
|
if (_dl_hurd_data->flags & EXEC_STACK_ARGS &&
|
|
|
|
|
_dl_hurd_data->user_entry == 0)
|
|
|
|
|
_dl_hurd_data->user_entry = (vm_address_t) &_start;
|
|
|
|
|
|
1995-06-08 09:00:23 +00:00
|
|
|
|
unfmh(); /* XXX */
|
1995-09-30 21:18:30 +00:00
|
|
|
|
|
|
|
|
|
if (_dl_hurd_data->user_entry == (vm_address_t) &_start)
|
|
|
|
|
/* We were invoked as a command, not as the program interpreter.
|
|
|
|
|
The generic ld.so code supports this: it will parse the args
|
|
|
|
|
as "ld.so PROGRAM [ARGS...]". For booting the Hurd, we
|
|
|
|
|
support an additional special syntax:
|
|
|
|
|
ld.so [-LIBS...] PROGRAM [ARGS...]
|
|
|
|
|
Each LIBS word consists of "FILENAME=MEMOBJ";
|
|
|
|
|
for example "-/lib/libc.so=123" says that the contents of
|
|
|
|
|
/lib/libc.so are found in a memory object whose port name
|
|
|
|
|
in our task is 123. */
|
1995-10-05 09:00:06 +00:00
|
|
|
|
while (_dl_argc > 2 && _dl_argv[1][0] == '-' && _dl_argv[1][1] != '-')
|
1995-09-30 21:18:30 +00:00
|
|
|
|
{
|
|
|
|
|
char *lastslash, *memobjname, *p;
|
|
|
|
|
struct link_map *l;
|
|
|
|
|
mach_port_t memobj;
|
|
|
|
|
error_t err;
|
|
|
|
|
|
|
|
|
|
++_dl_skip_args;
|
|
|
|
|
--_dl_argc;
|
|
|
|
|
p = _dl_argv++[1] + 1;
|
|
|
|
|
|
|
|
|
|
memobjname = strchr (p, '=');
|
|
|
|
|
if (! memobjname)
|
|
|
|
|
_dl_sysdep_fatal ("Bogus library spec: ", p, "\n", NULL);
|
|
|
|
|
*memobjname++ = '\0';
|
1996-05-04 13:57:05 +00:00
|
|
|
|
memobj = 0;
|
|
|
|
|
while (*memobjname != '\0')
|
|
|
|
|
memobj = (memobj * 10) + (*memobjname++ - '0');
|
1995-11-16 00:44:18 +00:00
|
|
|
|
|
1995-09-30 21:18:30 +00:00
|
|
|
|
/* Add a user reference on the memory object port, so we will
|
|
|
|
|
still have one after _dl_map_object_from_fd calls our
|
|
|
|
|
`close'. */
|
|
|
|
|
err = __mach_port_mod_refs (__mach_task_self (), memobj,
|
|
|
|
|
MACH_PORT_RIGHT_SEND, +1);
|
|
|
|
|
assert_perror (err);
|
1995-11-16 00:44:18 +00:00
|
|
|
|
|
1995-09-30 21:18:30 +00:00
|
|
|
|
lastslash = strrchr (p, '/');
|
|
|
|
|
l = _dl_map_object_from_fd (lastslash ? lastslash + 1 : p,
|
|
|
|
|
memobj, strdup (p));
|
|
|
|
|
|
|
|
|
|
/* Squirrel away the memory object port where it
|
|
|
|
|
can be retrieved by the program later. */
|
|
|
|
|
l->l_info[DT_NULL] = (void *) memobj;
|
|
|
|
|
}
|
|
|
|
|
|
1995-05-11 01:02:23 +00:00
|
|
|
|
/* Call elf/rtld.c's main program. It will set everything
|
|
|
|
|
up and leave us to transfer control to USER_ENTRY. */
|
|
|
|
|
(*dl_main) ((const Elf32_Phdr *) _dl_hurd_data->phdr,
|
|
|
|
|
_dl_hurd_data->phdrsz / sizeof (Elf32_Phdr),
|
|
|
|
|
&_dl_hurd_data->user_entry);
|
|
|
|
|
|
1995-09-30 21:18:30 +00:00
|
|
|
|
if (_dl_skip_args && _dl_argv[-_dl_skip_args] == (char *) p)
|
|
|
|
|
{
|
|
|
|
|
/* We are ignoring the first few arguments, but we have no Hurd
|
|
|
|
|
startup data. It is magical convention that ARGV[0] == P in
|
|
|
|
|
this case. The startup code in init-first.c will get confused
|
|
|
|
|
if this is not the case, so we must rearrange things to make
|
|
|
|
|
it so. Overwrite the original ARGV[0] at P with
|
|
|
|
|
ARGV[_dl_skip_args]. */
|
|
|
|
|
assert ((char *) p < _dl_argv[0]);
|
|
|
|
|
_dl_argv[0] = strcpy ((char *) p, _dl_argv[0]);
|
|
|
|
|
}
|
|
|
|
|
|
1995-05-11 01:02:23 +00:00
|
|
|
|
{
|
|
|
|
|
extern void _dl_start_user (void);
|
|
|
|
|
/* Unwind the stack to ARGDATA and simulate a return from _dl_start
|
|
|
|
|
to the RTLD_START code which will run the user's entry point. */
|
|
|
|
|
RETURN_TO (argdata, &_dl_start_user, _dl_hurd_data->user_entry);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1995-05-31 13:23:14 +00:00
|
|
|
|
/* Set up so we can do RPCs. */
|
|
|
|
|
__mach_init ();
|
|
|
|
|
|
1997-07-26 02:33:30 +00:00
|
|
|
|
/* Initialize frequently used global variable. */
|
|
|
|
|
_dl_pagesize = __getpagesize ();
|
|
|
|
|
|
1995-06-08 09:00:23 +00:00
|
|
|
|
fmh(); /* XXX */
|
|
|
|
|
|
1995-05-11 01:02:23 +00:00
|
|
|
|
/* See hurd/hurdstartup.c; this deals with getting information
|
|
|
|
|
from the exec server and slicing up the arguments.
|
|
|
|
|
Then it will call `go', above. */
|
|
|
|
|
_hurd_startup (start_argptr, &go);
|
|
|
|
|
|
|
|
|
|
LOSE;
|
1995-08-14 22:49:23 +00:00
|
|
|
|
abort ();
|
1995-05-11 01:02:23 +00:00
|
|
|
|
}
|
1995-11-17 02:33:47 +00:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
_dl_sysdep_start_cleanup (void)
|
|
|
|
|
{
|
|
|
|
|
/* Deallocate the reply port and task port rights acquired by
|
|
|
|
|
__mach_init. We are done with them now, and the user will
|
|
|
|
|
reacquire them for himself when he wants them. */
|
|
|
|
|
__mig_dealloc_reply_port (MACH_PORT_NULL);
|
|
|
|
|
__mach_port_deallocate (__mach_task_self (), __mach_task_self_);
|
|
|
|
|
}
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
|
|
|
|
/* Minimal open/close/mmap implementation sufficient for initial loading of
|
|
|
|
|
shared libraries. These are weak definitions so that when the
|
|
|
|
|
dynamic linker re-relocates itself to be user-visible (for -ldl),
|
|
|
|
|
it will get the user's definition (i.e. usually libc's). */
|
|
|
|
|
|
1996-12-20 01:39:50 +00:00
|
|
|
|
/* Open FILE_NAME and return a read-mmappable port in MEMOBJ_RD for it, or
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return an error. If STAT is non-zero, stat the file into that stat buffer. */
|
|
|
|
|
static error_t
|
|
|
|
|
open_file (const char *file_name, int mode,
|
|
|
|
|
mach_port_t *memobj_rd, struct stat *stat)
|
1995-05-11 01:02:23 +00:00
|
|
|
|
{
|
|
|
|
|
enum retry_type doretry;
|
|
|
|
|
char retryname[1024]; /* XXX string_t LOSES! */
|
|
|
|
|
file_t startdir, newpt, fileport;
|
|
|
|
|
int dealloc_dir;
|
|
|
|
|
int nloops;
|
1995-10-09 07:06:29 +00:00
|
|
|
|
error_t err;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
|
|
|
|
assert (mode == O_RDONLY);
|
|
|
|
|
|
|
|
|
|
startdir = _dl_hurd_data->portarray[file_name[0] == '/' ?
|
|
|
|
|
INIT_PORT_CRDIR : INIT_PORT_CWDIR];
|
|
|
|
|
|
|
|
|
|
while (file_name[0] == '/')
|
|
|
|
|
file_name++;
|
|
|
|
|
|
1996-07-30 19:23:06 +00:00
|
|
|
|
if (err = __dir_lookup (startdir, (char *)file_name, mode, 0,
|
1995-10-09 07:06:29 +00:00
|
|
|
|
&doretry, retryname, &fileport))
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return err;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
|
|
|
|
dealloc_dir = 0;
|
|
|
|
|
nloops = 0;
|
1995-11-16 00:44:18 +00:00
|
|
|
|
|
1995-05-11 01:02:23 +00:00
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
if (dealloc_dir)
|
|
|
|
|
__mach_port_deallocate (__mach_task_self (), startdir);
|
1995-10-09 07:06:29 +00:00
|
|
|
|
if (err)
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return err;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
|
|
|
|
switch (doretry)
|
|
|
|
|
{
|
|
|
|
|
case FS_RETRY_REAUTH:
|
|
|
|
|
{
|
|
|
|
|
mach_port_t ref = __mach_reply_port ();
|
1995-10-09 07:06:29 +00:00
|
|
|
|
err = __io_reauthenticate (fileport, ref, MACH_MSG_TYPE_MAKE_SEND);
|
|
|
|
|
if (! err)
|
|
|
|
|
err = __auth_user_authenticate
|
1995-05-11 01:02:23 +00:00
|
|
|
|
(_dl_hurd_data->portarray[INIT_PORT_AUTH],
|
|
|
|
|
ref, MACH_MSG_TYPE_MAKE_SEND,
|
|
|
|
|
&newpt);
|
|
|
|
|
__mach_port_destroy (__mach_task_self (), ref);
|
|
|
|
|
}
|
|
|
|
|
__mach_port_deallocate (__mach_task_self (), fileport);
|
1995-10-09 07:06:29 +00:00
|
|
|
|
if (err)
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return err;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
fileport = newpt;
|
|
|
|
|
/* Fall through. */
|
|
|
|
|
|
|
|
|
|
case FS_RETRY_NORMAL:
|
|
|
|
|
#ifdef SYMLOOP_MAX
|
|
|
|
|
if (nloops++ >= SYMLOOP_MAX)
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return ELOOP;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* An empty RETRYNAME indicates we have the final port. */
|
|
|
|
|
if (retryname[0] == '\0')
|
|
|
|
|
{
|
1996-07-30 19:23:06 +00:00
|
|
|
|
mach_port_t memobj_wr;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
|
|
|
|
dealloc_dir = 1;
|
|
|
|
|
|
|
|
|
|
opened:
|
|
|
|
|
/* We have the file open. Now map it. */
|
1996-07-30 19:23:06 +00:00
|
|
|
|
|
|
|
|
|
if (stat)
|
|
|
|
|
err = __io_stat (fileport, stat);
|
|
|
|
|
if (! err)
|
|
|
|
|
err = __io_map (fileport, memobj_rd, &memobj_wr);
|
|
|
|
|
|
1995-05-11 01:02:23 +00:00
|
|
|
|
if (dealloc_dir)
|
|
|
|
|
__mach_port_deallocate (__mach_task_self (), fileport);
|
1995-10-09 07:06:29 +00:00
|
|
|
|
if (err)
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return err;
|
|
|
|
|
|
1995-05-11 01:02:23 +00:00
|
|
|
|
if (memobj_wr != MACH_PORT_NULL)
|
|
|
|
|
__mach_port_deallocate (__mach_task_self (), memobj_wr);
|
|
|
|
|
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return 0;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
startdir = fileport;
|
|
|
|
|
dealloc_dir = 1;
|
|
|
|
|
file_name = retryname;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FS_RETRY_MAGICAL:
|
|
|
|
|
switch (retryname[0])
|
|
|
|
|
{
|
|
|
|
|
case '/':
|
|
|
|
|
startdir = _dl_hurd_data->portarray[INIT_PORT_CRDIR];
|
|
|
|
|
dealloc_dir = 0;
|
|
|
|
|
if (fileport != MACH_PORT_NULL)
|
|
|
|
|
__mach_port_deallocate (__mach_task_self (), fileport);
|
|
|
|
|
file_name = &retryname[1];
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'f':
|
1996-05-04 13:57:05 +00:00
|
|
|
|
if (retryname[1] == 'd' && retryname[2] == '/' &&
|
|
|
|
|
isdigit (retryname[3]))
|
1995-05-11 01:02:23 +00:00
|
|
|
|
{
|
1996-05-04 13:57:05 +00:00
|
|
|
|
/* We can't use strtol for the decoding here
|
|
|
|
|
because it brings in hairy locale bloat. */
|
|
|
|
|
char *p;
|
|
|
|
|
int fd = 0;
|
|
|
|
|
for (p = &retryname[3]; isdigit (*p); ++p)
|
|
|
|
|
fd = (fd * 10) + (*p - '0');
|
|
|
|
|
/* Check for excess text after the number. A slash is
|
|
|
|
|
valid; it ends the component. Anything else does not
|
|
|
|
|
name a numeric file descriptor. */
|
|
|
|
|
if (*p != '/' && *p != '\0')
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return ENOENT;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
if (fd < 0 || fd >= _dl_hurd_data->dtablesize ||
|
|
|
|
|
_dl_hurd_data->dtable[fd] == MACH_PORT_NULL)
|
1995-10-09 07:06:29 +00:00
|
|
|
|
/* If the name was a proper number, but the file
|
|
|
|
|
descriptor does not exist, we return EBADF instead
|
|
|
|
|
of ENOENT. */
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return EBADF;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
fileport = _dl_hurd_data->dtable[fd];
|
1996-05-04 13:57:05 +00:00
|
|
|
|
if (*p == '\0')
|
1995-05-11 01:02:23 +00:00
|
|
|
|
{
|
|
|
|
|
/* This descriptor is the file port we want. */
|
|
|
|
|
dealloc_dir = 0;
|
|
|
|
|
goto opened;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Do a normal retry on the remaining components. */
|
|
|
|
|
startdir = fileport;
|
|
|
|
|
dealloc_dir = 1;
|
1996-05-04 13:57:05 +00:00
|
|
|
|
file_name = p + 1; /* Skip the slash. */
|
1995-05-11 01:02:23 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
goto bad_magic;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'm':
|
|
|
|
|
if (retryname[1] == 'a' && retryname[2] == 'c' &&
|
|
|
|
|
retryname[3] == 'h' && retryname[4] == 't' &&
|
|
|
|
|
retryname[5] == 'y' && retryname[6] == 'p' &&
|
|
|
|
|
retryname[7] == 'e')
|
|
|
|
|
{
|
|
|
|
|
error_t err;
|
|
|
|
|
struct host_basic_info hostinfo;
|
|
|
|
|
mach_msg_type_number_t hostinfocnt = HOST_BASIC_INFO_COUNT;
|
|
|
|
|
char *p;
|
|
|
|
|
if (err = __host_info (__mach_host_self (), HOST_BASIC_INFO,
|
|
|
|
|
(natural_t *) &hostinfo,
|
|
|
|
|
&hostinfocnt))
|
|
|
|
|
return err;
|
|
|
|
|
if (hostinfocnt != HOST_BASIC_INFO_COUNT)
|
|
|
|
|
return EGRATUITOUS;
|
|
|
|
|
p = _itoa (hostinfo.cpu_subtype, &retryname[8], 10, 0);
|
|
|
|
|
*--p = '/';
|
|
|
|
|
p = _itoa (hostinfo.cpu_type, &retryname[8], 10, 0);
|
|
|
|
|
if (p < retryname)
|
|
|
|
|
abort (); /* XXX write this right if this ever happens */
|
|
|
|
|
if (p > retryname)
|
|
|
|
|
strcpy (retryname, p);
|
|
|
|
|
startdir = fileport;
|
|
|
|
|
dealloc_dir = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
goto bad_magic;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 't':
|
|
|
|
|
if (retryname[1] == 't' && retryname[2] == 'y')
|
|
|
|
|
switch (retryname[3])
|
|
|
|
|
{
|
|
|
|
|
error_t opentty (file_t *result)
|
|
|
|
|
{
|
|
|
|
|
error_t err;
|
|
|
|
|
file_t unauth;
|
|
|
|
|
err = __termctty_open_terminal
|
|
|
|
|
(_dl_hurd_data->portarray[INIT_PORT_CTTYID],
|
|
|
|
|
mode, &unauth);
|
|
|
|
|
if (! err)
|
|
|
|
|
{
|
|
|
|
|
mach_port_t ref = __mach_reply_port ();
|
1995-08-14 22:49:23 +00:00
|
|
|
|
err = __io_reauthenticate
|
1995-05-11 01:02:23 +00:00
|
|
|
|
(unauth, ref, MACH_MSG_TYPE_MAKE_SEND);
|
|
|
|
|
if (! err)
|
|
|
|
|
err = __auth_user_authenticate
|
|
|
|
|
(_dl_hurd_data->portarray[INIT_PORT_AUTH],
|
|
|
|
|
ref, MACH_MSG_TYPE_MAKE_SEND,
|
|
|
|
|
result);
|
|
|
|
|
__mach_port_deallocate (__mach_task_self (),
|
|
|
|
|
unauth);
|
|
|
|
|
__mach_port_destroy (__mach_task_self (), ref);
|
|
|
|
|
}
|
|
|
|
|
return err;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case '\0':
|
1995-10-09 07:06:29 +00:00
|
|
|
|
if (err = opentty (&fileport))
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return err;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
dealloc_dir = 1;
|
|
|
|
|
goto opened;
|
|
|
|
|
case '/':
|
1995-10-09 07:06:29 +00:00
|
|
|
|
if (err = opentty (&startdir))
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return err;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
dealloc_dir = 1;
|
|
|
|
|
strcpy (retryname, &retryname[4]);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
goto bad_magic;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
goto bad_magic;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
bad_magic:
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return EGRATUITOUS;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
}
|
1995-11-16 00:44:18 +00:00
|
|
|
|
break;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
|
|
|
|
default:
|
1996-07-30 19:23:06 +00:00
|
|
|
|
return EGRATUITOUS;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
1996-07-30 19:23:06 +00:00
|
|
|
|
err = __dir_lookup (startdir, (char *)file_name, mode, 0,
|
1995-10-09 07:06:29 +00:00
|
|
|
|
&doretry, retryname, &fileport);
|
1995-05-11 01:02:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1996-07-30 19:23:06 +00:00
|
|
|
|
int weak_function
|
|
|
|
|
__open (const char *file_name, int mode, ...)
|
|
|
|
|
{
|
|
|
|
|
mach_port_t memobj_rd;
|
|
|
|
|
error_t err = open_file (file_name, mode, &memobj_rd, 0);
|
|
|
|
|
if (err)
|
|
|
|
|
return __hurd_fail (err);
|
|
|
|
|
else
|
|
|
|
|
return (int)memobj_rd;
|
|
|
|
|
}
|
|
|
|
|
|
1996-07-08 06:18:25 +00:00
|
|
|
|
int weak_function
|
Mon Jun 10 06:14:03 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/mach/hurd/dl-sysdep.c (__open): Define this instead of open.
(__close, __mmap): Likewise define with __ names now.
Mon Jun 10 05:13:18 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* elf/dl-support.c: New file.
* elf/Makefile (CFLAGS-dl-support.c): New variable.
(routines, elide-routines.so): Add dl-support.
* elf/dl-minimal.c (_dl_pagesize): Remove common defn.
* elf/dl-load.c (_dl_pagesize): Define it here.
(_dl_map_object_from_fd): Initialize it if zero.
* elf/link.h (_dl_pagesize): Remove const.
Sun Jun 9 04:04:26 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* elf/Makefile (routines): Add dl-symbol.
* elf/dl-lookup.c (_dl_symbol_value): Moved to ...
* elf/dl-symbol.c: New file.
* elf/elf.h (Elf32_Xword, Elf32_Sxword): New types.
(Elf32_Section, Elf64_Section): New types, 16 bits.
(Elf32_Sym, Elf64_Sym): Use it.
* elf/dl-deps.c (_dl_open): Moved to ...
* elf/dl-open.c: New file.
* Makefile (routines): Add dl-open.
* elf/Makefile (dl-routines): New variable.
(routines): Add $(dl-routines).
(elide-routines.so): New variable, set to $(dl-routines).
(libdl-inhibit-o): Variable removed; build all flavors of -ldl.
(rtld-routines): All but rtld, dl-sysdep, and dl-minimal moved to
$(dl-routines).
* elf/dl-lookup.c (_dl_lookup_symbol): Remove magic symbol grokage.
* elf/dladdr.c: Use ELFW(ST_BIND) in place of ELF32_ST_BIND.
* elf/dl-load.c (open_path): Use __ names for open and close. Avoid
using strdup.
(_dl_map_object): Likewise.
(_dl_map_object_from_fd): Use __ names for mmap, munmap, and mprotect.
* elf/dl-minimal.c (malloc): Likewise.
* elf/dl-reloc.c (_dl_relocate_object): Likewise.
* elf/dl-minimal.c (_dl_pagesize): New variable.
(malloc): Use that instead of a static variable.
* elf/dl-reloc.c (_dl_relocate_object): Use _dl_pagesize instead of
calling getpagesize.
* elf/dl-load.c (_dl_map_object_from_fd): Likewise.
* elf/link.h: Declare _dl_pagesize.
* elf/rtld.c (dl_r_debug): Renamed to _dl_r_debug.
* elf/link.h (struct link_map): Use Half for l_phnum instead of Word.
* elf/rtld.c (dl_main): Use Half for phdr count arg.
(_dl_sysdep_start): Update prototype of DL_MAIN function ptr arg.
* elf/dl-load.c (_dl_map_object_from_fd): Use explicit Elf32_Word to
extract 4-byte magic number, not ElfW(Word). Match EI_CLASS against
native wordsize, either 32 or 64.
* elf/elf.h (Elf64_Byte, Elf64_Section): Typedefs removed. In C a
char is always a byte, no need for a typedef. Section indices are
16-bit quantities in elf64, which already have a typedef Elf64_Half.
Remove partial -lelf implementation. There is now a
separately-distributed `libelf' package that implements it.
* elf/dl-lookup.c: Don't #include <libelf.h> any more.
(_dl_elf_hash): New function, moved from
libelf.h:elf_hash.
(_dl_lookup_symbol): Use it instead of elf_hash.
* elf/libelf.h: File removed.
* elf/elf_hash.c: File removed.
* elf/Makefile (headers): Remove libelf.h.
(extra-libs): Remove libelf.
(libelf-routines): Variable removed.
* elf/Makefile (libdl.so): Remove commands from this target. The
implicit rule commands are correct, this explicit rule just serves to
add some dependencies.
* elf/dl-lookup.c (_dl_lookup_symbol): Use ELFW(ST_TYPE) in place of
ELF32_ST_TYPE. Likewise ST_BIND.
* elf/do-rel.h (elf_dynamic_do_rel): Likewise R_SYM.
* elf/link.h (ElfW): New macro for wordsize-independent ElfXX_* type
naming.
(ELFW): New macro, likewise for ELFXX_* macro naming.
(_ElfW, _ElfW_1): New macros, subroutines of ElfW and ELF.
Sat Jun 8 20:52:38 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* elf/link.h, elf/do-rel.h, elf/dynamic-link.h, elf/dl-deps.c,
elf/dl-init.c, elf/dl-load.c, elf/dl-lookup.c, elf/dl-reloc.c,
elf/dl-runtime.c, elf/dladdr.c, elf/dlclose.c, elf/dlsym.c,
elf/linux-compat.c, elf/rtld.c: Change all uses of `Elf32_XXX' to
`ElfW(XXX)' for wordsize-independence.
Sat Jun 8 20:50:42 1996 Richard Henderson <rth@tamu.edu>
* elf/elf.h: Move Elf64_* types in parity with Elf32 counterparts.
(Elf64_auxv_t): New type.
(EM_ALPHA, R_ALPHA_*): New macros for elf64-alpha format.
1996-06-10 10:18:47 +00:00
|
|
|
|
__close (int fd)
|
1995-05-11 01:02:23 +00:00
|
|
|
|
{
|
|
|
|
|
if (fd != (int) MACH_PORT_NULL)
|
|
|
|
|
__mach_port_deallocate (__mach_task_self (), (mach_port_t) fd);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
1998-04-07 09:21:28 +00:00
|
|
|
|
__ptr_t weak_function
|
|
|
|
|
__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
|
1995-05-11 01:02:23 +00:00
|
|
|
|
{
|
1995-10-09 07:06:29 +00:00
|
|
|
|
error_t err;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
vm_prot_t vmprot;
|
|
|
|
|
vm_address_t mapaddr;
|
|
|
|
|
|
|
|
|
|
vmprot = VM_PROT_NONE;
|
|
|
|
|
if (prot & PROT_READ)
|
|
|
|
|
vmprot |= VM_PROT_READ;
|
|
|
|
|
if (prot & PROT_WRITE)
|
|
|
|
|
vmprot |= VM_PROT_WRITE;
|
|
|
|
|
if (prot & PROT_EXEC)
|
|
|
|
|
vmprot |= VM_PROT_EXECUTE;
|
|
|
|
|
|
|
|
|
|
mapaddr = (vm_address_t) addr;
|
1995-10-09 07:06:29 +00:00
|
|
|
|
err = __vm_map (__mach_task_self (),
|
|
|
|
|
&mapaddr, (vm_size_t) len, 0 /*ELF_MACHINE_USER_ADDRESS_MASK*/,
|
|
|
|
|
!(flags & MAP_FIXED),
|
Sun Jul 14 01:51:39 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* manual/Makefile (glibc-targets): Variable and targets removed.
Sat Jul 13 23:50:17 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* manual/Makefile (lib): New phony target. Depend on stamp files.
($(objpfx)stamp%-$(subdir)): New rule to create them when necessary.
1996-07-13 Paul Eggert <eggert@twinsun.com>
* time/strftime.c (strftime): Use space padding for %e, %k, %l,
to match Emacs format-time-string specification.
(DO_NUMBER_SPACEPAD): Renamed from DO_NUMBER_NOPAD.
Sat Jul 13 20:17:38 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* elf/dl-deps.c (_dl_map_object_deps): Take new args PRELOADS and
NPRELOADS, vector of `struct link_map *'s; add them to the searchlist
between MAP and its deps.
* elf/link.h: Fix decl.
* elf/rtld.c (dl_main): If not secure, parse LD_PRELOAD for
colon-separated list of names, map those and pass vector of ptrs as
PRELOADS list to _dl_map_object_deps.
* elf/dl-runtime.c (_dl_object_relocation_scope): Pass new args to
_dl_map_object_deps with empty preload list.
* elf/dl-open.c (_dl_open): Likewise.
* sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_open_zero_fill): Function
removed.
(__mmap): Pass MACH_PORT_NULL for memobj port when (flags & MAP_ANON).
* sysdeps/generic/dl-sysdep.c (_dl_sysdep_open_zero_fill):
Conditionalize defn on [! MAP_ANON].
* elf/dl-minimal.c (malloc): Conditionalize use of _dl_zerofd
on [! MAP_ANON].
* elf/rtld.c (dl_main): Likewise.
* elf/dl-load.c (_dl_zerofd): Conditionalize defn on [! MAP_ANON].
(_dl_map_object_from_fd): Conditionalize initialization of _dl_zerofd.
* elf/dl-fini.c (_dl_fini): Skip finalizer for executable itself.
Sat Jul 13 02:47:53 1996 David Mosberger-Tang <davidm@azstarnet.com>
* stdlib/random.c (__random): Declare as int32_t to be in sync
with declaration.
* socket/Makefile (headers): Add socketbits.h.
* misc/mntent.c (endmntent): Allow for NULL stream. SunOS does
it that way.
* grp/initgroups.c (initgroups): Add groups that user is a member
of, not the ones he is _not_ a member of.
* nss/nsswitch.c (known_compare): Make known_compare() a static
instead of a local function. The latter are difficult to debug
and slow to execute on certain platforms.
* sysdeps/posix/ttyname_r.c (ttyname_r): Use sizeof (dev) - 1 in
place of sizeof (dev). The size of a literal string includes the
NUL byte.
* sysdeps/unix/getlogin.c (getlogin): Initialize ut_fd with -1.
Thu Jul 11 16:59:10 1996 David Mosberger-Tang <davidm@azstarnet.com>
* misc/mntent.c (addmntent): Seek to end of file before writing
entry. Return 1 on error, not -1.
Tue Jul 9 19:08:05 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/unix/sysv/linux/syscalls.list: Mark bdflush as EXTRA
syscall.
Fri Jul 5 18:44:55 1996 David Mosberger-Tang <davidm@azstarnet.com>
* sysdeps/unix/sysv/linux/alpha/ioperm.c (port_to_cpu_addr): Size
shift amount for Jensen must be 5 not 4.
Sat Jul 13 20:04:28 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* socket/sys/socket.h (struct osockaddr): New type.
Sat Jul 13 03:50:53 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/Makefile (routines): Add qefgcvt and qefgcvt_r.
* misc/efgcvt.c, misc/efgcvt_r.c: Change code so that the `double'
and `long double' versions can be generated.
* misc/qefgcvt.c, misc/qefgcvt_r.c: New files. Define macros
so that included efgcvt{,_r}.c file generate `long double'
versions.
* stdlib/stdlib.h: Add prototypes for q[efg]cvt() and q[ef]cvt_r()
functions.
* manual/startup.texi: Document new getsubopt function.
* manual/examples/subopt.c: New example program for documenting
getsubopt function.
Fri Jul 12 23:58:37 1996 Ulrich Drepper <drepper@cygnus.com>
* stdlib/Makefile (routines): Add getsubopt.
* stdlib/stdlib.h: Add prototype for getsubopt.
* stdlib/getsubopt.c: New file. Implement getsubopt function
to handle suboption parsing.
1996-07-14 06:04:09 +00:00
|
|
|
|
(flags & MAP_ANON) ? MACH_PORT_NULL : (mach_port_t) fd,
|
|
|
|
|
(vm_offset_t) offset,
|
1995-10-09 07:06:29 +00:00
|
|
|
|
flags & (MAP_COPY|MAP_PRIVATE),
|
|
|
|
|
vmprot, VM_PROT_ALL,
|
1995-12-19 10:00:22 +00:00
|
|
|
|
(flags & MAP_SHARED) ? VM_INHERIT_SHARE : VM_INHERIT_COPY);
|
1996-01-10 10:00:22 +00:00
|
|
|
|
if (err == KERN_NO_SPACE && (flags & MAP_FIXED))
|
|
|
|
|
{
|
|
|
|
|
/* XXX this is not atomic as it is in unix! */
|
|
|
|
|
/* The region is already allocated; deallocate it first. */
|
|
|
|
|
err = __vm_deallocate (__mach_task_self (), mapaddr, len);
|
|
|
|
|
if (! err)
|
|
|
|
|
err = __vm_map (__mach_task_self (),
|
|
|
|
|
&mapaddr, (vm_size_t) len, 0 /*ELF_MACHINE_USER_ADDRESS_MASK*/,
|
|
|
|
|
!(flags & MAP_FIXED),
|
|
|
|
|
(mach_port_t) fd, (vm_offset_t) offset,
|
|
|
|
|
flags & (MAP_COPY|MAP_PRIVATE),
|
|
|
|
|
vmprot, VM_PROT_ALL,
|
|
|
|
|
(flags & MAP_SHARED)
|
|
|
|
|
? VM_INHERIT_SHARE : VM_INHERIT_COPY);
|
|
|
|
|
}
|
|
|
|
|
|
1998-04-07 09:21:28 +00:00
|
|
|
|
return err ? (__ptr_t) __hurd_fail (err) : (__ptr_t) mapaddr;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
1996-07-08 06:18:25 +00:00
|
|
|
|
void weak_function
|
1995-05-11 01:02:23 +00:00
|
|
|
|
_exit (int status)
|
|
|
|
|
{
|
1995-08-14 22:49:23 +00:00
|
|
|
|
__proc_mark_exit (_dl_hurd_data->portarray[INIT_PORT_PROC],
|
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
|
|
|
|
W_EXITCODE (status, 0), 0);
|
1995-05-11 01:02:23 +00:00
|
|
|
|
while (__task_terminate (__mach_task_self ()))
|
|
|
|
|
__mach_task_self_ = (__mach_task_self) ();
|
|
|
|
|
}
|
|
|
|
|
|
1996-07-30 19:23:06 +00:00
|
|
|
|
/* Read the whole contents of FILE into new mmap'd space with given
|
|
|
|
|
protections. The size of the file is returned in SIZE. */
|
|
|
|
|
void *
|
1997-06-27 23:09:40 +00:00
|
|
|
|
weak_function
|
1996-07-30 19:23:06 +00:00
|
|
|
|
_dl_sysdep_read_whole_file (const char *file, size_t *size, int prot)
|
|
|
|
|
{
|
|
|
|
|
struct stat stat;
|
|
|
|
|
mach_port_t memobj_rd;
|
|
|
|
|
void *contents;
|
|
|
|
|
error_t err = open_file (file, O_RDONLY, &memobj_rd, &stat);
|
|
|
|
|
|
|
|
|
|
if (! err)
|
|
|
|
|
{
|
|
|
|
|
/* Map a copy of the file contents. */
|
|
|
|
|
contents = __mmap (0, stat.st_size, prot, MAP_COPY, memobj_rd, 0);
|
|
|
|
|
if (contents == (void *)-1)
|
|
|
|
|
contents = 0;
|
|
|
|
|
else
|
|
|
|
|
*size = stat.st_size;
|
1995-05-11 01:02:23 +00:00
|
|
|
|
|
1996-07-30 19:23:06 +00:00
|
|
|
|
__mach_port_deallocate (__mach_task_self (), memobj_rd);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
__hurd_fail (err);
|
|
|
|
|
contents = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return contents;
|
|
|
|
|
}
|
|
|
|
|
|
1995-08-14 22:49:23 +00:00
|
|
|
|
/* This function is called by interruptible RPC stubs. For initial
|
|
|
|
|
dynamic linking, just use the normal mach_msg. Since this defn is
|
1995-05-11 01:02:23 +00:00
|
|
|
|
weak, the real defn in libc.so will override it if we are linked into
|
|
|
|
|
the user program (-ldl). */
|
1995-08-14 22:49:23 +00:00
|
|
|
|
|
1996-07-08 06:18:25 +00:00
|
|
|
|
error_t weak_function
|
1995-08-14 22:49:23 +00:00
|
|
|
|
_hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
|
|
|
|
|
mach_msg_option_t option,
|
|
|
|
|
mach_msg_size_t send_size,
|
|
|
|
|
mach_msg_size_t rcv_size,
|
|
|
|
|
mach_port_t rcv_name,
|
|
|
|
|
mach_msg_timeout_t timeout,
|
|
|
|
|
mach_port_t notify)
|
|
|
|
|
{
|
|
|
|
|
return __mach_msg (msg, option, send_size, rcv_size, rcv_name,
|
|
|
|
|
timeout, notify);
|
|
|
|
|
}
|
Update.
1997-08-14 03:14 Ulrich Drepper <drepper@cygnus.com>
* elf/dl-minimal.c: Don't use relative #include paths.
(malloc): Don't try to initialize _dl_pagesize, it already is.
(__sigjmp_save, longjmp): Reformat.
* sysdeps/generic/dl-sysdep.c: Implement _dl_show_auxv function to
show content of auxiliary array.
(_dl_sysdep_start): Remember start of auxiliary vector.
* sysdeps/mach/hurd/dl-sysdep.c: (_dl_show_auxv): New dummy function.
* elf/link.h: Add prototype for _dl_show_auxv.
* elf/rtld.c (dl_main): Call _dl_show_auxv if LD_SHOW_AUXV envvar
is present.
* libio/iofdopen.c: Better prepare for use in libstdc++.
* libio/iofflush.c: Likewise.
* libio/iofgetpos.c: Likewise.
* libio/iofgets.c: Likewise.
* libio/iofopen.c: Likewise.
* libio/iofputs.c: Likewise.
* libio/iofread.c: Likewise.
* libio/iofsetpos.c: Likewise.
* libio/ioftell.c: Likewise.
* libio/iofwrite.c: Likewise.
* libio/iogetdelim.c: Likewise.
* libio/iogets.c: Likewise.
* libio/iopopen.c: Likewise.
* libio/ioputs.c: Likewise.
* libio/iosetbuffer.c: Likewise.
* libio/iosetvbuf.c: Likewise.
* libio/ioungetc.c: Likewise.
* libio/iovsprintf.c: Likewise.
* libio/iovsscanf.c: Likewise.
* manual/creature.texi: Mention _XOPEN_SOURCE_EXTENDED in correct
place.
* manual/math.texi: Add comment to sincos decsription to say it's a
GNU extension.
Fix description of random function.
* posix/fnmatch.h: Recognize Windog by _WINDOWS32 not WIN32.
* posix/glob.c: Likewise. Handle stupid system headers on SunOS.
Add casts for all __alloca calls.
* posix/glob.h: Recognize Windog by _WINDOWS32 not WIN32.
Declare additional GLOB_* constants also if _GNU_SOURCE is defined.
Patches by Paul D. Smith <psmith@BayNetworks.COM>.
* stdio-common/_itoa.c: Don't use relateive #include paths.
* sysdeps/i386/fpu/bits/mathinline.h: Enable optimizations even for
gcc 2.7.
(atan): Loading 1.0 from memory does not pay off.
(asinh): Fix typo.
1997-08-13 09:44 Philip Blundell <Philip.Blundell@pobox.com>
* sysdeps/stub/accept.c: Use socklen_t where necessary.
* sysdeps/stub/bind.c: Likewise.
* sysdeps/stub/connect.c: Likewise.
* sysdeps/stub/getsockname.c: Likewise.
* sysdeps/stub/getsockopt.c: Likewise.
* sysdeps/stub/recvfrom.c: Likewise.
* sysdeps/stub/sendto.c: Likewise.
* sysdeps/stub/setsockopt.c: Likewise.
1997-08-11 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* io/ftw.c (object_compare): Avoid memcmp when comparing scalar
types.
1997-08-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* math/libm-test.c (cbrt_test): Add epsilon for long double to
`cbrt (-0.001)'.
1997-08-11 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/stub/bits/string.h: Fix comment.
1997-08-01 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* elf/Makefile (routines): Remove dl-version.
(dl-routines): Add it here instead. This removes dead code from
libc.so.
1997-08-12 17:17 Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
* malloc/thread-m.h (thread_atfork, thread_atfork_static): New
macros to encapsulate pthread_atfork's functionality.
* malloc/malloc.c (ptmalloc_lock_all, ptmalloc_unlock_all): New
functions, registered via thread_atfork in the initialization
routine or via thread_atfork_static in global scope. This
ensures a consistent state of all locks across fork().
1997-08-11 23:00:32 1997 Mark Kettenis <kettenis@phys.uva.nl>
* login/programs/xtmp.c (compare_entry):
Partially undo patch made by Klaus Espenlaub. There
was no xtmp/utmp typo. Added comment to cclarify this.
* login/programs/xtmp.h: Likewise.
* posix/getopt.c: Recognize Windog by _WINDOWS32 not WIN32.
Patch by Paul D. Smith <psmith@BayNetworks.COM>.
1997-08-12 13:51 Ulrich Drepper <drepper@cygnus.com>
* login/getutid.c: Rename to __getutid and make getutid and getutxid
weak aliases.
Patch by ir. Mark M._Kettenis <kettenis@phys.uva.nl>.
1997-08-11 23:55 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/Makefile [subdir=misc] (sysdep_headers):
Add bits/mman.h.
1997-08-11 08:51:21 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
* stdlib/fmtmsg.c (fmtmsg): Add static to
__libc_once_define macro.
* libc.map (__progname_full, __progname): Added.
1997-08-04 08:31 H.J. Lu <hjl@gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/if_index.c (if_nametoindex): Return 0
if SIOGIFINDEX is not defined.
(if_indextoname): Initialize "result" to NULL.
(if_nametoindex, if_nameindex): Fix ENOSYS setting.
1997-08-11 11:58 Richard Henderson <rth@cygnus.com>
Sparc ISO C 9x exception handling:
* sysdeps/sparc/fpu/bits/mathdef.h: New file.
* sysdeps/sparc/fpu/fclrexcpt.c: New file.
* sysdeps/sparc/fpu/fegetenv.c: New file.
* sysdeps/sparc/fpu/fegetround.c: New file.
* sysdeps/sparc/fpu/feholdexcpt.c: New file.
* sysdeps/sparc/fpu/fesetenv.c: New file.
* sysdeps/sparc/fpu/fesetround.c: New file.
* sysdeps/sparc/fpu/feupdateenv.c: New file.
* sysdeps/sparc/fpu/fgetexcptflg.c: New file.
* sysdeps/sparc/fpu/fraiseexcpt.c: New file.
* sysdeps/sparc/fpu/fsetexcptflg.c: New file.
* sysdeps/sparc/fpu/ftestexcept.c: New file.
* sysdeps/sparc/sparc32/fpu/bits/fenv.h: New file.
* sysdeps/sparc/sparc64/fpu/bits/fenv.h: New file.
1997-08-11 11:58 Richard Henderson <rth@cygnus.com>
Sparc64 merge:
* configure.in: Change up subdirectories, rename sparc8->sparcv8.
* csu/Makefile: Nuke need-nopic-initfini bits. The problem was
that sparc64 ld did not recognize pic relocs at all.
* elf/dl-deps.c: Include <string.h>.
* elf/do-rel.h (elf_dynamic_do_rel): Take reloc address and size
directly instead of the DT names to get them from.
* elf/dynamic-link.h (_ELF_DYNAMIC_DO_RELOC): New macro distilled
from ELF_DYNAMIC_DO_REL{,A}. Define a second version that accounts
for the possibility that DT_RELA and DT_JMPPLT overlap, as such is
the case on the Sparc.
* elf/elf.h: Stub out Elf64_Ver*, and make them the same as the
Elf32_Ver* bits. The linker does not even know to differentiate
between the word sizes. Someone should examine this and figure
out what the proper sizes of things should be for 64-bit hosts
before the sparc64 libraries are distributed.
* shlib-versions: Rename sparc64 ld.so to not conflict with sparc32
on the same machine.
Move old sysdeps/sparc contents to sysdeps/sparc/sparc32,
rename sparc8 subdir to sparcv8, move sysdeps/sparc64 content to
sysdeps/sparc/sparc64. Same for sysdeps/unix/sysv/linux/sparc.
* sysdeps/sparc/Implies: Do ieee754 here.
* sysdeps/sparc/configure.in: Move from sparc32/.
* sysdeps/sparc/sparc32/Implies: Do wordsize here.
* sysdeps/sparc/sparc64/Implies: Likewise.
* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_load_address):
Use uninitialized .got to find load address instead of AT_BASE, as
the later does not exist when running ld.so directly.
* sysdeps/sparc/sparc32/fpu/fpu_control.h: Move from ../.
* sysdeps/sparc/sparc64/fpu/fpu_control.h: Likewise.
* sysdeps/sparc/sparc32/udiv_qrnnd.S: Clean up PIC support.
* sysdeps/sparc/sparc64/Makefile (sysdep_routines): Add s_finitel
and s_signbitl for stdio.
* sysdeps/sparc/sparc64/configure.in: Remove, we no longer need
nopic_initfini.
* sysdeps/sparc/sparc64/bsd-_setjmp.S: Remove.
* sysdeps/sparc/sparc64/bsd-setjmp.S: Remove.
* sysdeps/unix/sysv/linux/sparc/sparc64/bsd-_setjmp.S: New empty file.
* sysdeps/unix/sysv/linux/sparc/sparc64/bsd-setjmp.S: New empty file.
* sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Add __longjmp alias.
* sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S: Add weak _setjmp
and setjmp entry points.
* sysdeps/sparc/sparc64/dl-machine.h: Finish real implementation.
* sysdeps/sparc/sparc64/elf/crtbegin.S: Add copyright, fix PIC.
* sysdeps/sparc/sparc64/elf/crtend.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h (struct sigaction):
Fix sa_flags size for sparc64; add sa_restorer for kernel.
* sysdeps/unix/sysv/linux/sparc/sparc64/brk.S: Fix PIC.
* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S: New file.
1997-08-10 18:29:08 1997 Mark Kettenis <kettenis@phys.uva.nl>
* login/login.c (login): Check for correct return value of
utmpname.
1997-08-11 16:49 Ulrich Drepper <drepper@cygnus.com>
* time/tzset.c (__tzset_internal): Correctly handle TZ strings
following incorrect old POSIX specs.
Patch by Paul Eggert <eggert@twinsun.com>.
* sysdeps/generic/bits/sigaction.h: Correct comment for SA_RESTART.
* sysdeps/unix/bsd/osf/bits/sigaction.h: Likewise.
* sysdeps/unix/sysv/linux/alpha/bits/sigaction.h: Likewise.
* sysdeps/unix/sysv/linux/bits/sigaction.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/sigaction.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h: Likewise.
* sysdeps/unix/sysv/minix/bits/sigaction.h: Likewise.
* sysdeps/unix/sysv/sysv4/bits/sigaction.h: Likewise.
Reported by NIIBE Yutaka <gniibe@mri.co.jp>.
1997-08-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* manual/math.texi: Define the macros @mul and @infinity and use
them to format the multiplication and infinity signs.
(FP Comparison Functions): Use @code, not @math, for C code
examples.
* elf/dl-profile.c: Add descriptions and implement reading of
1997-08-14 01:54:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
_dl_show_auxv (void)
|
|
|
|
|
{
|
|
|
|
|
/* There is nothing to print. Hurd has no auxiliary vector. */
|
|
|
|
|
}
|
1998-05-27 10:29:02 +00:00
|
|
|
|
|
|
|
|
|
void weak_function
|
|
|
|
|
_dl_sysdep_fatal (const char *msg, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
va_start (ap, msg);
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
size_t len = strlen (msg);
|
|
|
|
|
mach_msg_type_number_t nwrote;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
if (__io_write (_hurd_init_dtable[2], msg, len, -1, &nwrote))
|
|
|
|
|
break;
|
|
|
|
|
len -= nwrote;
|
|
|
|
|
msg += nwrote;
|
|
|
|
|
} while (nwrote > 0);
|
|
|
|
|
msg = va_arg (ap, const char *);
|
|
|
|
|
} while (msg);
|
|
|
|
|
va_end (ap);
|
|
|
|
|
|
|
|
|
|
_exit (127);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void weak_function
|
|
|
|
|
_dl_sysdep_error (const char *msg, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
va_start (ap, msg);
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
size_t len = strlen (msg);
|
|
|
|
|
mach_msg_type_number_t nwrote;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
if (__io_write (_hurd_init_dtable[2], msg, len, -1, &nwrote))
|
|
|
|
|
break;
|
|
|
|
|
len -= nwrote;
|
|
|
|
|
msg += nwrote;
|
|
|
|
|
} while (nwrote > 0);
|
|
|
|
|
msg = va_arg (ap, const char *);
|
|
|
|
|
} while (msg);
|
|
|
|
|
va_end (ap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void weak_function
|
|
|
|
|
_dl_sysdep_message (const char *msg, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
va_start (ap, msg);
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
size_t len = strlen (msg);
|
|
|
|
|
mach_msg_type_number_t nwrote;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
if (__io_write (_hurd_init_dtable[1], msg, len, -1, &nwrote))
|
|
|
|
|
break;
|
|
|
|
|
len -= nwrote;
|
|
|
|
|
msg += nwrote;
|
|
|
|
|
} while (nwrote > 0);
|
|
|
|
|
msg = va_arg (ap, const char *);
|
|
|
|
|
} while (msg);
|
|
|
|
|
va_end (ap);
|
|
|
|
|
}
|