2006-08-03 17:26:02 +02:00
|
|
|
/* Copyright (C) 1989,91,93,1996-2005,2006 Free Software Foundation, Inc.
|
1996-12-02 05:00:15 +01:00
|
|
|
This file is part of the GNU C Library.
|
1995-02-18 02:27:10 +01:00
|
|
|
|
1996-12-02 05:00:15 +01:00
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 06:58:11 +02: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 02:27:10 +01:00
|
|
|
|
1996-12-02 05:00:15 +01: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 06:58:11 +02:00
|
|
|
Lesser General Public License for more details.
|
1995-02-18 02:27:10 +01:00
|
|
|
|
2001-07-06 06:58:11 +02:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with the GNU C Library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
|
|
02111-1307 USA. */
|
1995-02-18 02:27:10 +01:00
|
|
|
|
Fri Jun 28 02:41:08 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* nss/Makefile (databases): New variable.
(routines, libnss_files-routines): Use it.
(subdir-dirs): Compute from $(services).
* sysdeps/unix/sysv/linux/syscalls.list (create_module, delete_module,
init_module, klogctl): Use EXTRA in the "caller" column so these get
added to unix-extra-syscalls and thus compiled in misc.
* string/Makefile (routines): Add strndup.
* string/strndup.c: New file.
* string/string.h: Declare strndup.
(strndupa): New macro.
* string/string.h: Declare __strdup.
* string/strdup.c: Deansideclized. Define __ name and weak alias.
* string/string.h: Don't define memccpy as macro for [__OPTIMIZE__].
Thu Jun 27 23:43:22 1996 Richard Henderson <rth@tamu.edu>
* sysdeps/alpha/dl-machine.h (elf_machine_rela): The Alpha's
address-of operation and plt format conspire to require all
dynamic relocs to be resolved to actual symbols not plt entries.
Thu Jun 27 02:49:28 1996 Ulrich Drepper <drepper@cygnus.com>
* catgets/gencat.c: Add casts to avoid signed<->unsigned warnings.
* grp/initgroups.c (initgroups): De-ansi-fy.
Move declaration of NGROUPS and GROUPS outside #if so that
the code compiles for NGROUPS_MAX != 0.
* inet/Makefile (headers): Add netinet/ether.h and netinet/if_ether.h.
(routines): Add ether_aton, ether_aton_r, ether_hton, ether_line,
ether_ntoa, ether_ntoa_r, and ether_ntoh.
* inet/ether_aton.c, inet/ether_aton_r.c, inet/ether_hton.c,
inet/ether_line.c, inet/ether_ntoa.c, inet/ether_ntoa_r.c,
inet/ether_ntoh.c: New files. Implementation of functions to
handle Ethernet address to host mapping.
* inet/netinet/ether.h: New file. Declare ether_* functions.
* netinet/ether.h: Wrapper around inet/netinet/ether.h for glibc
compilation.
* nss/ethers-lookup.c: New file. Lookup function for ethers database.
* nss/Makefile (routines): Add ethers-lookup.
(libnss_files-routines): Add files-ethers.
* nss/getXXent_r.c: Don't define set*ent and end*ent function
with _r suffix.
* nss/nss_files/files-XXX.c (internal_endent): Don't reset
KEEP_STREAM every time called.
(_nss_files_end): Reset KEEP_STREAM here instead.
(internal_getent): If STREAM == NULL try to open instead of
signalling error.
Use cast to prevent warning.
Terminate read line in case the buffer is too small.
* nss/nss_files/files-ethers.c: New file. Implementation of
Ethernet adress<->hostname lookup through files interface.
* stdlib/mbstowcs.c: Define based on mbsrtowcs().
* stdlib/mbtowc.c: Define based on mbrtowc().
* stdlib/wcstombs.c: Define based on wcsrtombs().
* stdlib/wctomb.c: Define based on wcrtomb().
* sunrpc/xdr.c (xdr_u_int): Avoid bogus call to
unexpected_sizes_in_xdr_u_int.
* sysdeps/generic/netinet/if_ether.h: New file. Generic declaration
of `struct ether_addr'.
* sysdeps/unix/sysv/linux/netinet/if_ether.h: New file. Linux specific
declaration of `struct ether_addr'.
* wcsmbs/mbrtowc.c: Handle case where argument PS is NULL.
* wcsmbs/mbsrtowcs.c: Ditto.
* wcsmbs/wcrtomb.c: Ditto.
* wcsmbs/wcsrtombs.c: Ditto.
* wcsmbs/mbsinit.c: Prepare for PS being NULL.
1996-06-28 10:56:59 +02:00
|
|
|
#include <alloca.h>
|
2006-08-03 17:41:32 +02:00
|
|
|
#include <assert.h>
|
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 01:12:34 +01:00
|
|
|
#include <errno.h>
|
1995-02-18 02:27:10 +01:00
|
|
|
#include <grp.h>
|
|
|
|
#include <limits.h>
|
1998-09-14 20:45:17 +02:00
|
|
|
#include <stdlib.h>
|
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 01:12:34 +01:00
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
2003-04-23 23:27:36 +02:00
|
|
|
#include <sys/param.h>
|
1995-02-18 02:27:10 +01:00
|
|
|
#include <sys/types.h>
|
1998-06-19 15:01:35 +02:00
|
|
|
#include <nsswitch.h>
|
1995-02-18 02:27:10 +01:00
|
|
|
|
2004-09-30 04:24:51 +02:00
|
|
|
#include "../nscd/nscd-client.h"
|
|
|
|
#include "../nscd/nscd_proto.h"
|
|
|
|
|
|
|
|
|
1998-06-19 15:01:35 +02:00
|
|
|
/* Type of the lookup function. */
|
2000-07-24 18:48:34 +02:00
|
|
|
typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t,
|
|
|
|
long int *, long int *,
|
|
|
|
gid_t **, long int, int *);
|
1998-06-19 15:01:35 +02:00
|
|
|
|
|
|
|
/* The lookup function for the first entry of this service. */
|
|
|
|
extern int __nss_group_lookup (service_user **nip, const char *name,
|
|
|
|
void **fctp);
|
|
|
|
extern void *__nss_lookup_function (service_user *ni, const char *fct_name);
|
|
|
|
|
2002-03-13 20:21:13 +01:00
|
|
|
extern service_user *__nss_group_database attribute_hidden;
|
1998-06-19 15:01:35 +02:00
|
|
|
|
|
|
|
|
2004-09-30 04:24:51 +02:00
|
|
|
#include "compat-initgroups.c"
|
1998-06-19 15:01:35 +02:00
|
|
|
|
|
|
|
|
2001-06-16 21:50:36 +02:00
|
|
|
static int
|
|
|
|
internal_getgrouplist (const char *user, gid_t group, long int *size,
|
|
|
|
gid_t **groupsp, long int limit)
|
1995-02-18 02:27:10 +01:00
|
|
|
{
|
2004-09-30 04:24:51 +02:00
|
|
|
#ifdef USE_NSCD
|
|
|
|
if (__nss_not_use_nscd_group > 0
|
|
|
|
&& ++__nss_not_use_nscd_group > NSS_NSCD_RETRY)
|
|
|
|
__nss_not_use_nscd_group = 0;
|
|
|
|
if (!__nss_not_use_nscd_group)
|
|
|
|
{
|
|
|
|
int n = __nscd_getgrouplist (user, group, size, groupsp, limit);
|
|
|
|
if (n >= 0)
|
|
|
|
return n;
|
|
|
|
|
|
|
|
/* nscd is not usable. */
|
|
|
|
__nss_not_use_nscd_group = 1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1998-06-19 15:01:35 +02:00
|
|
|
service_user *nip = NULL;
|
2000-07-24 18:48:34 +02:00
|
|
|
initgroups_dyn_function fct;
|
1998-06-19 15:01:35 +02:00
|
|
|
enum nss_status status = NSS_STATUS_UNAVAIL;
|
|
|
|
int no_more;
|
|
|
|
/* Start is one, because we have the first group as parameter. */
|
|
|
|
long int start = 1;
|
2001-04-17 05:34:20 +02:00
|
|
|
|
2005-03-30 01:41:03 +02:00
|
|
|
/* Never store more than the starting *SIZE number of elements. */
|
2006-08-03 17:26:02 +02:00
|
|
|
assert (*size > 0);
|
|
|
|
(*groupsp)[0] = group;
|
1995-02-18 02:27:10 +01:00
|
|
|
|
1998-06-19 15:01:35 +02:00
|
|
|
if (__nss_group_database != NULL)
|
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 01:12:34 +01:00
|
|
|
{
|
1998-06-19 15:01:35 +02:00
|
|
|
no_more = 0;
|
|
|
|
nip = __nss_group_database;
|
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 01:12:34 +01:00
|
|
|
}
|
1998-06-19 15:01:35 +02:00
|
|
|
else
|
|
|
|
no_more = __nss_database_lookup ("group", NULL,
|
|
|
|
"compat [NOTFOUND=return] files", &nip);
|
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 01:12:34 +01:00
|
|
|
|
1998-06-19 15:01:35 +02:00
|
|
|
while (! no_more)
|
|
|
|
{
|
2004-10-05 17:36:41 +02:00
|
|
|
long int prev_start = start;
|
|
|
|
|
2000-07-24 03:26:01 +02:00
|
|
|
fct = __nss_lookup_function (nip, "initgroups_dyn");
|
1998-06-19 15:01:35 +02:00
|
|
|
|
|
|
|
if (fct == NULL)
|
1998-07-07 18:30:46 +02:00
|
|
|
{
|
2001-06-16 21:50:36 +02:00
|
|
|
status = compat_call (nip, user, group, &start, size, groupsp,
|
2000-07-24 07:41:25 +02:00
|
|
|
limit, &errno);
|
1998-07-07 18:30:46 +02:00
|
|
|
|
|
|
|
if (nss_next_action (nip, NSS_STATUS_UNAVAIL) != NSS_ACTION_CONTINUE)
|
|
|
|
break;
|
|
|
|
}
|
1998-06-19 15:01:35 +02:00
|
|
|
else
|
2001-06-16 21:50:36 +02:00
|
|
|
status = DL_CALL_FCT (fct, (user, group, &start, size, groupsp,
|
2000-07-24 07:41:25 +02:00
|
|
|
limit, &errno));
|
1998-06-19 15:01:35 +02:00
|
|
|
|
2004-10-05 17:36:41 +02:00
|
|
|
/* Remove duplicates. */
|
|
|
|
long int cnt = prev_start;
|
|
|
|
while (cnt < start)
|
|
|
|
{
|
|
|
|
long int inner;
|
|
|
|
for (inner = 0; inner < prev_start; ++inner)
|
|
|
|
if ((*groupsp)[inner] == (*groupsp)[cnt])
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (inner < prev_start)
|
|
|
|
(*groupsp)[cnt] = (*groupsp)[--start];
|
|
|
|
else
|
|
|
|
++cnt;
|
|
|
|
}
|
|
|
|
|
1998-07-07 18:30:46 +02:00
|
|
|
/* This is really only for debugging. */
|
|
|
|
if (NSS_STATUS_TRYAGAIN > status || status > NSS_STATUS_RETURN)
|
2001-12-17 06:52:18 +01:00
|
|
|
__libc_fatal ("illegal status in internal_getgrouplist");
|
1998-07-07 18:30:46 +02:00
|
|
|
|
Update.
* elf/dynamic-link.h (elf_get_dynamic_info): Take new argument with
load address. Relocate d_ptr in DT_DTRTAB, DT_SYMTAB, DT_RELA, DT_REL,
DT_JMPREL, DT_PLTGOT, and DT_VERSYM l_info entry.
(_ELF_DYNAMIC_DO_RELOC): Take extra argument which specifies whether
rel and rela relocations can both happen and skip one test if this
is not possible.
(ELF_DYNAMIC_DO_RELA, ELF_DYNAMIC_DO_REL): Call _ELF_DYNAMIC_DO_RELOC
appropriately.
* elf/dl-addr.c (_dl_addr): DT_SYMTAB and DT_STRTAB entries are
already relocated.
* elf/dl-deps.c (_dl_map_object_deps): DT_STRTAB entry is already
relocated.
* elf/dl-load.c (_dl_init_paths): DT_STRTAB entry is already relocated.
(_dl_map_object_from_fd): Call elf_get_dynamic_info with new argument.
(_dl_map_object): DT_STRTAB entry is already relocated.
* elf/dl-lookup.c (do_lookup): DT_STRTAB and DT_SYMTAB entries are
already relocated.
* elf/dl-reloc.c (_dl_relocate_object): DT_STRTAB entry is already
relocated.
* elf/dl-runtime.c (fixup): DT_SYMTAB, DT_STRTAB, DT_JMPREL, and
DT_VERSYM entries are already relocated.
(profile_fixup): Likewise.
* elf/dl-version.c: Rename VERSTAG macro into VERSYMIDX. Replace
all users.
(match_symbol): DT_STRTAB entry is already relocated.
(_dl_check_map_versions): Likewise. Also fo DT_VERSYM.
* elf/do-rel.h (elf_dynamic_do_rel): reladdr is now assumed to be
relocated already. DT_SYMTAB and DT_VERSYM entries are also relocated.
* elf/rtld.c (_dl_start): Pass extra argument to elf_get_dynamic_info.
(find_needed): DT_STRTAB entry is already relocated.
(dl_main): Pass extra argument to elf_get_dynamic_info.
DT_STRTAB entry is already relocated.
* sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): DT_JMPREL and
DT_PLTGOT entries are already relocated.
(elf_machine_rela): Likewise for DT_SYMTAB.
* sysdeps/arm/dl-machine.h (elf_machine_rel): DT_STRTAB is already
relocated.
* sysdeps/i386/dl-machine.h (elf_machine_rel): Likewise.
* sysdeps/m68k/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/powerpc/dl-machine.c (__process_machine_rela): Likewise.
* sysdeps/mips/dl-machine.h (elf_machine_got_rel): Likewise.
(elf_machine_got_rel): Likewise for DT_SYMTAB and DT_STRTAB.
* grp/initgroups.c (initgroups): If function in current module was
successful don't stop but continue to process to get all the groups.
1999-02-20 16:02:24 +01:00
|
|
|
if (status != NSS_STATUS_SUCCESS
|
|
|
|
&& nss_next_action (nip, status) == NSS_ACTION_RETURN)
|
1998-07-07 18:30:46 +02:00
|
|
|
break;
|
|
|
|
|
1998-06-19 15:01:35 +02:00
|
|
|
if (nip->next == NULL)
|
|
|
|
no_more = -1;
|
|
|
|
else
|
|
|
|
nip = nip->next;
|
|
|
|
}
|
1996-06-26 17:46:01 +02:00
|
|
|
|
2001-06-16 21:50:36 +02:00
|
|
|
return start;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Store at most *NGROUPS members of the group set for USER into
|
|
|
|
*GROUPS. Also include GROUP. The actual number of groups found is
|
|
|
|
returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. */
|
|
|
|
int
|
|
|
|
getgrouplist (const char *user, gid_t group, gid_t *groups, int *ngroups)
|
|
|
|
{
|
2004-10-05 17:36:41 +02:00
|
|
|
long int size = MAX (1, *ngroups);
|
2001-06-16 21:50:36 +02:00
|
|
|
|
2006-08-03 17:31:32 +02:00
|
|
|
gid_t *newgroups = (gid_t *) malloc (size * sizeof (gid_t));
|
2001-06-16 21:50:36 +02:00
|
|
|
if (__builtin_expect (newgroups == NULL, 0))
|
|
|
|
/* No more memory. */
|
2004-09-30 04:24:51 +02:00
|
|
|
// XXX This is wrong. The user provided memory, we have to use
|
|
|
|
// XXX it. The internal functions must be called with the user
|
|
|
|
// XXX provided buffer and not try to increase the size if it is
|
|
|
|
// XXX too small. For initgroups a flag could say: increase size.
|
2001-06-16 21:50:36 +02:00
|
|
|
return -1;
|
|
|
|
|
2006-08-03 17:26:02 +02:00
|
|
|
int total = internal_getgrouplist (user, group, &size, &newgroups, -1);
|
2003-04-23 23:27:36 +02:00
|
|
|
|
2006-08-03 17:26:02 +02:00
|
|
|
memcpy (groups, newgroups, MIN (*ngroups, total) * sizeof (gid_t));
|
2007-07-12 20:26:36 +02:00
|
|
|
|
2004-12-22 21:10:10 +01:00
|
|
|
free (newgroups);
|
2006-08-03 17:26:02 +02:00
|
|
|
|
|
|
|
int retval = total > *ngroups ? -1 : total;
|
|
|
|
*ngroups = total;
|
|
|
|
|
|
|
|
return retval;
|
2001-06-16 21:50:36 +02:00
|
|
|
}
|
|
|
|
|
2003-06-16 19:18:06 +02:00
|
|
|
static_link_warning (getgrouplist)
|
|
|
|
|
2001-06-16 21:50:36 +02:00
|
|
|
/* Initialize the group set for the current user
|
|
|
|
by reading the group database and using all groups
|
|
|
|
of which USER is a member. Also include GROUP. */
|
|
|
|
int
|
|
|
|
initgroups (const char *user, gid_t group)
|
|
|
|
{
|
|
|
|
#if defined NGROUPS_MAX && NGROUPS_MAX == 0
|
|
|
|
|
|
|
|
/* No extra groups allowed. */
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
long int size;
|
|
|
|
gid_t *groups;
|
|
|
|
int ngroups;
|
|
|
|
int result;
|
|
|
|
|
|
|
|
/* We always use sysconf even if NGROUPS_MAX is defined. That way, the
|
|
|
|
limit can be raised in the kernel configuration without having to
|
|
|
|
recompile libc. */
|
|
|
|
long int limit = __sysconf (_SC_NGROUPS_MAX);
|
|
|
|
|
|
|
|
if (limit > 0)
|
2004-03-30 20:23:15 +02:00
|
|
|
/* We limit the size of the intially allocated array. */
|
|
|
|
size = MIN (limit, 64);
|
2001-06-16 21:50:36 +02:00
|
|
|
else
|
2004-03-30 20:23:15 +02:00
|
|
|
/* No fixed limit on groups. Pick a starting buffer size. */
|
|
|
|
size = 16;
|
2001-06-16 21:50:36 +02:00
|
|
|
|
|
|
|
groups = (gid_t *) malloc (size * sizeof (gid_t));
|
|
|
|
if (__builtin_expect (groups == NULL, 0))
|
|
|
|
/* No more memory. */
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
ngroups = internal_getgrouplist (user, group, &size, &groups, limit);
|
|
|
|
|
2000-07-24 03:26:01 +02:00
|
|
|
/* Try to set the maximum number of groups the kernel can handle. */
|
|
|
|
do
|
2001-06-16 21:50:36 +02:00
|
|
|
result = setgroups (ngroups, groups);
|
|
|
|
while (result == -1 && errno == EINVAL && --ngroups > 0);
|
2000-07-24 03:26:01 +02:00
|
|
|
|
2000-08-24 09:57:44 +02:00
|
|
|
free (groups);
|
|
|
|
|
2000-07-24 03:26:01 +02:00
|
|
|
return result;
|
1995-02-18 02:27:10 +01:00
|
|
|
#endif
|
|
|
|
}
|
2003-06-16 19:18:06 +02:00
|
|
|
|
|
|
|
static_link_warning (initgroups)
|