1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
2000-01-12  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_32BITUIDS):
	Added for Linux 2.3.39+.

	* sysdeps/unix/sysv/linux/getresgid.c: Support 32bit UIDs and
	32bit GIDs.
	* sysdeps/unix/sysv/linux/getresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setegid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/seteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setfsgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setfsuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setregid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setreuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setuid.c: Likewise.
	* sysdeps/unix/sysv/linux/setegid.c: Likewise.

	* sysdeps/unix/sysv/linux/arm/chown.c: New file.
	* sysdeps/unix/sysv/linux/arm/fchown.c: New file.
	* sysdeps/unix/sysv/linux/arm/geteuid.c: New file.
	* sysdeps/unix/sysv/linux/arm/getegid.c: New file.
	* sysdeps/unix/sysv/linux/arm/getuid.c: New file.
	* sysdeps/unix/sysv/linux/arm/getgid.c: New file.
	* sysdeps/unix/sysv/linux/arm/lchown.c: New file.
	* sysdeps/unix/sysv/linux/i386/fchown.c: New file.
	* sysdeps/unix/sysv/linux/i386/getegid.c: New file.
	* sysdeps/unix/sysv/linux/i386/geteuid.c: New file.
	* sysdeps/unix/sysv/linux/i386/getgid.c: New file.
	* sysdeps/unix/sysv/linux/i386/getuid.c: New file.
	* sysdeps/unix/sysv/linux/i386/lchown.c: New file.
	* sysdeps/unix/sysv/linux/m68k/chown.c: New file.
	* sysdeps/unix/sysv/linux/m68k/fchown.c: New file.
	* sysdeps/unix/sysv/linux/m68k/getegid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/geteuid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/getgid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/getuid.c: New file.
	* sysdeps/unix/sysv/linux/m68k/lchown.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/chown.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/fchown.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getegid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/geteuid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getgid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getuid.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/lchown.c: New file.
	Based on a patch by Chris Wing <wingc@engin.umich.edu>.

2000-01-14  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/sparc/sys/procfs.h: New file.

2000-01-13  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/generic/backtrace.c: Include signal.h which
	sigcontextinfo.h headers are used to expect.
	* sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h
	(register_dump): Fix a typo in the printout.
	Avoid using reg_window, so that asm/ptrace.h is not necessary.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sigcontextinfo.h
	(ADVANCE_STACK_FRAME): Likewise.

	* stdlib/longlong.h: Avoid using __sparc_v9__ ifdefs.
	* sysdeps/sparc/sparc32/bits/wordsize.h: Likewise.
	* sysdeps/sparc/sparc64/bits/wordsize.h: Likewise.

	* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Include bits/wordsize.h
	to make it clear this file depends on __WORDSIZE.
	* sysdeps/unix/sysv/linux/ftruncate64.c (__have_no_truncate64):
	Renamed from have_no_truncate64.
	* sysdeps/unix/sysv/linux/truncate64.c (__have_no_truncate64):
	Likewise.
This commit is contained in:
Ulrich Drepper
2000-01-17 05:24:52 +00:00
parent 2449110a8a
commit 313fed0111
55 changed files with 1171 additions and 69 deletions

View File

@ -1,3 +1,80 @@
2000-01-12 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_32BITUIDS):
Added for Linux 2.3.39+.
* sysdeps/unix/sysv/linux/getresgid.c: Support 32bit UIDs and
32bit GIDs.
* sysdeps/unix/sysv/linux/getresuid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/chown.c: Likewise.
* sysdeps/unix/sysv/linux/i386/getgroups.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setegid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/seteuid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setfsgid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setfsuid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setgid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setgroups.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setregid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setresgid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setreuid.c: Likewise.
* sysdeps/unix/sysv/linux/i386/setuid.c: Likewise.
* sysdeps/unix/sysv/linux/setegid.c: Likewise.
* sysdeps/unix/sysv/linux/arm/chown.c: New file.
* sysdeps/unix/sysv/linux/arm/fchown.c: New file.
* sysdeps/unix/sysv/linux/arm/geteuid.c: New file.
* sysdeps/unix/sysv/linux/arm/getegid.c: New file.
* sysdeps/unix/sysv/linux/arm/getuid.c: New file.
* sysdeps/unix/sysv/linux/arm/getgid.c: New file.
* sysdeps/unix/sysv/linux/arm/lchown.c: New file.
* sysdeps/unix/sysv/linux/i386/fchown.c: New file.
* sysdeps/unix/sysv/linux/i386/getegid.c: New file.
* sysdeps/unix/sysv/linux/i386/geteuid.c: New file.
* sysdeps/unix/sysv/linux/i386/getgid.c: New file.
* sysdeps/unix/sysv/linux/i386/getuid.c: New file.
* sysdeps/unix/sysv/linux/i386/lchown.c: New file.
* sysdeps/unix/sysv/linux/m68k/chown.c: New file.
* sysdeps/unix/sysv/linux/m68k/fchown.c: New file.
* sysdeps/unix/sysv/linux/m68k/getegid.c: New file.
* sysdeps/unix/sysv/linux/m68k/geteuid.c: New file.
* sysdeps/unix/sysv/linux/m68k/getgid.c: New file.
* sysdeps/unix/sysv/linux/m68k/getuid.c: New file.
* sysdeps/unix/sysv/linux/m68k/lchown.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/chown.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/fchown.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/getegid.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/geteuid.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/getgid.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/getuid.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/lchown.c: New file.
Based on a patch by Chris Wing <wingc@engin.umich.edu>.
2000-01-14 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/sparc/sys/procfs.h: New file.
2000-01-13 Jakub Jelinek <jakub@redhat.com>
* sysdeps/generic/backtrace.c: Include signal.h which
sigcontextinfo.h headers are used to expect.
* sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h
(register_dump): Fix a typo in the printout.
Avoid using reg_window, so that asm/ptrace.h is not necessary.
* sysdeps/unix/sysv/linux/sparc/sparc32/sigcontextinfo.h
(ADVANCE_STACK_FRAME): Likewise.
* stdlib/longlong.h: Avoid using __sparc_v9__ ifdefs.
* sysdeps/sparc/sparc32/bits/wordsize.h: Likewise.
* sysdeps/sparc/sparc64/bits/wordsize.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Include bits/wordsize.h
to make it clear this file depends on __WORDSIZE.
* sysdeps/unix/sysv/linux/ftruncate64.c (__have_no_truncate64):
Renamed from have_no_truncate64.
* sysdeps/unix/sysv/linux/truncate64.c (__have_no_truncate64):
Likewise.
2000-01-16 Ulrich Drepper <drepper@cygnus.com> 2000-01-16 Ulrich Drepper <drepper@cygnus.com>
* Makeconfig (rpath-dirs): Remove db2. * Makeconfig (rpath-dirs): Remove db2.

