From e83a36ce9f97ac0f59117b3a62fd2dd8461b1fd5 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 27 Sep 2001 05:21:15 +0000 Subject: Rev all the header files to sync things with glibc 2.2.4 --- include/sys/bitypes.h | 4 +- include/sys/cdefs.h | 222 ++++++++++++++++++++++++++++++++++++++++------ include/sys/dir.h | 16 ++-- include/sys/file.h | 55 ++++++++---- include/sys/io.h | 39 ++++---- include/sys/ioctl.h | 20 ++--- include/sys/ipc.h | 44 ++++++--- include/sys/kd.h | 16 ++-- include/sys/kdaemon.h | 20 ++--- include/sys/klog.h | 20 ++--- include/sys/mman.h | 140 ++++++++++++++++++++++++----- include/sys/mount.h | 32 +++---- include/sys/msg.h | 24 ++--- include/sys/mtio.h | 16 ++-- include/sys/param.h | 75 ++++++++++------ include/sys/poll.h | 29 +++--- include/sys/procfs.h | 123 +++++++++++++++++++++++++ include/sys/ptrace.h | 32 ++++--- include/sys/reboot.h | 20 ++--- include/sys/resource.h | 36 ++++---- include/sys/select.h | 97 ++++++++++++-------- include/sys/sem.h | 30 +++---- include/sys/shm.h | 49 ++++++---- include/sys/socket.h | 58 ++++++------ include/sys/socketcall.h | 22 ----- include/sys/stat.h | 214 +++++++++++++++++++++++++------------------- include/sys/statfs.h | 33 +++---- include/sys/swap.h | 22 ++--- include/sys/sysinfo.h | 41 ++++++++- include/sys/syslog.h | 21 ++--- include/sys/sysmacros.h | 16 ++-- include/sys/time.h | 96 ++++++++++++-------- include/sys/timeb.h | 15 ++-- include/sys/times.h | 54 ++++++++--- include/sys/timex.h | 24 ++--- include/sys/ttydefaults.h | 4 - include/sys/types.h | 111 +++++++++++++++-------- include/sys/ucontext.h | 94 ++++++++++++++++++++ include/sys/uio.h | 26 +++--- include/sys/un.h | 26 +++--- include/sys/user.h | 107 ++++++++-------------- include/sys/utsname.h | 82 ++++++++++++++--- include/sys/vm86.h | 125 -------------------------- include/sys/wait.h | 97 ++++++++++---------- 44 files changed, 1535 insertions(+), 912 deletions(-) create mode 100644 include/sys/procfs.h delete mode 100644 include/sys/socketcall.h create mode 100644 include/sys/ucontext.h delete mode 100644 include/sys/vm86.h (limited to 'include/sys') diff --git a/include/sys/bitypes.h b/include/sys/bitypes.h index 21aaf7436..3a9860f71 100644 --- a/include/sys/bitypes.h +++ b/include/sys/bitypes.h @@ -1 +1,3 @@ -#include +/* The GNU defines all the necessary types. */ + +#include diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index 7df9f1e52..02454ee4d 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -1,49 +1,217 @@ +/* Copyright (C) 1992,93,94,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. -#ifndef __SYS_CDEFS_H -#define __SYS_CDEFS_H -#include + The GNU C Library is free software; you can redistribute it and/or + 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. -#if defined (__STDC__) && __STDC__ + 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 + Lesser General Public License for more details. -#define __CONCAT(x,y) x ## y -#define __STRING(x) #x + 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. */ + +#ifndef _SYS_CDEFS_H +#define _SYS_CDEFS_H 1 + +/* We are almost always included from features.h. */ +#ifndef _FEATURES_H +# include +#endif + +/* The GNU libc does not support any K&R compilers or the traditional mode + of ISO C compilers anymore. Check for some of the combinations not + anymore supported. */ +#if defined __GNUC__ && !defined __STDC__ +# error "You need a ISO C conforming compiler to use the glibc headers" +#endif + +/* Some user header file might have defined this before. */ +#undef __P +#undef __PMT + +#ifdef __GNUC__ + +/* GCC can always grok prototypes. For C++ programs we add throw() + to help it optimize the function calls. But this works only with + gcc 2.8.x and egcs. */ +# if defined __cplusplus && __GNUC_PREREQ (2,8) +# define __THROW throw () +# else +# define __THROW +# endif +# define __P(args) args __THROW +/* This macro will be used for functions which might take C++ callback + functions. */ +# define __PMT(args) args + +#else /* Not GCC. */ + +# define __inline /* No inline functions. */ + +# define __THROW +# define __P(args) args +# define __PMT(args) args + +# define __const const +# define __signed signed +# define __volatile volatile + +#endif /* GCC. */ + +/* For these things, GCC behaves the ANSI way normally, + and the non-ANSI way under -traditional. */ + +#define __CONCAT(x,y) x ## y +#define __STRING(x) #x /* This is not a typedef so `const __ptr_t' does the right thing. */ #define __ptr_t void * +#define __long_double_t long double + + +/* C++ needs to know that types and declarations are C, not C++. */ +#ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +#else +# define __BEGIN_DECLS +# define __END_DECLS +#endif + +/* Support for bounded pointers. */ +#ifndef __BOUNDED_POINTERS__ +# define __bounded /* nothing */ +# define __unbounded /* nothing */ +# define __ptrvalue /* nothing */ +#endif + + +/* Support for flexible arrays. */ +#if __GNUC_PREREQ (2,97) +/* GCC 2.97 supports C99 flexible array members. */ +# define __flexarr [] #else +# ifdef __GNUC__ +# define __flexarr [0] +# else +# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +# define __flexarr [] +# else +/* Some other non-C99 compiler. Approximate with [1]. */ +# define __flexarr [1] +# endif +# endif +#endif + + +/* __asm__ ("xyz") is used throughout the headers to rename functions + at the assembly language level. This is wrapped by the __REDIRECT + macro, in order to support compilers that can do this some other + way. When compilers don't support asm-names at all, we have to do + preprocessor tricks instead (which don't have exactly the right + semantics, but it's the best we can do). + + Example: + int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ -#define __CONCAT(x,y) x/**/y -#define __STRING(x) "x" +#if defined __GNUC__ && __GNUC__ >= 2 -#define __ptr_t char * +# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) +# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) +# define __ASMNAME2(prefix, cname) __STRING (prefix) cname +/* +#elif __SOME_OTHER_COMPILER__ + +# define __REDIRECT(name, proto, alias) name proto; \ + _Pragma("let " #name " = " #alias) +*/ #endif -/* C++ needs to know that types and declarations are C, not C++. */ -#ifdef __cplusplus -# define __BEGIN_DECLS extern "C" { -# define __END_DECLS } +/* GCC has various useful declarations that can be made with the + `__attribute__' syntax. All of the ways we use this do fine if + they are omitted for compilers that don't understand it. */ +#if !defined __GNUC__ || __GNUC__ < 2 +# define __attribute__(xyz) /* Ignore */ +#endif + +/* At some point during the gcc 2.96 development the `malloc' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (2,96) +# define __attribute_malloc__ __attribute__ ((__malloc__)) #else -# define __BEGIN_DECLS -# define __END_DECLS +# define __attribute_malloc__ /* Ignore */ #endif -/* GNUish things */ -#define __CONSTVALUE -#define __CONSTVALUE2 +/* At some point during the gcc 2.96 development the `pure' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (2,96) +# define __attribute_pure__ __attribute__ ((__pure__)) +#else +# define __attribute_pure__ /* Ignore */ +#endif -#ifdef __GNUC__ -/* GCC can always grok prototypes. For C++ programs we add throw() - to help it optimize the function calls. But this works only with - gcc 2.8.x and egcs. */ -#if defined __cplusplus && __GNUC_PREREQ (2,8) -#define __THROW throw() +/* At some point during the gcc 2.8 development the `format_arg' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. + If several `format_arg' attributes are given for the same function, in + gcc-3.0 and older, all but the last one are ignored. In newer gccs, + all designated arguments are considered. */ +#if __GNUC_PREREQ (2,8) +# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) #else -#define __THROW +# define __attribute_format_arg__(x) /* Ignore */ #endif -#else /* GCC */ -#define __THROW + +/* At some point during the gcc 2.97 development the `strfmon' format + attribute for functions was introduced. We don't want to use it + unconditionally (although this would be possible) since it + generates warnings. */ +#if __GNUC_PREREQ (2,97) +# define __attribute_format_strfmon__(a,b) \ + __attribute__ ((__format__ (__strfmon__, a, b))) +#else +# define __attribute_format_strfmon__(a,b) /* Ignore */ #endif +/* It is possible to compile containing GCC extensions even if GCC is + run in pedantic mode if the uses are carefully marked using the + `__extension__' keyword. But this is not generally available before + version 2.8. */ +#if !__GNUC_PREREQ (2,8) +# define __extension__ /* Ignore */ #endif + +/* __restrict is known in EGCS 1.2 and above. */ +#if !__GNUC_PREREQ (2,92) +# define __restrict /* Ignore */ +#endif + +/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is + array_name[restrict] + GCC 3.1 supports this. */ +#if __GNUC_PREREQ (3,1) && !defined __GNUG__ +# define __restrict_arr __restrict +#else +# ifdef __GNUC__ +# define __restrict_arr /* Not supported in old GCC. */ +# else +# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +# define __restrict_arr restrict +# else +/* Some other non-C99 compiler. */ +# define __restrict_arr /* Not supported. */ +# endif +# endif +#endif + +#endif /* sys/cdefs.h */ diff --git a/include/sys/dir.h b/include/sys/dir.h index 96b36c78d..2611d6cd9 100644 --- a/include/sys/dir.h +++ b/include/sys/dir.h @@ -2,19 +2,19 @@ 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. + 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. 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. + Lesser 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. */ + 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. */ #ifndef _SYS_DIR_H #define _SYS_DIR_H 1 diff --git a/include/sys/file.h b/include/sys/file.h index 2401b155a..93b36350a 100644 --- a/include/sys/file.h +++ b/include/sys/file.h @@ -1,35 +1,56 @@ -#ifndef _SYS_FILE_H -#define _SYS_FILE_H +/* Copyright (C) 1991, 92, 96, 97, 98, 99 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 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. + + 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 + Lesser General Public License for more details. + + 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. */ + +#ifndef _SYS_FILE_H +#define _SYS_FILE_H 1 #include -#include -#ifndef L_SET +#ifndef _FCNTL_H +# include +#endif + +__BEGIN_DECLS -#define L_SET 0 /* absolute offset */ -#define L_INCR 1 /* relative to current offset */ -#define L_XTND 2 /* relative to end of file */ +/* Alternate names for values for the WHENCE argument to `lseek'. + These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */ +#ifndef L_SET +# define L_SET 0 /* Seek from beginning of file. */ +# define L_INCR 1 /* Seek from current position. */ +# define L_XTND 2 /* Seek from end of file. */ #endif -#ifndef LOCK_SH /* Operations for the `flock' call. */ -#define LOCK_SH 1 /* Shared lock. */ -#define LOCK_EX 2 /* Exclusive lock. */ -#define LOCK_UN 8 /* Unlock. */ +#define LOCK_SH 1 /* Shared lock. */ +#define LOCK_EX 2 /* Exclusive lock. */ +#define LOCK_UN 8 /* Unlock. */ /* Can be OR'd in to one of the above. */ -#define LOCK_NB 4 /* Don't block when locking. */ +#define LOCK_NB 4 /* Don't block when locking. */ -#endif - -__BEGIN_DECLS /* Apply or remove an advisory lock, according to OPERATION, on the file FD refers to. */ -extern int flock __P ((int __fd, int __operation)); +extern int flock (int __fd, int __operation) __THROW; + __END_DECLS -#endif +#endif /* sys/file.h */ diff --git a/include/sys/io.h b/include/sys/io.h index 9ce921365..9ea033a01 100644 --- a/include/sys/io.h +++ b/include/sys/io.h @@ -1,20 +1,20 @@ -/* Copyright (C) 1996, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1998, 1999 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. + 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. 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. + Lesser 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. */ + 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. */ #ifndef _SYS_IO_H @@ -26,15 +26,15 @@ __BEGIN_DECLS /* If TURN_ON is TRUE, request for permission to do direct i/o on the port numbers in the range [FROM,FROM+NUM-1]. Otherwise, turn I/O permission off for that range. This call requires root privileges. */ -extern int ioperm __P ((unsigned long int __from, unsigned long int __num, - int __turn_on)); +extern int ioperm (unsigned long int __from, unsigned long int __num, + int __turn_on) __THROW; /* Set the I/O privilege level to LEVEL. If LEVEL is nonzero, permission to access any I/O port is granted. This call requires root privileges. */ -extern int iopl __P ((int __level)); +extern int iopl (int __level) __THROW; + -/* The functions that actually perform reads and writes. */ #ifdef __i386__ /* * For i386, glibc defines the in* and out* functions as static inlines @@ -45,13 +45,14 @@ extern int iopl __P ((int __level)); */ #include #else -extern unsigned char inb (unsigned long port); -extern unsigned short inw (unsigned long port); -extern unsigned long inl (unsigned long port); +/* The functions that actually perform reads and writes. */ +extern unsigned char inb (unsigned long int port) __THROW; +extern unsigned short int inw (unsigned long int port) __THROW; +extern unsigned long int inl (unsigned long int port) __THROW; -extern void outb (unsigned char value, unsigned long port); -extern void outw (unsigned short value, unsigned long port); -extern void outl (unsigned long value, unsigned long port); +extern void outb (unsigned char value, unsigned long int port) __THROW; +extern void outw (unsigned short value, unsigned long int port) __THROW; +extern void outl (unsigned long value, unsigned long int port) __THROW; #endif /* __i386__ */ __END_DECLS diff --git a/include/sys/ioctl.h b/include/sys/ioctl.h index acb42f2b3..6d8a0f40b 100644 --- a/include/sys/ioctl.h +++ b/include/sys/ioctl.h @@ -1,20 +1,20 @@ -/* Copyright (C) 1991, 92, 93, 94, 96, 98 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 93, 94, 96, 98, 99 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. + 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. 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. + Lesser 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. */ + 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. */ #ifndef _SYS_IOCTL_H #define _SYS_IOCTL_H 1 @@ -39,7 +39,7 @@ __BEGIN_DECLS /* Perform the I/O control operation specified by REQUEST on FD. One argument may follow; its presence and type depend on REQUEST. Return value depends on REQUEST. Usually -1 indicates error. */ -extern int ioctl __P ((int __fd, unsigned long int __request, ...)); +extern int ioctl (int __fd, unsigned long int __request, ...) __THROW; __END_DECLS diff --git a/include/sys/ipc.h b/include/sys/ipc.h index f1ba7ff18..42806db2b 100644 --- a/include/sys/ipc.h +++ b/include/sys/ipc.h @@ -1,37 +1,57 @@ -/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1997, 1999 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. + 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. 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. + Lesser 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. */ + 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. */ #ifndef _SYS_IPC_H #define _SYS_IPC_H 1 #include +#if !defined __USE_SVID && !defined __USE_XOPEN && __GNUC__ >= 2 +# warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE" +#endif + /* Get system dependent definition of `struct ipc_perm' and more. */ #include -#if !defined __USE_SVID && !defined __USE_XOPEN && __GNUC__ >= 2 -# warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE" +#ifndef __uid_t_defined +typedef __uid_t uid_t; +# define __uid_t_defined +#endif + +#ifndef __gid_t_defined +typedef __gid_t gid_t; +# define __gid_t_defined +#endif + +#ifndef __mode_t_defined +typedef __mode_t mode_t; +# define __mode_t_defined +#endif + +#ifndef __key_t_defined +typedef __key_t key_t; +# define __key_t_defined #endif __BEGIN_DECLS /* Generates key for System V style IPC. */ -extern key_t ftok __P ((__const char *__pathname, int __proj_id)); +extern key_t ftok (__const char *__pathname, int __proj_id) __THROW; __END_DECLS diff --git a/include/sys/kd.h b/include/sys/kd.h index b37586abf..e0d2e869c 100644 --- a/include/sys/kd.h +++ b/include/sys/kd.h @@ -2,19 +2,19 @@ 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. + 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. 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. + Lesser 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. */ + 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. */ #ifndef _SYS_KD_H #define _SYS_KD_H 1 diff --git a/include/sys/kdaemon.h b/include/sys/kdaemon.h index d59fe2bc3..61491f93d 100644 --- a/include/sys/kdaemon.h +++ b/include/sys/kdaemon.h @@ -1,20 +1,20 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1999 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. + 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. 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. + Lesser 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. */ + 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. */ /* Interfaces to control the various kernel daemons. */ @@ -26,7 +26,7 @@ __BEGIN_DECLS /* Start, flush, or tune the kernel's buffer flushing daemon. */ -extern int bdflush __P ((int __func, long int __data)); +extern int bdflush (int __func, long int __data) __THROW; __END_DECLS diff --git a/include/sys/klog.h b/include/sys/klog.h index 62243e9ec..35f5fe40e 100644 --- a/include/sys/klog.h +++ b/include/sys/klog.h @@ -1,20 +1,20 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1999 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. + 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. 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. + Lesser 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. */ + 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. */ #ifndef _SYS_KLOG_H @@ -27,7 +27,7 @@ __BEGIN_DECLS the kernel's syslog system call, but that name is easily confused with the user-level syslog facility, which is something completely different. */ -extern int klogctl __P ((int __type, char *__bufp, int __len)); +extern int klogctl (int __type, char *__bufp, int __len) __THROW; __END_DECLS diff --git a/include/sys/mman.h b/include/sys/mman.h index 68445bbb1..c0dd39e32 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -1,39 +1,139 @@ -#ifndef _SYS_MMAN_H -#define _SYS_MMAN_H +/* Definitions for BSD-style memory management. + Copyright (C) 1994-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 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. + + 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 + Lesser General Public License for more details. + + 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. */ + +#ifndef _SYS_MMAN_H +#define _SYS_MMAN_H 1 #include #include #define __need_size_t #include -#include -#ifndef MAP_ANON -#define MAP_ANON MAP_ANONYMOUS /* idem */ +#ifndef __off_t_defined +# ifndef __USE_FILE_OFFSET64 +typedef __off_t off_t; +# else +typedef __off64_t off_t; +# endif +# define __off_t_defined #endif -#ifndef MAP_FILE -#define MAP_FILE 0x00 /* The 'normal' way: mapped from file */ + +#ifndef __mode_t_defined +typedef __mode_t mode_t; +# define __mode_t_defined #endif -#define MAP_FAILED ((__ptr_t) -1) /* Return value of `mmap' in case of an error. */ +#include + +/* Return value of `mmap' in case of an error. */ +#define MAP_FAILED ((void *) -1) __BEGIN_DECLS +/* Map addresses starting near ADDR and extending for LEN bytes. from + OFFSET into the file FD describes according to PROT and FLAGS. If ADDR + is nonzero, it is the desired mapping address. If the MAP_FIXED bit is + set in FLAGS, the mapping will be at ADDR exactly (which must be + page-aligned); otherwise the system chooses a convenient nearby address. + The return value is the actual mapping address chosen or MAP_FAILED + for errors (in which case `errno' is set). A successful `mmap' call + deallocates any previous mapping for the affected region. */ + +#ifndef __USE_FILE_OFFSET64 +extern void *mmap (void *__addr, size_t __len, int __prot, + int __flags, int __fd, __off_t __offset) __THROW; +#else +# ifdef __REDIRECT +extern void * __REDIRECT (mmap, + (void *__addr, size_t __len, int __prot, + int __flags, int __fd, __off64_t __offset) __THROW, + mmap64); +# else +# define mmap mmap64 +# endif +#endif +#ifdef __USE_LARGEFILE64 +extern void *mmap64 (void *__addr, size_t __len, int __prot, + int __flags, int __fd, __off64_t __offset) __THROW; +#endif -extern __ptr_t mmap __P((__ptr_t __addr, size_t __len, - int __prot, int __flags, int __fd, off_t __off)); -extern int munmap __P((__ptr_t __addr, size_t __len)); -extern int mprotect __P ((__const __ptr_t __addr, size_t __len, int __prot)); +/* Deallocate any mapping for the region starting at ADDR and extending LEN + bytes. Returns 0 if successful, -1 for errors (and sets errno). */ +extern int munmap (void *__addr, size_t __len) __THROW; -extern int msync __P((__ptr_t __addr, size_t __len, int __flags)); +/* Change the memory protection of the region starting at ADDR and + extending LEN bytes to PROT. Returns 0 if successful, -1 for errors + (and sets errno). */ +extern int mprotect (void *__addr, size_t __len, int __prot) __THROW; + +/* Synchronize the region starting at ADDR and extending LEN bytes with the + file it maps. Filesystem operations on a file being mapped are + unpredictable before this is done. Flags are from the MS_* set. */ +extern int msync (void *__addr, size_t __len, int __flags) __THROW; + +#ifdef __USE_BSD +/* Advise the system about particular usage patterns the program follows + for the region starting at ADDR and extending LEN bytes. */ +extern int madvise (void *__addr, size_t __len, int __advice) __THROW; +#endif +#ifdef __USE_XOPEN2K +/* This is the POSIX name for this function. */ +extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW; +#endif + +/* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to + be memory resident. */ +extern int mlock (__const void *__addr, size_t __len) __THROW; + +/* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */ +extern int munlock (__const void *__addr, size_t __len) __THROW; + +/* Cause all currently mapped pages of the process to be memory resident + until unlocked by a call to the `munlockall', until the process exits, + or until the process calls `execve'. */ +extern int mlockall (int __flags) __THROW; + +/* All currently mapped pages of the process' address space become + unlocked. */ +extern int munlockall (void) __THROW; + +#ifdef __USE_MISC +/* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length + NEW_LEN. If MAY_MOVE is MREMAP_MAYMOVE the returned address may + differ from ADDR. */ +extern void *mremap (void *__addr, size_t __old_len, size_t __new_len, + int __may_move) __THROW; + +/* mincore returns the memory residency status of the pages in the + current process's address space specified by [start, start + len). + The status is returned in a vector of bytes. The least significant + bit of each byte is 1 if the referenced page is in memory, otherwise + it is zero. */ +extern int mincore (void *__start, size_t __len, unsigned char *__vec); +#endif -extern int mlock __P((__const __ptr_t __addr, size_t __len)); -extern int munlock __P((__const __ptr_t __addr, size_t __len)); -extern int mlockall __P((int __flags)); -extern int munlockall __P((void)); +/* Open shared memory segment. */ +extern int shm_open (__const char *__name, int __oflag, mode_t __mode); -extern __ptr_t mremap __P((__ptr_t __addr, size_t __old_len, - size_t __new_len, int __may_move)); +/* Remove shared memory segment. */ +extern int shm_unlink (__const char *__name); __END_DECLS -#endif /* _SYS_MMAN_H */ +#endif /* sys/mman.h */ diff --git a/include/sys/mount.h b/include/sys/mount.h index 862c1f040..f768d4dc7 100644 --- a/include/sys/mount.h +++ b/include/sys/mount.h @@ -1,21 +1,21 @@ /* Header file for mounting/unmount Linux filesystems. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 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. + 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. 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. + Lesser 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. */ + 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. */ /* This is taken from /usr/include/linux/fs.h. */ @@ -55,8 +55,10 @@ enum #define S_IMMUTABLE S_IMMUTABLE MS_NOATIME = 1024, /* Do not update access times. */ #define MS_NOATIME MS_NOATIME - MS_NODIRATIME = 2048 /* Do not update directory access times. */ + MS_NODIRATIME = 2048, /* Do not update directory access times. */ #define MS_NODIRATIME MS_NODIRATIME + MS_BIND = 4096, /* Bind directory at different place. */ +#define MS_BIND MS_BIND }; /* Flags that can be altered by MS_REMOUNT */ @@ -93,15 +95,15 @@ enum __BEGIN_DECLS /* Mount a filesystem. */ -extern int mount __P ((__const char *__special_file, __const char *__dir, - __const char *__fstype, unsigned long int __rwflag, - __const void *__data)); +extern int mount (__const char *__special_file, __const char *__dir, + __const char *__fstype, unsigned long int __rwflag, + __const void *__data) __THROW; /* Unmount a filesystem. */ -extern int umount __P ((__const char *__special_file)); +extern int umount (__const char *__special_file) __THROW; /* Unmount a filesystem. Force unmounting if FLAGS is set to MNT_FORCE. */ -extern int umount2 __P ((__const char *__special_file, int __flags)); +extern int umount2 (__const char *__special_file, int __flags) __THROW; __END_DECLS diff --git a/include/sys/msg.h b/include/sys/msg.h index cba58b364..9568baf89 100644 --- a/include/sys/msg.h +++ b/include/sys/msg.h @@ -2,19 +2,19 @@ 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. + 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. 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. + Lesser 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. */ + 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. */ #ifndef _SYS_MSG_H #define _SYS_MSG_H @@ -57,18 +57,18 @@ struct msgbuf __BEGIN_DECLS /* Message queue control operation. */ -extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf); +extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW; /* Get messages queue. */ -extern int msgget (key_t __key, int __msgflg); +extern int msgget (key_t __key, int __msgflg) __THROW; /* Receive message from message queue. */ extern int msgrcv (int __msqid, void *__msgp, size_t __msgsz, - long int __msgtyp, int __msgflg); + long int __msgtyp, int __msgflg) __THROW; /* Send message to message queue. */ extern int msgsnd (int __msqid, __const void *__msgp, size_t __msgsz, - int __msgflg); + int __msgflg) __THROW; __END_DECLS diff --git a/include/sys/mtio.h b/include/sys/mtio.h index 7498dfa78..51fa550cd 100644 --- a/include/sys/mtio.h +++ b/include/sys/mtio.h @@ -3,19 +3,19 @@ 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. + 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. 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. + Lesser 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. */ + 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. */ /* Written by H. Bergman . */ diff --git a/include/sys/param.h b/include/sys/param.h index c59222cd4..d64f4b9a9 100644 --- a/include/sys/param.h +++ b/include/sys/param.h @@ -1,49 +1,66 @@ -/* Copyright (C) 1996 Robert de Bath - * This file is part of the Linux-8086 C library and is distributed - * under the GNU Library General Public License. - */ +/* Copyright (C) 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. -#ifndef _PARAM_H -#define _PARAM_H + The GNU C Library is free software; you can redistribute it and/or + 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. + + 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 + Lesser General Public License for more details. + + 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. */ + +#ifndef _SYS_PARAM_H +#define _SYS_PARAM_H 1 -#include #include #include -#include - -#include +#include -#define MAXPATHLEN PATH_MAX +/* BSD names for some values. */ -#ifndef NR_OPEN -#define NR_OPEN 32 -#endif -#ifndef NR_FILE -#define NR_FILE 32 +#define NBBY CHAR_BIT +#ifndef NGROUPS +# define NGROUPS NGROUPS_MAX #endif +#define MAXSYMLINKS 20 +#define CANBSIZ MAX_CANON +#define NCARGS ARG_MAX +#define MAXPATHLEN PATH_MAX +/* The following is not really correct but it is a value we used for a + long time and which seems to be usable. People should not use NOFILE + anyway. */ +#define NOFILE 256 + -/* Number of Bits per BYte */ -#define NBBY CHAR_BIT +#include /* Bit map related macros. */ -#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) -#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) -#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) -#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) +#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) +#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) +#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) +#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) /* Macros for counting and rounding. */ #ifndef howmany -#define howmany(x, y) (((x)+((y)-1))/(y)) +# define howmany(x, y) (((x)+((y)-1))/(y)) #endif -#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) -#define powerof2(x) ((((x)-1)&(x))==0) +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) +#define powerof2(x) ((((x)-1)&(x))==0) /* Macros for min/max. */ -#define MIN(a,b) (((a)<(b))?(a):(b)) -#define MAX(a,b) (((a)>(b))?(a):(b)) +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a,b) (((a)>(b))?(a):(b)) /* Unit of `st_blocks'. */ -#define DEV_BSIZE 512 +#define DEV_BSIZE 512 + -#endif /* _PARAM_H */ +#endif /* sys/param.h */ diff --git a/include/sys/poll.h b/include/sys/poll.h index 9cb60e72e..bf1c9e203 100644 --- a/include/sys/poll.h +++ b/include/sys/poll.h @@ -1,21 +1,21 @@ /* Compatibility definitions for System V `poll' interface. - Copyright (C) 1994, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1994,96,97,98,99,2000,2001 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. + 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. 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. + Lesser 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. */ + 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. */ #ifndef _SYS_POLL_H #define _SYS_POLL_H 1 @@ -25,7 +25,9 @@ /* Get the platform dependent bits of `poll'. */ #include -__BEGIN_DECLS + +/* Type used for the number of file descriptors. */ +typedef unsigned long int nfds_t; /* Data structure describing a polling request. */ struct pollfd @@ -36,15 +38,14 @@ struct pollfd }; +__BEGIN_DECLS + /* Poll the file descriptors described by the NFDS structures starting at FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for an event to occur; if TIMEOUT is -1, block until an event occurs. Returns the number of file descriptors with events, zero if timed out, or -1 for errors. */ -extern int __poll __P ((struct pollfd *__fds, unsigned long int __nfds, - int __timeout)); -extern int poll __P ((struct pollfd *__fds, unsigned long int __nfds, - int __timeout)); +extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout) __THROW; __END_DECLS diff --git a/include/sys/procfs.h b/include/sys/procfs.h new file mode 100644 index 000000000..3b3736324 --- /dev/null +++ b/include/sys/procfs.h @@ -0,0 +1,123 @@ +/* Copyright (C) 1996, 1997, 1999, 2001 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 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. + + 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 + Lesser General Public License for more details. + + 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. */ + +#ifndef _SYS_PROCFS_H +#define _SYS_PROCFS_H 1 + +/* This is somewhat modelled after the file of the same name on SVR4 + systems. It provides a definition of the core file format for ELF + used on Linux. It doesn't have anything to do with the /proc file + system, even though Linux has one. + + Anyway, the whole purpose of this file is for GDB and GDB only. + Don't read too much into it. Don't use it for anything other than + GDB unless you know what you are doing. */ + +#include +#include +#include +#include + +__BEGIN_DECLS + +/* Type for a general-purpose register. */ +typedef unsigned long elf_greg_t; + +/* And the whole bunch of them. We could have used `struct + user_regs' directly in the typedef, but tradition says that + the register set is an array, which does have some peculiar + semantics, so leave it that way. */ +#define ELF_NGREG (sizeof (struct user_regs) / sizeof(elf_greg_t)) +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +/* Register set for the floating-point registers. */ +typedef struct user_fpregs elf_fpregset_t; + +/* Signal info. */ +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. */ + +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. */ + unsigned short int pr_uid; + unsigned short int pr_gid; + 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. */ + }; + +/* The rest of this file provides the types for emulation of the + Solaris interfaces that should be implemented by + users of libthread_db. */ + +/* Addresses. */ +typedef void *psaddr_t; + +/* Register sets. Linux has different names. */ +typedef elf_gregset_t prgregset_t; +typedef elf_fpregset_t prfpregset_t; + +/* We don't have any differences between processes and threads, + therefore have only one PID type. */ +typedef __pid_t lwpid_t; + +/* Process status and info. In the end we do provide typedefs for them. */ +typedef struct elf_prstatus prstatus_t; +typedef struct elf_prpsinfo prpsinfo_t; + +__END_DECLS + +#endif /* sys/procfs.h */ diff --git a/include/sys/ptrace.h b/include/sys/ptrace.h index 5b670668b..b4aec4f20 100644 --- a/include/sys/ptrace.h +++ b/include/sys/ptrace.h @@ -1,21 +1,21 @@ /* `ptrace' debugger support interface. Linux version. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 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. + 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. 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. + Lesser 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. */ + 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. */ #ifndef _SYS_PTRACE_H #define _SYS_PTRACE_H 1 @@ -98,9 +98,19 @@ enum __ptrace_request PTRACE_DETACH = 17, #define PT_DETACH PTRACE_DETACH + /* Get all extended floating point registers used by a processes. + This is not supported on all machines. */ + PTRACE_GETFPXREGS = 18, +#define PT_GETFPXREGS PTRACE_GETFPXREGS + + /* Set all extended floating point registers used by a processes. + This is not supported on all machines. */ + PTRACE_SETFPXREGS = 19, +#define PT_SETFPXREGS PTRACE_SETFPXREGS + /* Continue and stop at the next (return from) syscall. */ PTRACE_SYSCALL = 24 -#define PTRACE_SYSCALL PTRACE_SYSCALL +#define PT_SYSCALL PTRACE_SYSCALL }; /* Perform process tracing functions. REQUEST is one of the values @@ -112,7 +122,7 @@ enum __ptrace_request appear (those that are used for the particular request) as: pid_t PID, void *ADDR, int DATA, void *ADDR2 after REQUEST. */ -extern long int ptrace __P ((enum __ptrace_request __request, ...)); +extern long int ptrace (enum __ptrace_request __request, ...) __THROW; __END_DECLS diff --git a/include/sys/reboot.h b/include/sys/reboot.h index dd7a71b4c..2a719c7a3 100644 --- a/include/sys/reboot.h +++ b/include/sys/reboot.h @@ -1,20 +1,20 @@ -/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 1999 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. + 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. 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. + Lesser 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. */ + 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. */ /* This file should define RB_* macros to be used as flag bits in the argument to the `reboot' system call. */ @@ -42,7 +42,7 @@ __BEGIN_DECLS /* Reboot or halt the system. */ -extern int reboot __P ((int __howto)); +extern int reboot (int __howto) __THROW; __END_DECLS diff --git a/include/sys/resource.h b/include/sys/resource.h index 77a5f697a..e64a08672 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -2,25 +2,24 @@ 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. + 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. 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. + Lesser 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. */ + 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. */ #ifndef _SYS_RESOURCE_H #define _SYS_RESOURCE_H 1 #include -#include /* Get the system-dependent definitions of structures and bit values. */ #include @@ -50,11 +49,11 @@ typedef int __priority_which_t; Returns 0 if successful, -1 if not (and sets errno). */ #ifndef __USE_FILE_OFFSET64 extern int getrlimit (__rlimit_resource_t __resource, - struct rlimit *__rlimits); + struct rlimit *__rlimits) __THROW; #else # ifdef __REDIRECT extern int __REDIRECT (getrlimit, (__rlimit_resource_t __resource, - struct rlimit *__rlimits) , + struct rlimit *__rlimits) __THROW, getrlimit64); # else # define getrlimit getrlimit64 @@ -62,7 +61,7 @@ extern int __REDIRECT (getrlimit, (__rlimit_resource_t __resource, #endif #ifdef __USE_LARGEFILE64 extern int getrlimit64 (__rlimit_resource_t __resource, - struct rlimit64 *__rlimits); + struct rlimit64 *__rlimits) __THROW; #endif /* Set the soft and hard limits for RESOURCE to *RLIMITS. @@ -70,11 +69,11 @@ extern int getrlimit64 (__rlimit_resource_t __resource, Return 0 if successful, -1 if not (and sets errno). */ #ifndef __USE_FILE_OFFSET64 extern int setrlimit (__rlimit_resource_t __resource, - __const struct rlimit *__rlimits); + __const struct rlimit *__rlimits) __THROW; #else # ifdef __REDIRECT extern int __REDIRECT (setrlimit, (__rlimit_resource_t __resource, - __const struct rlimit *__rlimits) , + __const struct rlimit *__rlimits) __THROW, setrlimit64); # else # define setrlimit setrlimit64 @@ -82,22 +81,23 @@ extern int __REDIRECT (setrlimit, (__rlimit_resource_t __resource, #endif #ifdef __USE_LARGEFILE64 extern int setrlimit64 (__rlimit_resource_t __resource, - __const struct rlimit64 *__rlimits); + __const struct rlimit64 *__rlimits) __THROW; #endif /* Return resource usage information on process indicated by WHO and put it in *USAGE. Returns 0 for success, -1 for failure. */ -extern int getrusage (__rusage_who_t __who, struct rusage *__usage); +extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW; /* Return the highest priority of any process specified by WHICH and WHO (see above); if WHO is zero, the current process, process group, or user (as specified by WHO) is used. A lower priority number means higher priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */ -extern int getpriority (__priority_which_t __which, id_t __who); +extern int getpriority (__priority_which_t __which, id_t __who) __THROW; /* Set the priority of all processes specified by WHICH and WHO (see above) to PRIO. Returns 0 on success, -1 on errors. */ -extern int setpriority (__priority_which_t __which, id_t __who, int __prio); +extern int setpriority (__priority_which_t __which, id_t __who, int __prio) + __THROW; __END_DECLS diff --git a/include/sys/select.h b/include/sys/select.h index 0972560b9..8f03c73e9 100644 --- a/include/sys/select.h +++ b/include/sys/select.h @@ -1,21 +1,21 @@ /* `fd_set' type and related macros, and `select'/`pselect' declarations. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996,1997,1998,1999,2000,2001 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. + 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. 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. + Lesser 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. */ + 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. */ /* POSIX 1003.1g: 6.2 Select from File Descriptor Sets */ @@ -33,61 +33,80 @@ /* Get __sigset_t. */ #include +#ifndef __sigset_t_defined +# define __sigset_t_defined +typedef __sigset_t sigset_t; +#endif + /* Get definition of timer specification structures. */ #define __need_timespec #include - -__BEGIN_DECLS - -/* This declaration puts `struct timeval' in global scope even if - has not been included to define it. That way the - `select' prototype below will not conflict with a later definition - of `struct timeval'. */ -struct timeval; - -typedef __fd_mask fd_mask; - -/* Representation of a set of file descriptors. */ -typedef __fd_set fd_set; +#define __need_timeval +#include + + +/* The fd_set member is required to be an array of longs. */ +typedef long int __fd_mask; + +/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */ +#define __NFDBITS (8 * sizeof (__fd_mask)) +#define __FDELT(d) ((d) / __NFDBITS) +#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS)) + +/* fd_set for select and pselect. */ +typedef struct + { + /* XPG4.2 requires this member name. Otherwise avoid the name + from the global namespace. */ +#ifdef __USE_XOPEN + __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS]; +# define __FDS_BITS(set) ((set)->fds_bits) +#else + __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS]; +# define __FDS_BITS(set) ((set)->__fds_bits) +#endif + } fd_set; /* Maximum number of file descriptors in `fd_set'. */ #define FD_SETSIZE __FD_SETSIZE #ifdef __USE_MISC +/* Sometimes the fd_set member is assumed to have this type. */ +typedef __fd_mask fd_mask; + /* Number of bits per word of `fd_set' (some code assumes this is 32). */ # define NFDBITS __NFDBITS #endif /* Access macros for `fd_set'. */ -#define FD_SET(fd, fdsetp) __FD_SET ((fd), (fdsetp)) -#define FD_CLR(fd, fdsetp) __FD_CLR ((fd), (fdsetp)) -#define FD_ISSET(fd, fdsetp) __F