View File

@ -993,8 +993,8 @@ UDItype __umulsidi3 (USItype, USItype);
#define UMUL_TIME 5 #define UMUL_TIME 5
#endif #endif
#if defined (__sparc__) && !defined (__sparc_v9__) && !defined(__arch64__) \ #if defined (__sparc__) && !defined(__arch64__) \
&& !defined(__sparc_v9) && W_TYPE_SIZE == 32 && !defined(__sparcv9) && W_TYPE_SIZE == 32
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
__asm__ ("addcc %r4,%5,%1 __asm__ ("addcc %r4,%5,%1
addx %r2,%3,%0" \ addx %r2,%3,%0" \
@ -1182,7 +1182,7 @@ UDItype __umulsidi3 (USItype, USItype);
#endif /* __sparc_v8__ */ #endif /* __sparc_v8__ */
#endif /* __sparc__ */ #endif /* __sparc__ */
#if (defined (__sparc_v9__) || (defined (__sparc__) && defined (__arch64__)) \ #if (defined (__sparc__) && defined (__arch64__)) \
|| defined (__sparcv9)) && W_TYPE_SIZE == 64 || defined (__sparcv9)) && W_TYPE_SIZE == 64
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
__asm__ ("addcc %r4,%5,%1 __asm__ ("addcc %r4,%5,%1
@ -1246,7 +1246,7 @@ UDItype __umulsidi3 (USItype, USItype);
} while (0) } while (0)
#define UMUL_TIME 96 #define UMUL_TIME 96
#define UDIV_TIME 230 #define UDIV_TIME 230
#endif /* __sparc_v9__ */ #endif /* sparc64 */
#if defined (__vax__) && W_TYPE_SIZE == 32 #if defined (__vax__) && W_TYPE_SIZE == 32
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \

View File

@ -19,6 +19,7 @@
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <execinfo.h> #include <execinfo.h>
#include <signal.h>
#include <frame.h> #include <frame.h>
#include <sigcontextinfo.h> #include <sigcontextinfo.h>

View File

@ -1,6 +1,6 @@
/* Determine the wordsize from the preprocessor defines. */ /* Determine the wordsize from the preprocessor defines. */
#if defined __sparc_v9__ || defined __arch64__ || defined __sparcv9 #if defined __arch64__ || defined __sparcv9
# define __WORDSIZE 64 # define __WORDSIZE 64
#else #else
# define __WORDSIZE 32 # define __WORDSIZE 32

View File

@ -1,6 +1,6 @@
/* Determine the wordsize from the preprocessor defines. */ /* Determine the wordsize from the preprocessor defines. */
#if defined __sparc_v9__ || defined __arch64__ || defined __sparcv9 #if defined __arch64__ || defined __sparcv9
# define __WORDSIZE 64 # define __WORDSIZE 64
#else #else
# define __WORDSIZE 32 # define __WORDSIZE 32

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/m68k/chown.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/fchown.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getegid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/geteuid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getgid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getuid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/lchown.c>

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. /* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -28,7 +28,7 @@
#ifdef __NR_ftruncate64 #ifdef __NR_ftruncate64
#ifndef __ASSUME_TRUNCATE64_SYSCALL #ifndef __ASSUME_TRUNCATE64_SYSCALL
/* The variable is shared between all wrappers around *truncate64 calls. */ /* The variable is shared between all wrappers around *truncate64 calls. */
extern int have_no_truncate64; extern int __have_no_truncate64;
#endif #endif
extern int __syscall_ftruncate64 (int fd, int high_length, int low_length); extern int __syscall_ftruncate64 (int fd, int high_length, int low_length);
@ -41,7 +41,7 @@ ftruncate64 (fd, length)
off64_t length; off64_t length;
{ {
#ifndef __ASSUME_TRUNCATE64_SYSCALL #ifndef __ASSUME_TRUNCATE64_SYSCALL
if (! have_no_truncate64) if (! __have_no_truncate64)
#endif #endif
{ {
unsigned int low = length & 0xffffffff; unsigned int low = length & 0xffffffff;
@ -58,7 +58,7 @@ ftruncate64 (fd, length)
#ifndef __ASSUME_TRUNCATE64_SYSCALL #ifndef __ASSUME_TRUNCATE64_SYSCALL
__set_errno (saved_errno); __set_errno (saved_errno);
have_no_truncate64 = 1; __have_no_truncate64 = 1;
#endif #endif
} }

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998 Free Software Foundation, Inc. /* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,16 +24,47 @@
#include <sysdep.h> #include <sysdep.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include "kernel-features.h"
#ifdef __NR_getresgid #ifdef __NR_getresgid
extern int __syscall_getresgid (__kernel_gid_t *rgid, __kernel_gid_t *egid, extern int __syscall_getresgid (__kernel_gid_t *rgid, __kernel_gid_t *egid,
__kernel_gid_t *sgid); __kernel_gid_t *sgid);
# ifdef __NR_getresgid32
extern int __syscall_getresgid32 (__kernel_gid32_t *rgid, __kernel_gid32_t *egid,
__kernel_gid32_t *sgid);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
# endif /* __NR_getresgid32 */
int int
getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid) getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid)
{ {
# if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (getresgid32, 3, rgid, egid, sgid);
# else
__kernel_gid_t k_rgid, k_egid, k_sgid; __kernel_gid_t k_rgid, k_egid, k_sgid;
int result; int result;
# ifdef __NR_getresgid32
if (!__libc_missing_32bit_uids)
{
int r;
int saved_errno = errno;
r = INLINE_SYSCALL (getresgid32, 3, rgid, egid, sgid);
if (r == 0 || errno != ENOSYS)
return r;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_getresgid32 */
result = INLINE_SYSCALL (getresgid, 3, &k_rgid, &k_egid, &k_sgid); result = INLINE_SYSCALL (getresgid, 3, &k_rgid, &k_egid, &k_sgid);
@ -45,6 +76,7 @@ getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid)
} }
return result; return result;
# endif
} }
#else #else
# include <sysdeps/generic/getresgid.c> # include <sysdeps/generic/getresgid.c>

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998 Free Software Foundation, Inc. /* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,16 +24,46 @@
#include <sysdep.h> #include <sysdep.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include "kernel-features.h"
#ifdef __NR_getresuid #ifdef __NR_getresuid
extern int __syscall_getresuid (__kernel_uid_t *ruid, __kernel_uid_t *euid, extern int __syscall_getresuid (__kernel_uid_t *ruid, __kernel_uid_t *euid,
__kernel_uid_t *suid); __kernel_uid_t *suid);
# ifdef __NR_getresuid32
extern int __syscall_getresuid32 (__kernel_uid32_t *ruid, __kernel_uid32_t *euid,
__kernel_uid32_t *suid);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
# endif /* __NR_getresuid32 */
int int
getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) getresuid (uid_t *ruid, uid_t *euid, uid_t *suid)
{ {
# if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (getresuid32, 3, ruid, euid, suid);
# else
__kernel_uid_t k_ruid, k_euid, k_suid; __kernel_uid_t k_ruid, k_euid, k_suid;
int result; int result;
# ifdef __NR_getresuid32
if (!__libc_missing_32bit_uids)
{
int r;
int saved_errno = errno;
r = INLINE_SYSCALL (getresuid32, 3, ruid, euid, suid);
if (r == 0 || errno != ENOSYS)
return r;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_getresuid32 */
result = INLINE_SYSCALL (getresuid, 3, &k_ruid, &k_euid, &k_suid); result = INLINE_SYSCALL (getresuid, 3, &k_ruid, &k_euid, &k_suid);
@ -45,6 +75,7 @@ getresuid (uid_t *ruid, uid_t *euid, uid_t *suid)
} }
return result; return result;
# endif
} }
#else #else
# include <sysdeps/generic/getresuid.c> # include <sysdeps/generic/getresuid.c>

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998, 1999 Free Software Foundation, Inc. /* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -23,6 +23,9 @@
#include <sys/syscall.h> #include <sys/syscall.h>
#include <kernel-features.h> #include <kernel-features.h>
#include <linux/posix_types.h>
/* /*
In Linux 2.1.x the chown functions have been changed. A new function lchown In Linux 2.1.x the chown functions have been changed. A new function lchown
@ -39,6 +42,15 @@ extern int __syscall_chown (const char *__file,
#if defined __NR_lchown || __ASSUME_LCHOWN_SYSCALL > 0 #if defined __NR_lchown || __ASSUME_LCHOWN_SYSCALL > 0
/* Running under Linux > 2.1.80. */ /* Running under Linux > 2.1.80. */
# ifdef __NR_chown32
extern int __syscall_chown32 (const char *__file,
__kernel_uid32_t owner, __kernel_gid32_t group);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
# endif /* __NR_chown32 */
int int
__real_chown (const char *file, uid_t owner, gid_t group) __real_chown (const char *file, uid_t owner, gid_t group)
@ -50,6 +62,20 @@ __real_chown (const char *file, uid_t owner, gid_t group)
if (!__libc_old_chown) if (!__libc_old_chown)
{ {
int saved_errno = errno; int saved_errno = errno;
# ifdef __NR_chown32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (chown32, 3, file, owner, group);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_chown32 */
result = INLINE_SYSCALL (chown, 3, file, owner, group); result = INLINE_SYSCALL (chown, 3, file, owner, group);
if (result >= 0 || errno != ENOSYS) if (result >= 0 || errno != ENOSYS)
@ -60,7 +86,25 @@ __real_chown (const char *file, uid_t owner, gid_t group)
} }
return __lchown (file, owner, group); return __lchown (file, owner, group);
# elif __ASSUME_32BITUIDS
/* This implies __ASSUME_LCHOWN_SYSCALL. */
return INLINE_SYSCALL (chown32, 3, file, owner, group);
# else # else
/* !__ASSUME_32BITUIDS && ASSUME_LCHOWN_SYSCALL */
# ifdef __NR_chown32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (chown32, 3, file, owner, group);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_chown32 */
return INLINE_SYSCALL (chown, 3, file, owner, group); return INLINE_SYSCALL (chown, 3, file, owner, group);
# endif # endif
} }

View File

@ -0,0 +1,73 @@
/* Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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.
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.
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. */
#include <errno.h>
#include <unistd.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include <linux/posix_types.h>
#include "kernel-features.h"
extern int __syscall_fchown (int __fd,
__kernel_uid_t __owner, __kernel_gid_t __group);
#ifdef __NR_fchown32
extern int __syscall_fchown32 (int __fd,
__kernel_uid32_t __owner, __kernel_gid32_t __group);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
#endif /* __NR_fchown32 */
int
__fchown (int fd, uid_t owner, gid_t group)
{
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (fchown32, 3, fd, owner, group);
#else
# ifdef __NR_fchown32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (fchown32, 3, fd, owner, group);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_fchown32 */
if ( (owner != (uid_t) ((__kernel_uid_t) owner)) ||
(group != (gid_t) ((__kernel_gid_t) group)) )
{
__set_errno (EINVAL);
return -1;
}
return INLINE_SYSCALL (fchown, 3, fd, owner, group);
#endif
}
weak_alias (__fchown, fchown)

View File

@ -0,0 +1,62 @@
/* Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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.
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.
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. */
#include <errno.h>
#include <unistd.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include "kernel-features.h"
extern int __syscall_getegid (void);
#ifdef __NR_getegid32
extern int __syscall_getegid32 (void);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
#endif /* __NR_getegid32 */
gid_t
__getegid (void)
{
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (getegid32, 0);
#else
# ifdef __NR_getegid32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (getegid32, 0);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_getegid32 */
return INLINE_SYSCALL (getegid, 0);
#endif
}
weak_alias (__getegid, getegid)

View File

@ -0,0 +1,62 @@
/* Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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.
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.
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. */
#include <errno.h>
#include <unistd.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include "kernel-features.h"
extern int __syscall_geteuid (void);
#ifdef __NR_geteuid32
extern int __syscall_geteuid32 (void);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
#endif /* __NR_geteuid32 */
uid_t
__geteuid (void)
{
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (geteuid32, 0);
#else
# ifdef __NR_geteuid32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (geteuid32, 0);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_geteuid32 */
return INLINE_SYSCALL (geteuid, 0);
#endif
}
weak_alias (__geteuid, geteuid)

View File

@ -0,0 +1,63 @@
/* Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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.
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.
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. */
#include <errno.h>
#include <unistd.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include "kernel-features.h"
extern int __syscall_getgid (void);
#ifdef __NR_getgid32
extern int __syscall_getgid32 (void);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
#endif /* __NR_getgid32 */
gid_t
__getgid (void)
{
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (getgid32, 0);
#else
# ifdef __NR_getgid32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (getgid32, 0);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_getgid32 */
return INLINE_SYSCALL (getgid, 0);
#endif
}
weak_alias (__getgid, getgid)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. /* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -23,17 +23,25 @@
#include <sysdep.h> #include <sysdep.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include <linux/posix_types.h> #include <linux/posix_types.h>
#include <kernel-features.h>
extern int __syscall_getgroups __P ((int, __kernel_gid_t *));
extern int __syscall_getgroups(int, __kernel_gid_t *);
#ifdef __NR_getgroups32
extern int __syscall_getgroups32 (int, __kernel_gid32_t *);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
#endif /* __NR_getgroups32 */
/* For Linux we must convert the array of groups from the format that the /* For Linux we must convert the array of groups from the format that the
kernel returns. */ kernel returns. */
int int
__getgroups (n, groups) __getgroups (int n, gid_t *groups)
int n;
gid_t *groups;
{ {
if (n < 0) if (n < 0)
{ {
@ -42,8 +50,25 @@ __getgroups (n, groups)
} }
else else
{ {
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (getgroups32, 2, n, groups);
#else
int i, ngids; int i, ngids;
__kernel_gid_t kernel_groups[n = MIN (n, __sysconf (_SC_NGROUPS_MAX))]; __kernel_gid_t kernel_groups[n = MIN (n, __sysconf (_SC_NGROUPS_MAX))];
# ifdef __NR_getgroups32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (getgroups32, 2, n, groups);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_getgroups32 */
ngids = INLINE_SYSCALL (getgroups, 2, n, kernel_groups); ngids = INLINE_SYSCALL (getgroups, 2, n, kernel_groups);
if (n != 0 && ngids > 0) if (n != 0 && ngids > 0)
@ -52,6 +77,7 @@ __getgroups (n, groups)
return ngids; return ngids;
} }
#endif
} }
weak_alias (__getgroups, getgroups) weak_alias (__getgroups, getgroups)

View File

@ -0,0 +1,63 @@
/* Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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.
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.
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. */
#include <errno.h>
#include <unistd.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include "kernel-features.h"
extern int __syscall_getuid (void);
#ifdef __NR_getuid32
extern int __syscall_getuid32 (void);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. This is the definition */
int __libc_missing_32bit_uids;
# endif
#endif /* __NR_getuid32 */
uid_t
__getuid (void)
{
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (getuid32, 0);
#else
# ifdef __NR_getuid32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (getuid32, 0);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_getuid32 */
return INLINE_SYSCALL (getuid, 0);
#endif
}
weak_alias (__getuid, getuid)

View File

@ -0,0 +1,79 @@
/* Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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.
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.
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. */
#include <errno.h>
#include <unistd.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include <linux/posix_types.h>
#include "kernel-features.h"
#ifdef __NR_lchown
extern int __syscall_lchown (const char *__file,
__kernel_uid_t __owner, __kernel_gid_t __group);
# ifdef __NR_lchown32
extern int __syscall_lchown32 (const char *__file,
__kernel_uid32_t __owner, __kernel_gid32_t __group);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
# endif /* __NR_lchown32 */
int
__lchown (const char *file, uid_t owner, gid_t group)
{
# if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (lchown32, 3, file, owner, group);
# else
# ifdef __NR_lchown32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (lchown32, 3, file, owner, group);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_lchown32 */
if ( (owner != (uid_t) ((__kernel_uid_t) owner)) ||
(group != (gid_t) ((__kernel_gid_t) group)) )
{
__set_errno (EINVAL);
return -1;
}
return INLINE_SYSCALL (lchown, 3, file, owner, group);
# endif
}
weak_alias (__lchown, lchown)
#else
# include <sysdeps/generic/lchown.c>
#endif

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. /* Copyright (C) 1995, 96, 97, 98, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -16,22 +16,12 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <linux/posix_types.h>
int int
setegid (gid) setegid (gid)
gid_t gid; gid_t gid;
{ {
if (gid == (gid_t) ~0
|| gid != (gid_t) ((__kernel_gid_t) gid))
{
__set_errno (EINVAL);
return -1;
}
return __setregid (-1, gid); return __setregid (-1, gid);
} }

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998 Free Software Foundation, Inc. /* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -21,7 +21,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <linux/posix_types.h>
#ifdef __NR_setresuid #ifdef __NR_setresuid
extern int __setresuid (uid_t ruid, uid_t euid, uid_t suid); extern int __setresuid (uid_t ruid, uid_t euid, uid_t suid);
@ -31,14 +30,6 @@ int
seteuid (uid_t uid) seteuid (uid_t uid)
{ {
int result; int result;
if (uid == (uid_t) ~0
|| uid != (uid_t) ((__kernel_uid_t) uid))
{
__set_errno (EINVAL);
return -1;
}
/* First try the syscall. */ /* First try the syscall. */
#ifdef __NR_setresuid #ifdef __NR_setresuid
result = __setresuid (-1, uid, -1); result = __setresuid (-1, uid, -1);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998 Free Software Foundation, Inc. /* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -22,15 +22,43 @@
#include <sysdep.h> #include <sysdep.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include <linux/posix_types.h> #include <linux/posix_types.h>
#include "kernel-features.h"
#ifdef __NR_setfsgid #ifdef __NR_setfsgid
extern int __syscall_setfsgid (__kernel_gid_t); extern int __syscall_setfsgid (__kernel_gid_t);
# ifdef __NR_setfsgid32
extern int __syscall_setfsgid32 (__kernel_gid32_t);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
# endif /* __NR_setfsgid32 */
int int
setfsgid (gid_t gid) setfsgid (gid_t gid)
{ {
# if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (setfsgid32, 1, gid);
# else
# ifdef __NR_setfsgid32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (setfsgid32, 1, gid);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_setfsgid32 */
if (gid != (gid_t) ((__kernel_gid_t) gid)) if (gid != (gid_t) ((__kernel_gid_t) gid))
{ {
__set_errno (EINVAL); __set_errno (EINVAL);
@ -38,5 +66,6 @@ setfsgid (gid_t gid)
} }
return INLINE_SYSCALL (setfsgid, 1, gid); return INLINE_SYSCALL (setfsgid, 1, gid);
# endif
} }
#endif #endif

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998 Free Software Foundation, Inc. /* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,13 +24,42 @@
#include <sys/syscall.h> #include <sys/syscall.h>
#include <linux/posix_types.h> #include <linux/posix_types.h>
#include "kernel-features.h"
#ifdef __NR_setfsuid #ifdef __NR_setfsuid
extern int __syscall_setfsuid (__kernel_uid_t); extern int __syscall_setfsuid (__kernel_uid_t);
# ifdef __NR_setfsuid32
extern int __syscall_setfsuid32 (__kernel_uid32_t);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
# endif /* __NR_setfsuid32 */
int int
setfsuid (uid_t uid) setfsuid (uid_t uid)
{ {
# if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (setfsuid32, 1, uid);
# else
# ifdef __NR_setfsuid32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (setfsuid32, 1, uid);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_setfsuid32 */
if (uid != (uid_t) ((__kernel_uid_t) uid)) if (uid != (uid_t) ((__kernel_uid_t) uid))
{ {
__set_errno (EINVAL); __set_errno (EINVAL);
@ -38,5 +67,6 @@ setfsuid (uid_t uid)
} }
return INLINE_SYSCALL (setfsuid, 1, uid); return INLINE_SYSCALL (setfsuid, 1, uid);
# endif
} }
#endif #endif

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998 Free Software Foundation, Inc. /* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -25,11 +25,41 @@
#include <linux/posix_types.h> #include <linux/posix_types.h>
#include "kernel-features.h"
extern int __syscall_setgid (__kernel_gid_t); extern int __syscall_setgid (__kernel_gid_t);
#ifdef __NR_setgid32
extern int __syscall_setgid32 (__kernel_gid32_t);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
#endif /* __NR_setgid32 */
int int
__setgid (gid_t gid) __setgid (gid_t gid)
{ {
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (setgid32, 1, gid);
#else
# ifdef __NR_setgid32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (setgid32, 1, gid);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_setgid32 */
if (gid == (gid_t) ~0 if (gid == (gid_t) ~0
|| gid != (gid_t) ((__kernel_gid_t) gid)) || gid != (gid_t) ((__kernel_gid_t) gid))
{ {
@ -38,5 +68,6 @@ __setgid (gid_t gid)
} }
return INLINE_SYSCALL (setgid, 1, gid); return INLINE_SYSCALL (setgid, 1, gid);
#endif
} }
weak_alias (__setgid, setgid) weak_alias (__setgid, setgid)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. /* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -23,18 +23,26 @@
#include <sysdep.h> #include <sysdep.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include <linux/posix_types.h> #include <linux/posix_types.h>
#include "kernel-features.h"
extern int __syscall_setgroups __P ((int, const __kernel_gid_t *));
extern int __syscall_setgroups (int, const __kernel_gid_t *);
#ifdef __NR_setgroups32
extern int __syscall_setgroups32 __P ((int, const __kernel_gid32_t *));
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
#endif /* __NR_setgroups32 */
/* Set the group set for the current user to GROUPS (N of them). For /* Set the group set for the current user to GROUPS (N of them). For
Linux we must convert the array of groups into the format that the Linux we must convert the array of groups into the format that the
kernel expects. */ kernel expects. */
int int
setgroups (n, groups) setgroups (size_t n, const gid_t *groups)
size_t n;
const gid_t *groups;
{ {
if (n > (size_t) __sysconf (_SC_NGROUPS_MAX)) if (n > (size_t) __sysconf (_SC_NGROUPS_MAX))
{ {
@ -43,9 +51,25 @@ setgroups (n, groups)
} }
else else
{ {
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (setgroups32, 2, n, groups);
#else
size_t i; size_t i;
__kernel_gid_t kernel_groups[n]; __kernel_gid_t kernel_groups[n];
# ifdef __NR_setgroups32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (setgroups32, 2, n, groups);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_setgroups32 */
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
kernel_groups[i] = groups[i]; kernel_groups[i] = groups[i];
@ -58,4 +82,5 @@ setgroups (n, groups)
return INLINE_SYSCALL (setgroups, 2, n, kernel_groups); return INLINE_SYSCALL (setgroups, 2, n, kernel_groups);
} }
#endif
} }

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998 Free Software Foundation, Inc. /* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,12 +24,41 @@
#include <sys/syscall.h> #include <sys/syscall.h>
#include <linux/posix_types.h> #include <linux/posix_types.h>
#include "kernel-features.h"
extern int __syscall_setregid (__kernel_gid_t, __kernel_gid_t); extern int __syscall_setregid (__kernel_gid_t, __kernel_gid_t);
#ifdef __NR_setregid32
extern int __syscall_setregid32 (__kernel_gid32_t, __kernel_gid32_t);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
#endif /* __NR_setregid32 */
int int
__setregid (gid_t rgid, gid_t egid) __setregid (gid_t rgid, gid_t egid)
{ {
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (setregid32, 2, rgid, egid);
#else
# ifdef __NR_setregid32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (setregid32, 2, rgid, egid);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_setregid32 */
if ((rgid != (gid_t) -1 && rgid != (gid_t) (__kernel_gid_t) rgid) if ((rgid != (gid_t) -1 && rgid != (gid_t) (__kernel_gid_t) rgid)
|| (egid != (gid_t) -1 && egid != (gid_t) (__kernel_gid_t) egid)) || (egid != (gid_t) -1 && egid != (gid_t) (__kernel_gid_t) egid))
{ {
@ -38,5 +67,6 @@ __setregid (gid_t rgid, gid_t egid)
} }
return INLINE_SYSCALL (setregid, 2, rgid, egid); return INLINE_SYSCALL (setregid, 2, rgid, egid);
#endif
} }
weak_alias (__setregid, setregid) weak_alias (__setregid, setregid)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998 Free Software Foundation, Inc. /* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,14 +24,44 @@
#include <sysdep.h> #include <sysdep.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include "kernel-features.h"
#ifdef __NR_setresgid #ifdef __NR_setresgid
extern int __syscall_setresgid (__kernel_gid_t rgid, __kernel_gid_t egid, extern int __syscall_setresgid (__kernel_gid_t rgid, __kernel_gid_t egid,
__kernel_gid_t sgid); __kernel_gid_t sgid);
# ifdef __NR_setresgid32
extern int __syscall_setresgid32 (__kernel_gid32_t rgid, __kernel_gid32_t egid,
__kernel_gid32_t sgid);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
# endif /* __NR_setresgid32 */
int int
setresgid (gid_t rgid, gid_t egid, gid_t sgid) setresgid (gid_t rgid, gid_t egid, gid_t sgid)
{ {
# if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (setresgid32, 3, rgid, egid, sgid);
# else
# ifdef __NR_setresgid32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (setresgid32, 3, rgid, egid, sgid);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_setresgid32 */
if ((rgid != (gid_t) -1 && rgid != (gid_t) (__kernel_gid_t) rgid) if ((rgid != (gid_t) -1 && rgid != (gid_t) (__kernel_gid_t) rgid)
|| (egid != (gid_t) -1 && egid != (gid_t) (__kernel_gid_t) egid) || (egid != (gid_t) -1 && egid != (gid_t) (__kernel_gid_t) egid)
|| (sgid != (gid_t) -1 && sgid != (gid_t) (__kernel_gid_t) sgid)) || (sgid != (gid_t) -1 && sgid != (gid_t) (__kernel_gid_t) sgid))
@ -41,5 +71,6 @@ setresgid (gid_t rgid, gid_t egid, gid_t sgid)
} }
return INLINE_SYSCALL (setresgid, 3, rgid, egid, sgid); return INLINE_SYSCALL (setresgid, 3, rgid, egid, sgid);
# endif
} }
#endif #endif

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998 Free Software Foundation, Inc. /* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,14 +24,44 @@
#include <sysdep.h> #include <sysdep.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include "kernel-features.h"
#ifdef __NR_setresuid #ifdef __NR_setresuid
extern int __syscall_setresuid (__kernel_uid_t rgid, __kernel_uid_t egid, extern int __syscall_setresuid (__kernel_uid_t rgid, __kernel_uid_t egid,
__kernel_uid_t sgid); __kernel_uid_t sgid);
# ifdef __NR_setresuid32
extern int __syscall_setresuid32 (__kernel_uid32_t rgid, __kernel_uid32_t egid,
__kernel_uid32_t sgid);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
# endif /* __NR_setresuid32 */
int int
__setresuid (uid_t ruid, uid_t euid, uid_t suid) __setresuid (uid_t ruid, uid_t euid, uid_t suid)
{ {
# if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (setresuid32, 3, ruid, euid, suid);
# else
# ifdef __NR_setresuid32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (setresuid32, 3, ruid, euid, suid);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_setresuid32 */
if ((ruid != (uid_t) -1 && ruid != (uid_t) (__kernel_uid_t) ruid) if ((ruid != (uid_t) -1 && ruid != (uid_t) (__kernel_uid_t) ruid)
|| (euid != (uid_t) -1 && euid != (uid_t) (__kernel_uid_t) euid) || (euid != (uid_t) -1 && euid != (uid_t) (__kernel_uid_t) euid)
|| (suid != (uid_t) -1 && suid != (uid_t) (__kernel_uid_t) suid)) || (suid != (uid_t) -1 && suid != (uid_t) (__kernel_uid_t) suid))
@ -41,6 +71,7 @@ __setresuid (uid_t ruid, uid_t euid, uid_t suid)
} }
return INLINE_SYSCALL (setresuid, 3, ruid, euid, suid); return INLINE_SYSCALL (setresuid, 3, ruid, euid, suid);
# endif
} }
weak_alias (__setresuid, setresuid) weak_alias (__setresuid, setresuid)
#endif #endif

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998 Free Software Foundation, Inc. /* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,12 +24,41 @@
#include <sys/syscall.h> #include <sys/syscall.h>
#include <linux/posix_types.h> #include <linux/posix_types.h>
#include "kernel-features.h"
extern int __syscall_setreuid (__kernel_uid_t, __kernel_uid_t); extern int __syscall_setreuid (__kernel_uid_t, __kernel_uid_t);
#ifdef __NR_setreuid32
extern int __syscall_setreuid32 (__kernel_uid32_t, __kernel_uid32_t);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
#endif /* __NR_setreuid32 */
int int
__setreuid (uid_t ruid, uid_t euid) __setreuid (uid_t ruid, uid_t euid)
{ {
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (setreuid32, 2, ruid, euid);
#else
# ifdef __NR_setreuid32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (setreuid32, 2, ruid, euid);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_setreuid32 */
if ((ruid != (uid_t) -1 && ruid != (uid_t) (__kernel_uid_t) ruid) if ((ruid != (uid_t) -1 && ruid != (uid_t) (__kernel_uid_t) ruid)
|| (euid != (uid_t) -1 && euid != (uid_t) (__kernel_uid_t) euid)) || (euid != (uid_t) -1 && euid != (uid_t) (__kernel_uid_t) euid))
{ {
@ -38,5 +67,6 @@ __setreuid (uid_t ruid, uid_t euid)
} }
return INLINE_SYSCALL (setreuid, 2, ruid, euid); return INLINE_SYSCALL (setreuid, 2, ruid, euid);
#endif
} }
weak_alias (__setreuid, setreuid) weak_alias (__setreuid, setreuid)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998 Free Software Foundation, Inc. /* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,12 +24,40 @@
#include <sys/syscall.h> #include <sys/syscall.h>
#include <linux/posix_types.h> #include <linux/posix_types.h>
#include "kernel-features.h"
extern int __syscall_setuid (__kernel_uid_t); extern int __syscall_setuid (__kernel_uid_t);
#ifdef __NR_setuid32
extern int __syscall_setuid32 (__kernel_uid32_t);
# if __ASSUME_32BITUIDS == 0
/* This variable is shared with all files that need to check for 32bit
uids. */
extern int __libc_missing_32bit_uids;
# endif
#endif /* __NR_setuid32 */
int int
__setuid (uid_t uid) __setuid (uid_t uid)
{ {
#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (setuid32, 1, uid);
#else
# ifdef __NR_setuid32
if (!__libc_missing_32bit_uids)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (setuid32, 1, uid);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_setuid32 */
if (uid == (uid_t) ~0 if (uid == (uid_t) ~0
|| uid != (uid_t) ((__kernel_uid_t) uid)) || uid != (uid_t) ((__kernel_uid_t) uid))
{ {
@ -38,5 +66,6 @@ __setuid (uid_t uid)
} }
return INLINE_SYSCALL (setuid, 1, uid); return INLINE_SYSCALL (setuid, 1, uid);
#endif
} }
weak_alias (__setuid, setuid) weak_alias (__setuid, setuid)

View File

@ -102,3 +102,8 @@
# define __ASSUME_MMAP2_SYSCALL 1 # define __ASSUME_MMAP2_SYSCALL 1
# define __ASSUME_STAT64_SYSCALL 1 # define __ASSUME_STAT64_SYSCALL 1
#endif #endif
/* Linux 2.3.39 introduced 32bit UID/GIDs. */
#if __LINUX_KERNEL_VERSION >= 131879
# define __ASSUME_32BITUIDS 1
#endif

View File

@ -0,0 +1,57 @@
/* Copyright (C) 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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.
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.
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. */
#include <errno.h>
#include <unistd.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include <linux/posix_types.h>
#include <sysdeps/unix/sysv/linux/32bit_uid_compat.h>
extern int __syscall_chown (const char *__file,
uid_t __owner, gid_t __group);
#ifdef __NR_chown32
extern int __syscall_chown32 (const char *__file,
__kernel_uid32_t owner, __kernel_gid32_t group);
#endif /* __NR_chown32 */
int
__chown (const char *file, uid_t owner, gid_t group)
{
#ifdef __NR_chown32
if (__libc_missing_32bit_uids != NO_HIGHUIDS)
{
int result;
int saved_errno = errno;
result = INLINE_SYSCALL (chown32, 3, file, owner, group);
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = NO_HIGHUIDS;
}
#endif /* __NR_chown32 */
return INLINE_SYSCALL (chown, 3, file, owner, group);
}
weak_alias (__chown, chown)

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/fchown.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getegid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/geteuid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getgid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getuid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/lchown.c>

View File

@ -1 +1,51 @@
/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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.
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.
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. */
#include <errno.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
#ifdef __NR_setresgid
extern int __setresgid (gid_t rgid, gid_t egid, gid_t sgid);
int
setegid (gid_t gid)
{
int result;
if (gid == (gid_t) ~0)
{
__set_errno (EINVAL);
return -1;
}
/* First try the syscall. */
result = __setresgid (-1, gid, -1);
if (result == -1 && errno == ENOSYS)
/* No system call available. Use emulation. This may not work
since `setregid' also sets the saved group ID when GID is not
equal to the real group ID, making it impossible to switch back. */
result = __setregid (-1, gid);
return result;
}
#else
# include <sysdeps/unix/bsd/setegid.c> # include <sysdeps/unix/bsd/setegid.c>
#endif

View File

@ -21,6 +21,7 @@
#define _FCNTLBITS_H 1 #define _FCNTLBITS_H 1
#include <sys/types.h> #include <sys/types.h>
#include <bits/wordsize.h>
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files /* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */ located on an ext2 file system */

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/m68k/chown.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/fchown.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getegid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/geteuid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getgid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getuid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/lchown.c>

View File

@ -1,7 +1,7 @@
/* Dump registers. /* Dump registers.
Copyright (C) 1999 Free Software Foundation, Inc. Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 1999. Contributed by Jakub Jelinek <jakub@redhat.com>, 1999.
The GNU C Library is free software; you can redistribute it and/or 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 modify it under the terms of the GNU Library General Public License as
@ -20,7 +20,6 @@
#include <sys/uio.h> #include <sys/uio.h>
#include <stdio-common/_itoa.h> #include <stdio-common/_itoa.h>
#include <asm/ptrace.h>
#include <bits/sigcontext.h> #include <bits/sigcontext.h>
/* We will print the register dump in this format: /* We will print the register dump in this format:
@ -95,7 +94,7 @@ register_dump (int fd, SIGCONTEXT ctx)
struct iovec iov[150]; struct iovec iov[150];
size_t nr = 0; size_t nr = 0;
int i; int i;
struct reg_window *r = (struct reg_window *) unsigned int *r = (unsigned int *)
ctx->si_regs.u_regs[14]; ctx->si_regs.u_regs[14];
#define ADD_STRING(str) \ #define ADD_STRING(str) \
@ -115,7 +114,7 @@ register_dump (int fd, SIGCONTEXT ctx)
for (i = 1; i <= 15; i++) for (i = 1; i <= 15; i++)
hexvalue (ctx->si_regs.u_regs[i], regs[3+i], 8); hexvalue (ctx->si_regs.u_regs[i], regs[3+i], 8);
for (i = 0; i <= 15; i++) for (i = 0; i <= 15; i++)
hexvalue (r->locals[i], regs[19+i], 8); hexvalue (r[i], regs[19+i], 8);
hexvalue (ctx->si_mask, regs[35], 8); hexvalue (ctx->si_mask, regs[35], 8);
/* Generate the output. */ /* Generate the output. */

View File

@ -1,6 +1,6 @@
/* Copyright (C) 1999 Free Software Foundation, Inc. /* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 1999. Contributed by Jakub Jelinek <jakub@redhat.com>, 1999.
The GNU C Library is free software; you can redistribute it and/or 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 modify it under the terms of the GNU Library General Public License as
@ -21,6 +21,7 @@
#define SIGCONTEXT_EXTRA_ARGS #define SIGCONTEXT_EXTRA_ARGS
#define GET_PC(__ctx) ((void *) ((__ctx)->si_regs.pc)) #define GET_PC(__ctx) ((void *) ((__ctx)->si_regs.pc))
#define ADVANCE_STACK_FRAME(__next) \ #define ADVANCE_STACK_FRAME(__next) \
((void *)&(((struct reg_window *) (__next))->ins[6])) ((void *) (((unsigned *)(__next))+14))
#define GET_STACK(__ctx) ((void *) (__ctx)->si_regs.u_regs[14]) #define GET_STACK(__ctx) ((void *) (__ctx)->si_regs.u_regs[14])
#define GET_FRAME(__ctx) ADVANCE_STACK_FRAME (GET_STACK(__ctx)) #define GET_FRAME(__ctx) ADVANCE_STACK_FRAME (GET_STACK(__ctx))

View File

@ -0,0 +1,109 @@
/* Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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.
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.
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. */
#ifndef _SYS_PROCFS_H
#define _SYS_PROCFS_H 1
/* This is somehow modelled after the file of the same name on SysVr4
systems. It provides a definition of the core file format for ELF
used on Linux. */
#include <features.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/ucontext.h>
#include <sys/user.h>
#include <asm/elf.h>
#include <bits/wordsize.h>
__BEGIN_DECLS
struct elf_siginfo
{
int si_signo; /* Signal number. */
int si_code; /* Extra code. */
int si_errno; /* Errno. */
};
/* Definitions to generate Intel SVR4-like core files. These mostly
have the same names as the SVR4 types with "elf_" tacked on the
front to prevent clashes with linux definitions, and the typedef
forms have been avoided. This is mostly like the SVR4 structure,
but more Linuxy, with things that Linux does not support and which
gdb doesn't really use excluded. Fields present but not used are
marked with "XXX". */
struct elf_prstatus
{
struct elf_siginfo pr_info; /* Info associated with signal. */
short int pr_cursig; /* Current signal. */
unsigned long int pr_sigpend; /* Set of pending signals. */
unsigned long int pr_sighold; /* Set of held signals. */
__pid_t pr_pid;
__pid_t pr_ppid;
__pid_t pr_pgrp;
__pid_t pr_sid;
struct timeval pr_utime; /* User time. */
struct timeval pr_stime; /* System time. */
struct timeval pr_cutime; /* Cumulative user time. */
struct timeval pr_cstime; /* Cumulative system time. */
elf_gregset_t pr_reg; /* GP registers. */
int pr_fpvalid; /* True if math copro being used. */
};
#define ELF_PRARGSZ (80) /* Number of chars for args */
struct elf_prpsinfo
{
char pr_state; /* Numeric process state. */
char pr_sname; /* Char for pr_state. */
char pr_zomb; /* Zombie. */
char pr_nice; /* Nice val. */
unsigned long int pr_flag; /* Flags. */
#if __WORDSIZE == 64
unsigned int pr_uid;
unsigned int pr_gid;
#else
unsigned short int pr_uid;
unsigned short int pr_gid;
#endif
int pr_pid, pr_ppid, pr_pgrp, pr_sid;
/* Lots missing */
char pr_fname[16]; /* Filename of executable. */
char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
};
/* Addresses. */
typedef void *psaddr_t;
/* Register sets. Linux has different names. */
typedef gregset_t prgregset_t;
typedef fpregset_t prfpregset_t;
/* We don't have any differences between processes and threads,
therefore habe only ine PID type. */
typedef __pid_t lwpid_t;
typedef struct elf_prstatus prstatus_t;
typedef struct elf_prpsinfo prpsinfo_t;
__END_DECLS
#endif /* sys/procfs.h */

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. /* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -28,7 +28,7 @@
#ifdef __NR_truncate64 #ifdef __NR_truncate64
#ifndef __ASSUME_TRUNCATE64_SYSCALL #ifndef __ASSUME_TRUNCATE64_SYSCALL
/* The variable is shared between all wrappers around *truncate64 calls. */ /* The variable is shared between all wrappers around *truncate64 calls. */
int have_no_truncate64; int __have_no_truncate64;
#endif #endif
extern int __syscall_truncate64 (int fd, int high_length, int low_length); extern int __syscall_truncate64 (int fd, int high_length, int low_length);
@ -41,7 +41,7 @@ truncate64 (path, length)
off64_t length; off64_t length;
{ {
#ifndef __ASSUME_TRUNCATE64_SYSCALL #ifndef __ASSUME_TRUNCATE64_SYSCALL
if (! have_no_truncate64) if (! __have_no_truncate64)
#endif #endif
{ {
unsigned int low = length & 0xffffffff; unsigned int low = length & 0xffffffff;
@ -58,7 +58,7 @@ truncate64 (path, length)
#ifndef __ASSUME_TRUNCATE64_SYSCALL #ifndef __ASSUME_TRUNCATE64_SYSCALL
__set_errno (saved_errno); __set_errno (saved_errno);
have_no_truncate64 = 1; __have_no_truncate64 = 1;
#endif #endif
} }