summaryrefslogtreecommitdiff
path: root/include/sys
diff options
context:
space:
mode:
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/bitypes.h4
-rw-r--r--include/sys/cdefs.h222
-rw-r--r--include/sys/dir.h16
-rw-r--r--include/sys/file.h55
-rw-r--r--include/sys/io.h39
-rw-r--r--include/sys/ioctl.h20
-rw-r--r--include/sys/ipc.h44
-rw-r--r--include/sys/kd.h16
-rw-r--r--include/sys/kdaemon.h20
-rw-r--r--include/sys/klog.h20
-rw-r--r--include/sys/mman.h140
-rw-r--r--include/sys/mount.h32
-rw-r--r--include/sys/msg.h24
-rw-r--r--include/sys/mtio.h16
-rw-r--r--include/sys/param.h75
-rw-r--r--include/sys/poll.h29
-rw-r--r--include/sys/procfs.h123
-rw-r--r--include/sys/ptrace.h32
-rw-r--r--include/sys/reboot.h20
-rw-r--r--include/sys/resource.h36
-rw-r--r--include/sys/select.h97
-rw-r--r--include/sys/sem.h30
-rw-r--r--include/sys/shm.h49
-rw-r--r--include/sys/socket.h58
-rw-r--r--include/sys/socketcall.h22
-rw-r--r--include/sys/stat.h214
-rw-r--r--include/sys/statfs.h33
-rw-r--r--include/sys/swap.h22
-rw-r--r--include/sys/sysinfo.h41
-rw-r--r--include/sys/syslog.h21
-rw-r--r--include/sys/sysmacros.h16
-rw-r--r--include/sys/time.h96
-rw-r--r--include/sys/timeb.h15
-rw-r--r--include/sys/times.h54
-rw-r--r--include/sys/timex.h24
-rw-r--r--include/sys/ttydefaults.h4
-rw-r--r--include/sys/types.h111
-rw-r--r--include/sys/ucontext.h94
-rw-r--r--include/sys/uio.h26
-rw-r--r--include/sys/un.h26
-rw-r--r--include/sys/user.h107
-rw-r--r--include/sys/utsname.h82
-rw-r--r--include/sys/vm86.h125
-rw-r--r--include/sys/wait.h97
44 files changed, 1535 insertions, 912 deletions
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 <stddef.h>
+/* The GNU <sys/types.h> defines all the necessary types. */
+
+#include <sys/types.h>
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 <features.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.
-#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 <features.h>
+#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 <features.h>
-#include <fcntl.h>
-#ifndef L_SET
+#ifndef _FCNTL_H
+# include <fcntl.h>
+#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 <bits/io_i386.h>
#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 <features.h>
+#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 <bits/ipc.h>
-#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 <features.h>
#include <bits/types.h>
#define __need_size_t
#include <stddef.h>
-#include <bits/mman.h>
-#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 <bits/mman.h>
+
+/* 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 <hennus@cybercomm.nl>. */
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 <rdebath@cix.compulink.co.uk>
- * 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 <features.h>
#include <limits.h>
#include <linux/limits.h>
-#include <asm/param.h>
-
-#include <sys/types.h>
+#include <linux/param.h>
-#define MAXPATHLEN PATH_MAX
+/* BSD names for some <limits.h> 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 <sys/types.h>
/* 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 <bits/poll.h>
-__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 <features.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/user.h>
+
+__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 <proc_service.h> 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 <features.h>
-#include <sys/types.h>
/* Get the system-dependent definitions of structures and bit values. */
#include <bits/resource.h>
@@ -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 <sys/select.h> */
@@ -33,61 +33,80 @@
/* Get __sigset_t. */
#include <bits/sigset.h>
+#ifndef __sigset_t_defined
+# define __sigset_t_defined
+typedef __sigset_t sigset_t;
+#endif
+
/* Get definition of timer specification structures. */
#define __need_timespec
#include <time.h>
-
-__BEGIN_DECLS
-
-/* This declaration puts `struct timeval' in global scope even if
- <sys/time.h> 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 <bits/time.h>
+
+
+/* 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) __FD_ISSET ((fd), (fdsetp))
+#define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp)
+#define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp)
+#define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp)
#define FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
+__BEGIN_DECLS
+
/* Check the first NFDS descriptors each in READFDS (if not NULL) for read
readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS
(if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out
after waiting the interval specified therein. Returns the number of ready
descriptors, or -1 for errors. */
-extern int __select __P ((int __nfds, __fd_set *__readfds,
- __fd_set *__writefds, __fd_set *__exceptfds,
- struct timeval *__timeout));
-extern int select __P ((int __nfds, __fd_set *__readfds,
- __fd_set *__writefds, __fd_set *__exceptfds,
- struct timeval *__timeout));
-
-#ifdef __USE_GNU
-/* XXX Once/if POSIX.1g gets official this prototype will be available
- when defining __USE_POSIX. */
+extern int select (int __nfds, fd_set *__restrict __readfds,
+ fd_set *__restrict __writefds,
+ fd_set *__restrict __exceptfds,
+ struct timeval *__restrict __timeout) __THROW;
+
+#ifdef __USE_XOPEN2K
/* Same as above only that the TIMEOUT value is given with higher
resolution and a sigmask which is been set temporarily. This version
should be used. */
-extern int pselect __P ((int __nfds, __fd_set *__readfds,
- __fd_set *__writefds, __fd_set *__exceptfds,
- const struct timespec *__timeout,
- const __sigset_t *__sigmask));
+extern int pselect (int __nfds, fd_set *__restrict __readfds,
+ fd_set *__restrict __writefds,
+ fd_set *__restrict __exceptfds,
+ const struct timespec *__restrict __timeout,
+ const __sigset_t *__restrict __sigmask) __THROW;
#endif
__END_DECLS
diff --git a/include/sys/sem.h b/include/sys/sem.h
index 6ae76e234..5b1d38f52 100644
--- a/include/sys/sem.h
+++ b/include/sys/sem.h
@@ -1,27 +1,28 @@
-/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1995-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_SEM_H
#define _SYS_SEM_H 1
#include <features.h>
-#include <sys/types.h>
+#define __need_size_t
+#include <stddef.h>
/* Get common definition of System V style IPC. */
#include <sys/ipc.h>
@@ -35,7 +36,7 @@
/* Structure used for argument to `semop' to describe operations. */
struct sembuf
{
- short int sem_num; /* semaphore number */
+ unsigned short int sem_num; /* semaphore number */
short int sem_op; /* semaphore operation */
short int sem_flg; /* operation flag */
};
@@ -44,14 +45,13 @@ struct sembuf
__BEGIN_DECLS
/* Semaphore control operation. */
-extern int semctl __P ((int __semid, int __semnum, int __cmd, ...));
+extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW;
/* Get semaphore. */
-extern int semget __P ((key_t __key, int __nsems, int __semflg));
+extern int semget (key_t __key, int __nsems, int __semflg) __THROW;
/* Operate on semaphore. */
-extern int semop __P ((int __semid, struct sembuf *__sops,
- unsigned int __nsops));
+extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW;
__END_DECLS
diff --git a/include/sys/shm.h b/include/sys/shm.h
index 09e21d60e..1ef669ba4 100644
--- a/include/sys/shm.h
+++ b/include/sys/shm.h
@@ -1,28 +1,28 @@
-/* Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1995-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_SHM_H
#define _SYS_SHM_H 1
#include <features.h>
-#include <unistd.h> /* for `getpagesize' declaration */
-#include <sys/types.h>
+#define __need_size_t
+#include <stddef.h>
/* Get common definition of System V style IPC. */
#include <sys/ipc.h>
@@ -30,26 +30,39 @@
/* Get system dependent definition of `struct shmid_ds' and more. */
#include <bits/shm.h>
+/* Define types required by the standard. */
+#define __need_time_t
+#include <time.h>
+
+#ifdef __USE_XOPEN
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+# define __pid_t_defined
+# endif
+#endif /* X/Open */
+
+__BEGIN_DECLS
/* Segment low boundary address multiple. */
-#define SHMLBA (getpagesize ())
+#define SHMLBA (__getpagesize ())
+extern int __getpagesize (void) __THROW __attribute__ ((__const__));
+
/* The following System V style IPC functions implement a shared memory
facility. The definition is found in XPG4.2. */
-__BEGIN_DECLS
-
/* Shared memory control operation. */
-extern int shmctl __P ((int __shmid, int __cmd, struct shmid_ds *__buf));
+extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW;
/* Get shared memory segment. */
-extern int shmget __P ((key_t __key, size_t __size, int __shmflg));
+extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW;
/* Attach shared memory segment. */
-extern void *shmat __P ((int __shmid, __const void *__shmaddr, int __shmflg));
+extern void *shmat (int __shmid, __const void *__shmaddr, int __shmflg)
+ __THROW;
/* Detach shared memory segment. */
-extern int shmdt __P ((__const void *__shmaddr));
+extern int shmdt (__const void *__shmaddr) __THROW;
__END_DECLS
diff --git a/include/sys/socket.h b/include/sys/socket.h
index dccf0e3f0..b57b63349 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.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. */
#ifndef _SYS_SOCKET_H
#define _SYS_SOCKET_H 1
@@ -97,50 +97,50 @@ typedef union { __SOCKADDR_ALLTYPES
/* Create a new socket of type TYPE in domain DOMAIN, using
protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically.
Returns a file descriptor for the new socket, or -1 for errors. */
-extern int socket (int __domain, int __type, int __protocol) ;
+extern int socket (int __domain, int __type, int __protocol) __THROW;
/* Create two new sockets, of type TYPE in domain DOMAIN and using
protocol PROTOCOL, which are connected to each other, and put file
descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero,
one will be chosen automatically. Returns 0 on success, -1 for errors. */
extern int socketpair (int __domain, int __type, int __protocol,
- int __fds[2]) ;
+ int __fds[2]) __THROW;
/* Give the socket FD the local address ADDR (which is LEN bytes long). */
extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len)
- ;
+ __THROW;
/* Put the local address of FD into *ADDR and its length in *LEN. */
extern int getsockname (int __fd, __SOCKADDR_ARG __addr,
- socklen_t *__restrict __len) ;
+ socklen_t *__restrict __len) __THROW;
/* Open a connection on socket FD to peer at ADDR (which LEN bytes long).
For connectionless socket types, just set the default address to send to
and the only address from which to accept transmissions.
Return 0 on success, -1 for errors. */
extern int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len)
- ;
+ __THROW;
/* Put the address of the peer connected to socket FD into *ADDR
(which is *LEN bytes long), and its actual length into *LEN. */
extern int getpeername (int __fd, __SOCKADDR_ARG __addr,
- socklen_t *__restrict __len) ;
+ socklen_t *__restrict __len) __THROW;
/* Send N bytes of BUF to socket FD. Returns the number sent or -1. */
extern ssize_t send (int __fd, __const void *__buf, size_t __n, int __flags)
- ;
+ __THROW;
/* Read N bytes into BUF from socket FD.
Returns the number read or -1 for errors. */
extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags)
- ;
+ __THROW;
/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
ADDR_LEN bytes long). Returns the number sent, or -1 for errors. */
extern ssize_t sendto (int __fd, __const void *__buf, size_t __n,
int __flags, __CONST_SOCKADDR_ARG __addr,
- socklen_t __addr_len) ;
+ socklen_t __addr_len) __THROW;
/* Read N bytes into BUF through socket FD.
If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of
@@ -148,18 +148,18 @@ extern ssize_t sendto (int __fd, __const void *__buf, size_t __n,
Returns the number of bytes read or -1 for errors. */
extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags,
__SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len)
- ;
+ __THROW;
/* Send a message described MESSAGE on socket FD.
Returns the number of bytes sent, or -1 for errors. */
extern ssize_t sendmsg (int __fd, __const struct msghdr *__message, int __flags)
- ;
+ __THROW;
/* Receive a message as described by MESSAGE from socket FD.
Returns the number of bytes read or -1 for errors. */
extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags)
- ;
+ __THROW;
/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL
@@ -167,19 +167,19 @@ extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags)
actual length. Returns 0 on success, -1 for errors. */
extern int getsockopt (int __fd, int __level, int __optname,
void *__restrict __optval,
- socklen_t *__restrict __optlen) ;
+ socklen_t *__restrict __optlen) __THROW;
/* Set socket FD's option OPTNAME at protocol level LEVEL
to *OPTVAL (which is OPTLEN bytes long).
Returns 0 on success, -1 for errors. */
extern int setsockopt (int __fd, int __level, int __optname,
- __const void *__optval, socklen_t __optlen) ;
+ __const void *__optval, socklen_t __optlen) __THROW;
/* Prepare to accept connections on socket FD.
N connection requests will be queued before further requests are refused.
Returns 0 on success, -1 for errors. */
-extern int listen (int __fd, int __n) ;
+extern int listen (int __fd, int __n) __THROW;
/* Await a connection on socket FD.
When a connection arrives, open a new socket to communicate with it,
@@ -188,7 +188,7 @@ extern int listen (int __fd, int __n) ;
new socket's descriptor, or -1 for errors. */
extern int accept (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len)
- ;
+ __THROW;
/* Shut down all or part of the connection open on socket FD.
HOW determines what to shut down:
@@ -196,14 +196,20 @@ extern int accept (int __fd, __SOCKADDR_ARG __addr,
SHUT_WR = No more transmissions;
SHUT_RDWR = No more receptions or transmissions.
Returns 0 on success, -1 for errors. */
-extern int shutdown (int __fd, int __how) ;
+extern int shutdown (int __fd, int __how) __THROW;
+
+
+#ifdef __USE_XOPEN2K
+/* Determine wheter socket is at a out-of-band mark. */
+extern int sockatmark (int __fd) __THROW;
+#endif
#ifdef __USE_MISC
/* FDTYPE is S_IFSOCK or another S_IF* macro defined in <sys/stat.h>;
returns 1 if FD is open on an object of the indicated type, 0 if not,
or -1 for errors (setting errno). */
-extern int isfdtype (int __fd, int __fdtype) ;
+extern int isfdtype (int __fd, int __fdtype) __THROW;
#endif
__END_DECLS
diff --git a/include/sys/socketcall.h b/include/sys/socketcall.h
deleted file mode 100644
index 2538c672c..000000000
--- a/include/sys/socketcall.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _SYS_SOCKETCALL_H
-#define _SYS_SOCKETCALL_H
-
-#define SYS_SOCKET 1
-#define SYS_BIND 2
-#define SYS_CONNECT 3
-#define SYS_LISTEN 4
-#define SYS_ACCEPT 5
-#define SYS_GETSOCKNAME 6
-#define SYS_GETPEERNAME 7
-#define SYS_SOCKETPAIR 8
-#define SYS_SEND 9
-#define SYS_RECV 10
-#define SYS_SENDTO 11
-#define SYS_RECVFROM 12
-#define SYS_SHUTDOWN 13
-#define SYS_SETSOCKOPT 14
-#define SYS_GETSOCKOPT 15
-#define SYS_SENDMSG 16
-#define SYS_RECVMSG 17
-
-#endif /* _SYS_SOCKETCALL_H */
diff --git a/include/sys/stat.h b/include/sys/stat.h
index b4e1620df..a2a669277 100644
--- a/include/sys/stat.h
+++ b/include/sys/stat.h
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 92, 95, 96, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 1995-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 Standard: 5.6 File Characteristics <sys/stat.h>
@@ -33,54 +33,63 @@
/* The Single Unix specification says that some more types are
available here. */
-# ifndef dev_t
+# ifndef __dev_t_defined
typedef __dev_t dev_t;
-# define dev_t dev_t
+# define __dev_t_defined
# endif
-# ifndef gid_t
+# ifndef __gid_t_defined
typedef __gid_t gid_t;
-# define gid_t gid_t
+# define __gid_t_defined
# endif
-# ifndef ino_t
+# ifndef __ino_t_defined
# ifndef __USE_FILE_OFFSET64
typedef __ino_t ino_t;
# else
typedef __ino64_t ino_t;
# endif
-# define ino_t ino_t
+# define __ino_t_defined
# endif
-# ifndef mode_t
+# ifndef __mode_t_defined
typedef __mode_t mode_t;
-# define mode_t mode_t
+# define __mode_t_defined
# endif
-# ifndef nlink_t
+# ifndef __nlink_t_defined
typedef __nlink_t nlink_t;
-# define nlink_t nlink_t
+# define __nlink_t_defined
# endif
-# ifndef off_t
+# ifndef __off_t_defined
# ifndef __USE_FILE_OFFSET64
typedef __off_t off_t;
# else
typedef __off64_t off_t;
# endif
-# define off_t off_t
+# define __off_t_defined
# endif
-# ifndef uid_t
+# ifndef __uid_t_defined
typedef __uid_t uid_t;
-# define uid_t uid_t
+# define __uid_t_defined
# endif
#endif /* X/Open */
#ifdef __USE_UNIX98
-# ifndef pid_t
-typedef __pid_t pid_t;
-# define pid_t pid_t
+# ifndef __blkcnt_t_defined
+# ifndef __USE_FILE_OFFSET64
+typedef __blkcnt_t blkcnt_t;
+# else
+typedef __blkcnt64_t blkcnt_t;
+# endif
+# define __blkcnt_t_defined
+# endif
+
+# ifndef __blksize_t_defined
+typedef __blksize_t blksize_t;
+# define __blksize_t_defined
# endif
#endif /* Unix98 */
@@ -97,13 +106,12 @@ __BEGIN_DECLS
# ifdef __S_IFIFO
# define S_IFIFO __S_IFIFO
# endif
-# if defined __USE_BSD || defined __USE_MISC
-# ifdef __S_IFLNK
-# define S_IFLNK __S_IFLNK
-# endif
-# ifdef __S_IFSOCK
-# define S_IFSOCK __S_IFSOCK
-# endif
+# ifdef __S_IFLNK
+# define S_IFLNK __S_IFLNK
+# endif
+# if (defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN2K) \
+ && defined __S_IFSOCK
+# define S_IFSOCK __S_IFSOCK
# endif
#endif
@@ -118,11 +126,12 @@ __BEGIN_DECLS
#ifdef __S_IFIFO
# define S_ISFIFO(mode) __S_ISTYPE((mode), __S_IFIFO)
#endif
+#ifdef __S_IFLNK
+# define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK)
+#endif
#ifdef __USE_BSD
-# ifdef __S_IFLNK
-# define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK)
-# else
+# ifndef __S_IFLNK
# define S_ISLNK(mode) 0
# endif
# ifdef __S_IFSOCK
@@ -130,13 +139,23 @@ __BEGIN_DECLS
# endif
#endif
+/* These are from POSIX.1b. If the objects are not implemented using separate
+ distinct file types, the macros always will evaluate to zero. Unlike the
+ other S_* macros the following three take a pointer to a `struct stat'
+ object as the argument. */
+#ifdef __USE_POSIX199309
+# define S_TYPEISMQ(buf) __S_TYPEISMQ(buf)
+# define S_TYPEISSEM(buf) __S_TYPEISSEM(buf)
+# define S_TYPEISSHM(buf) __S_TYPEISSHM(buf)
+#endif
+
/* Protection bits. */
#define S_ISUID __S_ISUID /* Set user ID on execution. */
#define S_ISGID __S_ISGID /* Set group ID on execution. */
-#if defined __USE_BSD || defined __USE_MISC
+#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
/* Save swapped text after use (sticky bit). This is pretty well obsolete. */
# define S_ISVTX __S_ISVTX
#endif
@@ -178,79 +197,87 @@ __BEGIN_DECLS
#ifndef __USE_FILE_OFFSET64
/* Get file attributes for FILE and put them in BUF. */
-extern int stat __P ((__const char *__file, struct stat *__buf));
+extern int stat (__const char *__restrict __file,
+ struct stat *__restrict __buf) __THROW;
/* Get file attributes for the file, device, pipe, or socket
that file descriptor FD is open on and put them in BUF. */
-extern int fstat __P ((int __fd, struct stat *__buf));
+extern int fstat (int __fd, struct stat *__buf) __THROW;
#else
# ifdef __REDIRECT
-extern int __REDIRECT (stat, __P ((__const char *__file, struct stat *__buf)),
+extern int __REDIRECT (stat,
+ (__const char *__restrict __file,
+ struct stat *__restrict __buf) __THROW,
stat64);
-extern int __REDIRECT (fstat, __P ((int __fd, struct stat *__buf)), fstat64);
+extern int __REDIRECT (fstat, (int __fd, struct stat *__buf) __THROW, fstat64);
# else
# define stat stat64
# define fstat fstat64
# endif
#endif
#ifdef __USE_LARGEFILE64
-extern int stat64 __P ((__const char *__file, struct stat64 *__buf));
-extern int fstat64 __P ((int __fd, struct stat64 *__buf));
+extern int stat64 (__const char *__restrict __file,
+ struct stat64 *__restrict __buf) __THROW;
+extern int fstat64 (int __fd, struct stat64 *__buf) __THROW;
#endif
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
# ifndef __USE_FILE_OFFSET64
/* Get file attributes about FILE and put them in BUF.
If FILE is a symbolic link, do not follow it. */
-extern int lstat __P ((__const char *__file, struct stat *__buf));
+extern int lstat (__const char *__restrict __file,
+ struct stat *__restrict __buf) __THROW;
# else
# ifdef __REDIRECT
-extern int __REDIRECT (lstat, __P ((__const char *__file, struct stat *__buf)),
+extern int __REDIRECT (lstat,
+ (__const char *__restrict __file,
+ struct stat *__restrict __buf) __THROW,
lstat64);
# else
# define lstat lstat64
# endif
# endif
# ifdef __USE_LARGEFILE64
-extern int lstat64 __P ((__const char *__file, struct stat64 *__buf));
+extern int lstat64 (__const char *__restrict __file,
+ struct stat64 *__restrict __buf) __THROW;
# endif
#endif
/* Set file access permissions for FILE to MODE.
This takes an `int' MODE argument because that
is what `mode_t's get widened to. */
-extern int chmod __P ((__const char *__file, __mode_t __mode));
+extern int chmod (__const char *__file, __mode_t __mode) __THROW;
/* Set file access permissions of the file FD is open on to MODE. */
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-extern int fchmod __P ((int __fd, __mode_t __mode));
+extern int fchmod (int __fd, __mode_t __mode) __THROW;
#endif
/* Set the file creation mask of the current process to MASK,
and return the old creation mask. */
-extern __mode_t umask __P ((__mode_t __mask));
+extern __mode_t umask (__mode_t __mask) __THROW;
#ifdef __USE_GNU
/* Get the current `umask' value without changing it.
This function is only available under the GNU Hurd. */
-extern __mode_t getumask __P ((void));
+extern __mode_t getumask (void) __THROW;
#endif
/* Create a new directory named PATH, with permission bits MODE. */
-extern int mkdir __P ((__const char *__path, __mode_t __mode));
+extern int mkdir (__const char *__path, __mode_t __mode) __THROW;
/* Create a device file named PATH, with permission and special bits MODE
and device number DEV (which can be constructed from major and minor
device numbers with the `makedev' macro above). */
#if defined __USE_MISC || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-extern int mknod __P ((__const char *__path,
- __mode_t __mode, __dev_t __dev));
+extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
+ __THROW;
#endif
/* Create a new FIFO named PATH, with permission bits MODE. */
-extern int mkfifo __P ((__const char *__path, __mode_t __mode));
+extern int mkfifo (__const char *__path, __mode_t __mode) __THROW;
/* To allow the `struct stat' structure and the file type `mode_t'
bits to vary without changing shared library major version number,
@@ -276,87 +303,90 @@ extern int mkfifo __P ((__const char *__path, __mode_t __mode));
/* Wrappers for stat and mknod system calls. */
#ifndef __USE_FILE_OFFSET64
-extern int _fxstat __P ((int __ver, int __fildes,
- struct stat *__stat_buf));
-extern int _xstat __P ((int __ver, __const char *__filename,
- struct stat *__stat_buf));
-extern int _lxstat __P ((int __ver, __const char *__filename,
- struct stat *__stat_buf));
+extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) __THROW;
+extern int __xstat (int __ver, __const char *__filename,
+ struct stat *__stat_buf) __THROW;
+extern int __lxstat (int __ver, __const char *__filename,
+ struct stat *__stat_buf) __THROW;
#else
# ifdef __REDIRECT
-extern int __REDIRECT (_fxstat, __P ((int __ver, int __fildes,
- struct stat *__stat_buf)), _fxstat64);
-extern int __REDIRECT (_xstat, __P ((int __ver, __const char *__filename,
- struct stat *__stat_buf)), _xstat64);
-extern int __REDIRECT (_lxstat, __P ((int __ver, __const char *__filename,
- struct stat *__stat_buf)), _lxstat64);
+extern int __REDIRECT (__fxstat, (int __ver, int __fildes,
+ struct stat *__stat_buf) __THROW,
+ __fxstat64);
+extern int __REDIRECT (__xstat, (int __ver, __const char *__filename,
+ struct stat *__stat_buf) __THROW, __xstat64);
+extern int __REDIRECT (__lxstat, (int __ver, __const char *__filename,
+ struct stat *__stat_buf) __THROW,
+ __lxstat64);
# else
-# define _fxstat _fxstat64
-# define _xstat _xstat64
-# define _lxstat _lxstat64
+# define __fxstat __fxstat64
+# define __xstat __xstat64
+# define __lxstat __lxstat64
# endif
#endif
#ifdef __USE_LARGEFILE64
-extern int _fxstat64 __P ((int __ver, int __fildes,
- struct stat64 *__stat_buf));
-extern int _xstat64 __P ((int __ver, __const char *__filename,
- struct stat64 *__stat_buf));
-extern int _lxstat64 __P ((int __ver, __const char *__filename,
- struct stat64 *__stat_buf));
+extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
+ __THROW;
+extern int __xstat64 (int __ver, __const char *__filename,
+ struct stat64 *__stat_buf) __THROW;
+extern int __lxstat64 (int __ver, __const char *__filename,
+ struct stat64 *__stat_buf) __THROW;
#endif
-extern int _xmknod __P ((int __ver, __const char *__path,
- __mode_t __mode, __dev_t *__dev));
+extern int __xmknod (int __ver, __const char *__path, __mode_t __mode,
+ __dev_t *__dev) __THROW;
#if defined __GNUC__ && __GNUC__ >= 2
/* Inlined versions of the real stat and mknod functions. */
extern __inline__ int stat (__const char *__path,
- struct stat *__statbuf)
+ struct stat *__statbuf) __THROW
{
- return _xstat (_STAT_VER, __path, __statbuf);
+ return __xstat (_STAT_VER, __path, __statbuf);
}
# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
extern __inline__ int lstat (__const char *__path,
- struct stat *__statbuf)
+ struct stat *__statbuf) __THROW
{
- return _lxstat (_STAT_VER, __path, __statbuf);
+ return __lxstat (_STAT_VER, __path, __statbuf);
}
# endif
-extern __inline__ int fstat (int __fd, struct stat *__statbuf)
+extern __inline__ int fstat (int __fd, struct stat *__statbuf) __THROW
{
- return _fxstat (_STAT_VER, __fd, __statbuf);
+ return __fxstat (_STAT_VER, __fd, __statbuf);
}
# if defined __USE_MISC || defined __USE_BSD
extern __inline__ int mknod (__const char *__path, __mode_t __mode,
- __dev_t __dev)
+ __dev_t __dev) __THROW
{
- return _xmknod (_MKNOD_VER, __path, __mode, &__dev);
+ return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
}
# endif
-# ifdef __USE_LARGEFILE64
+# if defined __USE_LARGEFILE64 \
+ && (! defined __USE_FILE_OFFSET64 \
+ || (defined __REDIRECT && defined __OPTIMIZE__))
extern __inline__ int stat64 (__const char *__path,
- struct stat64 *__statbuf)
+ struct stat64 *__statbuf) __THROW
{
- return _xstat64 (_STAT_VER, __path, __statbuf);
+ return __xstat64 (_STAT_VER, __path, __statbuf);
}
# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
extern __inline__ int lstat64 (__const char *__path,
- struct stat64 *__statbuf)
+ struct stat64 *__statbuf) __THROW
{
- return _lxstat64 (_STAT_VER, __path, __statbuf);
+ return __lxstat64 (_STAT_VER, __path, __statbuf);
}
# endif
-extern __inline__ int fstat64 (int __fd, struct stat64 *__statbuf)
+extern __inline__ int fstat64 (int __fd, struct stat64 *__statbuf) __THROW
{
- return _fxstat64 (_STAT_VER, __fd, __statbuf);
+ return __fxstat64 (_STAT_VER, __fd, __statbuf);
}
# endif
diff --git a/include/sys/statfs.h b/include/sys/statfs.h
index be93bc923..969d9d0e5 100644
--- a/include/sys/statfs.h
+++ b/include/sys/statfs.h
@@ -1,21 +1,21 @@
/* Definitions for getting information about a filesystem.
- 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. */
#ifndef _SYS_STATFS_H
#define _SYS_STATFS_H 1
@@ -29,33 +29,34 @@ __BEGIN_DECLS
/* Return information about the filesystem on which FILE resides. */
#ifndef __USE_FILE_OFFSET64
-extern int statfs __P ((__const char *__file, struct statfs *__buf));
+extern int statfs (__const char *__file, struct statfs *__buf) __THROW;
#else
# ifdef __REDIRECT
-extern int __REDIRECT (statfs, __P ((__const char *__file,
- struct statfs *__buf)), statfs64);
+extern int __REDIRECT (statfs,
+ (__const char *__file, struct statfs *__buf) __THROW,
+ statfs64);
# else
# define statfs statfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
-extern int statfs64 __P ((__const char *__file, struct statfs64 *__buf));
+extern int statfs64 (__const char *__file, struct statfs64 *__buf) __THROW;
#endif
/* Return information about the filesystem containing the file FILDES
refers to. */
#ifndef __USE_FILE_OFFSET64
-extern int fstatfs __P ((int __fildes, struct statfs *__buf));
+extern int fstatfs (int __fildes, struct statfs *__buf) __THROW;
#else
# ifdef __REDIRECT
-extern int __REDIRECT (fstatfs, __P ((int __fildes, struct statfs *__buf)),
+extern int __REDIRECT (fstatfs, (int __fildes, struct statfs *__buf) __THROW,
fstatfs64);
# else
# define fstatfs fstatfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
-extern int fstatfs64 __P ((int __fildes, struct statfs64 *__buf));
+extern int fstatfs64 (int __fildes, struct statfs64 *__buf) __THROW;
#endif
__END_DECLS
diff --git a/include/sys/swap.h b/include/sys/swap.h
index e84c36520..b6e7bef5d 100644
--- a/include/sys/swap.h
+++ b/include/sys/swap.h
@@ -1,21 +1,21 @@
/* Calls to enable and disable swapping on specified locations. Linux version.
- 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_SWAP_H
@@ -33,10 +33,10 @@ __BEGIN_DECLS
/* Make the block special device PATH available to the system for swapping.
This call is restricted to the super-user. */
-extern int swapon __P ((__const char *__path, int __flags));
+extern int swapon (__const char *__path, int __flags) __THROW;
/* Stop using block special device PATH for swapping. */
-extern int swapoff __P ((__const char *__path));
+extern int swapoff (__const char *__path) __THROW;
__END_DECLS
diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h
index ebdb7715f..a6727b21e 100644
--- a/include/sys/sysinfo.h
+++ b/include/sys/sysinfo.h
@@ -1,15 +1,48 @@
+/* Copyright (C) 1996, 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_SYSINFO_H
-#define _SYS_SYSINFO_H
+#define _SYS_SYSINFO_H 1
#include <features.h>
+/* Get sysinfo structure from kernel header. */
#include <linux/kernel.h>
__BEGIN_DECLS
-extern int sysinfo __P((struct sysinfo *__info));
-extern int __sysinfo __P((struct sysinfo *__info));
+/* Returns information on overall system statistics. */
+extern int sysinfo (struct sysinfo *__info) __THROW;
+
+
+/* Return number of configured processors. */
+extern int get_nprocs_conf (void) __THROW;
+
+/* Return number of available processors. */
+extern int get_nprocs (void) __THROW;
+
+
+/* Return number of physical pages of memory in the system. */
+extern long int get_phys_pages (void) __THROW;
+
+/* Return number of available physical pages of memory in the system. */
+extern long int get_avphys_pages (void) __THROW;
__END_DECLS
-#endif
+#endif /* sys/sysinfo.h */
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index ffdb39bc1..940ee2dec 100644
--- a/include/sys/syslog.h
+++ b/include/sys/syslog.h
@@ -10,10 +10,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
@@ -37,7 +33,7 @@
#define _SYS_SYSLOG_H 1
#include <features.h>
-// #define __need___va_list
+#define __need___va_list
#include <stdarg.h>
@@ -173,22 +169,23 @@ CODE facilitynames[] =
__BEGIN_DECLS
/* Close desriptor used to write to system logger. */
-extern void closelog __P ((void));
+extern void closelog (void) __THROW;
/* Open connection to system logger. */
-extern void openlog __P ((__const char *__ident, int __option,
- int __facility));
+extern void openlog (__const char *__ident, int __option, int __facility)
+ __THROW;
/* Set the log mask level. */
-extern int setlogmask __P ((int __mask));
+extern int setlogmask (int __mask) __THROW;
/* Generate a log message using FMT string and option arguments. */
-extern void syslog __P ((int __pri, __const char *__fmt, ...));
+extern void syslog (int __pri, __const char *__fmt, ...) __THROW
+ __attribute__ ((__format__(__printf__, 2, 3)));
#ifdef __USE_BSD
/* Generate a log message using FMT and using arguments pointed to by AP. */
-extern void vsyslog __P ((int __pri, __const char *__fmt,
- va_list __ap));
+extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
+ __THROW __attribute__ ((__format__(__printf__, 2, 0)));
#endif
__END_DECLS
diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h
index 35760e5e0..e482aab17 100644
--- a/include/sys/sysmacros.h
+++ b/include/sys/sysmacros.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. */
#ifndef _SYS_SYSMACROS_H
#define _SYS_SYSMACROS_H 1
diff --git a/include/sys/time.h b/include/sys/time.h
index c05c5c210..f051d58c4 100644
--- a/include/sys/time.h
+++ b/include/sys/time.h
@@ -1,54 +1,56 @@
-/* Copyright (C) 1991, 92, 93, 94, 96, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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_TIME_H
#define _SYS_TIME_H 1
#include <features.h>
-/* POSIX.4 structure for a time value. This is like a `struct timeval' but
- has nanoseconds instead of microseconds. */
-struct timespec
- {
- long int tv_sec; /* Seconds. */
- long int tv_nsec; /* Nanoseconds. */
- };
-
+#include <bits/types.h>
+#define __need_time_t
#include <time.h>
-#include <sys/select.h>
-
#define __need_timeval
#include <bits/time.h>
+#include <sys/select.h>
+
+#ifndef __suseconds_t_defined
+typedef __suseconds_t suseconds_t;
+# define __suseconds_t_defined
+#endif
+
__BEGIN_DECLS
+#ifdef __USE_GNU
/* Macros for converting between `struct timeval' and `struct timespec'. */
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
+# define TIMEVAL_TO_TIMESPEC(tv, ts) { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+# define TIMESPEC_TO_TIMEVAL(tv, ts) { \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
}
+#endif
+#ifdef __USE_BSD
/* Structure crudely representing a timezone.
This is obsolete and should never be used. */
struct timezone
@@ -57,25 +59,32 @@ struct timezone
int tz_dsttime; /* Nonzero if DST is ever in effect. */
};
+typedef struct timezone *__restrict __timezone_ptr_t;
+#else
+typedef void *__restrict __timezone_ptr_t;
+#endif
+
/* Get the current time of day and timezone information,
putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled.
Returns 0 on success, -1 on errors.
NOTE: This form of timezone information is obsolete.
Use the functions and variables declared in <time.h> instead. */
-extern int gettimeofday __P ((struct timeval *__tv,
- struct timezone *__tz));
+extern int gettimeofday (struct timeval *__restrict __tv,
+ __timezone_ptr_t __tz) __THROW;
+#ifdef __USE_BSD
/* Set the current time of day and timezone information.
This call is restricted to the super-user. */
-extern int settimeofday __P ((__const struct timeval *__tv,
- __const struct timezone *__tz));
+extern int settimeofday (__const struct timeval *__tv,
+ __const struct timezone *__tz) __THROW;
/* Adjust the current time of day by the amount in DELTA.
If OLDDELTA is not NULL, it is filled in with the amount
of time adjustment remaining to be done from the last `adjtime' call.
This call is restricted to the super-user. */
-extern int adjtime __P ((__const struct timeval *__delta,
- struct timeval *__olddelta));
+extern int adjtime (__const struct timeval *__delta,
+ struct timeval *__olddelta) __THROW;
+#endif
/* Values for the first argument to `getitimer' and `setitimer'. */
@@ -103,32 +112,42 @@ struct itimerval
struct timeval it_value;
};
+#if defined __USE_GNU && !defined __cplusplus
+/* Use the nicer parameter type only in GNU mode and not for C++ since the
+ strict C++ rules prevent the automatic promotion. */
+typedef enum __itimer_which __itimer_which_t;
+#else
+typedef int __itimer_which_t;
+#endif
+
/* Set *VALUE to the current setting of timer WHICH.
Return 0 on success, -1 on errors. */
-extern int getitimer __P ((enum __itimer_which __which,
- struct itimerval *__value));
+extern int getitimer (__itimer_which_t __which,
+ struct itimerval *__value) __THROW;
/* Set the timer WHICH to *NEW. If OLD is not NULL,
set *OLD to the old value of timer WHICH.
Returns 0 on success, -1 on errors. */
-extern int setitimer __P ((enum __itimer_which __which,
- __const struct itimerval *__new,
- struct itimerval *__old));
+extern int setitimer (__itimer_which_t __which,
+ __const struct itimerval *__restrict __new,
+ struct itimerval *__restrict __old) __THROW;
/* Change the access time of FILE to TVP[0] and
the modification time of FILE to TVP[1]. */
-extern int utimes __P ((__const char *__file, struct timeval __tvp[2]));
+extern int utimes (__const char *__file, __const struct timeval __tvp[2])
+ __THROW;
+#ifdef __USE_BSD
/* Convenience macros for operations on timevals.
NOTE: `timercmp' does not work for >= or <=. */
-#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
-#define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
-#define timercmp(a, b, CMP) \
+# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
+# define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
+# define timercmp(a, b, CMP) \
(((a)->tv_sec == (b)->tv_sec) ? \
((a)->tv_usec CMP (b)->tv_usec) : \
((a)->tv_sec CMP (b)->tv_sec))
-#define timeradd(a, b, result) \
+# define timeradd(a, b, result) \
do { \
(result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
@@ -138,7 +157,7 @@ extern int utimes __P ((__const char *__file, struct timeval __tvp[2]));
(result)->tv_usec -= 1000000; \
} \
} while (0)
-#define timersub(a, b, result) \
+# define timersub(a, b, result) \
do { \
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
@@ -147,6 +166,7 @@ extern int utimes __P ((__const char *__file, struct timeval __tvp[2]));
(result)->tv_usec += 1000000; \
} \
} while (0)
+#endif /* BSD */
__END_DECLS
diff --git a/include/sys/timeb.h b/include/sys/timeb.h
index 52e5486b3..dbdbf45a8 100644
--- a/include/sys/timeb.h
+++ b/include/sys/timeb.h
@@ -29,16 +29,17 @@ __BEGIN_DECLS
/* Structure returned by the `ftime' function. */
-struct timeb {
- time_t time; /* Seconds since epoch, as from `time'. */
- unsigned short int millitm; /* Additional milliseconds. */
- short int timezone; /* Minutes west of GMT. */
- short int dstflag; /* Nonzero if Daylight Savings Time used. */
-};
+struct timeb
+ {
+ time_t time; /* Seconds since epoch, as from `time'. */
+ unsigned short int millitm; /* Additional milliseconds. */
+ short int timezone; /* Minutes west of GMT. */
+ short int dstflag; /* Nonzero if Daylight Savings Time used. */
+ };
/* Fill in TIMEBUF with information about the current time. */
-extern int ftime(struct timeb *__timebuf);
+extern int ftime (struct timeb *__timebuf);
__END_DECLS
diff --git a/include/sys/times.h b/include/sys/times.h
index b6defa877..6022f2f84 100644
--- a/include/sys/times.h
+++ b/include/sys/times.h
@@ -1,21 +1,53 @@
-#ifndef _SYS_TIMES_H
-#define _SYS_TIMES_H
+/* Copyright (C) 1991, 1992, 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 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. */
+
+/*
+ * POSIX Standard: 4.5.2 Process Times <sys/times.h>
+ */
+
+#ifndef _SYS_TIMES_H
+#define _SYS_TIMES_H 1
#include <features.h>
-#include <sys/types.h>
+
+#define __need_clock_t
#include <time.h>
-struct tms {
- clock_t tms_utime;
- clock_t tms_stime;
- clock_t tms_cutime;
- clock_t tms_cstime;
-};
__BEGIN_DECLS
-extern clock_t times __P ((struct tms * __tp));
+/* Structure describing CPU time used by a process and its children. */
+struct tms
+ {
+ clock_t tms_utime; /* User CPU time. */
+ clock_t tms_stime; /* System CPU time. */
+
+ clock_t tms_cutime; /* User CPU time of dead children. */
+ clock_t tms_cstime; /* System CPU time of dead children. */
+ };
+
+
+/* Store the CPU time used by this process and all its
+ dead children (and their dead children) in BUFFER.
+ Return the elapsed real time, or (clock_t) -1 for errors.
+ All times are in CLK_TCKths of a second. */
+extern clock_t times (struct tms *__buffer) __THROW;
__END_DECLS
-#endif
+#endif /* sys/times.h */
diff --git a/include/sys/timex.h b/include/sys/timex.h
index 900341e54..773a5ab8d 100644
--- a/include/sys/timex.h
+++ b/include/sys/timex.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_TIMEX_H
#define _SYS_TIMEX_H 1
@@ -116,11 +116,11 @@ struct timex
__BEGIN_DECLS
-extern int __adjtimex __P ((struct timex *__ntx));
-extern int adjtimex __P ((struct timex *__ntx));
+extern int __adjtimex (struct timex *__ntx) __THROW;
+extern int adjtimex (struct timex *__ntx) __THROW;
-extern int ntp_gettime __P ((struct ntptimeval *__ntv));
-extern int ntp_adjtime __P ((struct timex *__tntx));
+extern int ntp_gettime (struct ntptimeval *__ntv) __THROW;
+extern int ntp_adjtime (struct timex *__tntx) __THROW;
__END_DECLS
diff --git a/include/sys/ttydefaults.h b/include/sys/ttydefaults.h
index b21c6d568..9be168b83 100644
--- a/include/sys/ttydefaults.h
+++ b/include/sys/ttydefaults.h
@@ -15,10 +15,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
diff --git a/include/sys/types.h b/include/sys/types.h
index c746ad6c6..cd114876f 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991,92,94,95,96,97,98,99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,94,95,96,97,98,99,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. */
/*
* POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
@@ -30,6 +30,7 @@ __BEGIN_DECLS
#include <bits/types.h>
#ifdef __USE_BSD
+# ifndef __u_char_defined
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
@@ -37,93 +38,110 @@ typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
+# define __u_char_defined
+# endif
#endif
typedef __loff_t loff_t;
-#ifndef ino_t
+#ifndef __ino_t_defined
# ifndef __USE_FILE_OFFSET64
typedef __ino_t ino_t;
# else
typedef __ino64_t ino_t;
# endif
-# define ino_t ino_t
+# define __ino_t_defined
#endif
-#if defined __USE_LARGEFILE64 && !defined ino64_t
+#if defined __USE_LARGEFILE64 && !defined __ino64_t_defined
typedef __ino64_t ino64_t;
-# define ino64_t ino64_t
+# define __ino64_t_defined
#endif
-#ifndef dev_t
+#ifndef __dev_t_defined
typedef __dev_t dev_t;
-# define dev_t dev_t
+# define __dev_t_defined
#endif
-#ifndef gid_t
+#ifndef __gid_t_defined
typedef __gid_t gid_t;
-# define gid_t gid_t
+# define __gid_t_defined
#endif
-#ifndef mode_t
+#ifndef __mode_t_defined
typedef __mode_t mode_t;
-# define mode_t mode_t
+# define __mode_t_defined
#endif
-#ifndef nlink_t
+#ifndef __nlink_t_defined
typedef __nlink_t nlink_t;
-# define nlink_t nlink_t
+# define __nlink_t_defined
#endif
-#ifndef uid_t
+#ifndef __uid_t_defined
typedef __uid_t uid_t;
-# define uid_t uid_t
+# define __uid_t_defined
#endif
-#ifndef off_t
+#ifndef __off_t_defined
# ifndef __USE_FILE_OFFSET64
typedef __off_t off_t;
# else
typedef __off64_t off_t;
# endif
-# define off_t off_t
+# define __off_t_defined
#endif
-#if defined __USE_LARGEFILE64 && !defined off64_t
+#if defined __USE_LARGEFILE64 && !defined __off64_t_defined
typedef __off64_t off64_t;
-# define off64_t off64_t
+# define __off64_t_defined
#endif
-#ifndef pid_t
+#ifndef __pid_t_defined
typedef __pid_t pid_t;
-# define pid_t pid_t
# define __pid_t_defined
#endif
-#if defined __USE_SVID || defined __USE_XOPEN
+#if (defined __USE_SVID || defined __USE_XOPEN) && !defined __id_t_defined
typedef __id_t id_t;
# define __id_t_defined
#endif
-#ifndef ssize_t
+#ifndef __ssize_t_defined
typedef __ssize_t ssize_t;
-# define ssize_t ssize_t
# define __ssize_t_defined
#endif
#ifdef __USE_BSD
+# ifndef __daddr_t_defined
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
+# define __daddr_t_defined
+# endif
#endif
-#if defined __USE_SVID || defined __USE_XOPEN
+#if (defined __USE_SVID || defined __USE_XOPEN) && !defined __key_t_defined
typedef __key_t key_t;
+# define __key_t_defined
#endif
#ifdef __USE_XOPEN
# define __need_clock_t
#endif
#define __need_time_t
+#define __need_timer_t
+#define __need_clockid_t
#include <time.h>
+#ifdef __USE_XOPEN
+# ifndef __useconds_t_defined
+typedef __useconds_t useconds_t;
+# define __useconds_t_defined
+# endif
+# ifndef __suseconds_t_defined
+typedef __suseconds_t suseconds_t;
+# define __suseconds_t_defined
+# endif
+#endif
+
#define __need_size_t
#include <stddef.h>
@@ -136,9 +154,9 @@ typedef unsigned int uint;
/* These size-specific names are used by some of the inet code. */
-#if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+#if !__GNUC_PREREQ (2, 7)
-/* These types are defined by the ISO C 9x header <inttypes.h>. */
+/* These types are defined by the ISO C99 header <inttypes.h>. */
# ifndef __int8_t_defined
# define __int8_t_defined
typedef char int8_t;
@@ -201,15 +219,38 @@ typedef int register_t __attribute__ ((__mode__ (__word__)));
#endif /* Use BSD. */
+#if defined __USE_UNIX98 && !defined __blksize_t_defined
+typedef __blksize_t blksize_t;
+# define __blksize_t_defined
+#endif
+
/* Types from the Large File Support interface. */
#ifndef __USE_FILE_OFFSET64
+# ifndef __blkcnt_t_defined
typedef __blkcnt_t blkcnt_t; /* Type to count number of disk blocks. */
+# define __blkcnt_t_defined
+# endif
+# ifndef __fsblkcnt_t_defined
typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */
+# define __fsblkcnt_t_defined
+# endif
+# ifndef __fsfilcnt_t_defined
typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */
+# define __fsfilcnt_t_defined
+# endif
#else
+# ifndef __blkcnt_t_defined
typedef __blkcnt64_t blkcnt_t; /* Type to count number of disk blocks. */
+# define __blkcnt_t_defined
+# endif
+# ifndef __fsblkcnt_t_defined
typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */
+# define __fsblkcnt_t_defined
+# endif
+# ifndef __fsfilcnt_t_defined
typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */
+# define __fsfilcnt_t_defined
+# endif
#endif
#ifdef __USE_LARGEFILE64
diff --git a/include/sys/ucontext.h b/include/sys/ucontext.h
new file mode 100644
index 000000000..6d6c8e399
--- /dev/null
+++ b/include/sys/ucontext.h
@@ -0,0 +1,94 @@
+/* Copyright (C) 1998, 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. */
+
+/* System V/ARM ABI compliant context switching support. */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#include <features.h>
+#include <signal.h>
+#include <sys/procfs.h>
+
+typedef int greg_t;
+
+/* Number of general registers. */
+#define NGREG 16
+
+/* Container for all general registers. */
+typedef elf_gregset_t gregset_t;
+
+/* Number of each register is the `gregset_t' array. */
+enum
+{
+ R0 = 0,
+#define R0 R0
+ R1 = 1,
+#define R1 R1
+ R2 = 2,
+#define R2 R2
+ R3 = 3,
+#define R3 R3
+ R4 = 4,
+#define R4 R4
+ R5 = 5,
+#define R5 R5
+ R6 = 6,
+#define R6 R6
+ R7 = 7,
+#define R7 R7
+ R8 = 8,
+#define R8 R8
+ R9 = 9,
+#define R9 R9
+ R10 = 10,
+#define R10 R10
+ R11 = 11,
+#define R11 R11
+ R12 = 12,
+#define R12 R12
+ R13 = 13,
+#define R13 R13
+ R14 = 14,
+#define R14 R14
+ R15 = 15
+#define R15 R15
+};
+
+/* Structure to describe FPU registers. */
+typedef elf_fpregset_t fpregset_t;
+
+/* Context to describe whole processor state. */
+typedef struct
+ {
+ gregset_t gregs;
+ fpregset_t fpregs;
+ } mcontext_t;
+
+/* Userlevel context. */
+typedef struct ucontext
+ {
+ unsigned long int uc_flags;
+ struct ucontext *uc_link;
+ __sigset_t uc_sigmask;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ long int uc_filler[5];
+ } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/include/sys/uio.h b/include/sys/uio.h
index 0be33e9b4..4b3138088 100644
--- a/include/sys/uio.h
+++ b/include/sys/uio.h
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 1992, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* 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 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_UIO_H
#define _SYS_UIO_H 1
@@ -34,16 +34,16 @@ __BEGIN_DECLS
The buffers are filled in the order specified.
Operates just like `read' (see <unistd.h>) except that data are
put in VECTOR instead of a contiguous buffer. */
-extern ssize_t readv __P ((int __fd, __const struct iovec *__vector,
- int __count));
+extern ssize_t readv (int __fd, __const struct iovec *__vector, int __count)
+ __THROW;
/* Write data pointed by the buffers described by VECTOR, which
is a vector of COUNT `struct iovec's, to file descriptor FD.
The data is written in the order specified.
Operates just like `write' (see <unistd.h>) except that the data
are taken from VECTOR instead of a contiguous buffer. */
-extern ssize_t writev __P ((int __fd, __const struct iovec *__vector,
- int __count));
+extern ssize_t writev (int __fd, __const struct iovec *__vector, int __count)
+ __THROW;
__END_DECLS
diff --git a/include/sys/un.h b/include/sys/un.h
index 03f36058b..1fa10e4fe 100644
--- a/include/sys/un.h
+++ b/include/sys/un.h
@@ -1,28 +1,26 @@
-/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995, 1996, 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_UN_H
#define _SYS_UN_H 1
#include <sys/cdefs.h>
-#include <string.h> /* For prototype of `strlen'. */
-
/* Get the definition of the macro to define the common sockaddr members. */
#include <bits/sockaddr.h>
@@ -36,9 +34,13 @@ struct sockaddr_un
};
+#ifdef __USE_MISC
+# include <string.h> /* For prototype of `strlen'. */
+
/* Evaluate to actual length of the `sockaddr_un' structure. */
-#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+ strlen ((ptr)->sun_path))
+#endif
__END_DECLS
diff --git a/include/sys/user.h b/include/sys/user.h
index aca46e7d3..3fae43f83 100644
--- a/include/sys/user.h
+++ b/include/sys/user.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 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
@@ -23,81 +23,50 @@
too much into it. Don't use it for anything other than GDB unless
you know what you are doing. */
-struct user_fpregs_struct
+struct user_fpregs
{
- long int cwd;
- long int swd;
- long int twd;
- long int fip;
- long int fcs;
- long int foo;
- long int fos;
- long int st_space [20];
+ struct fp_reg
+ {
+ unsigned int sign1:1;
+ unsigned int unused:15;
+ unsigned int sign2:1;
+ unsigned int exponent:14;
+ unsigned int j:1;
+ unsigned int mantissa1:31;
+ unsigned int mantissa0:32;
+ } fpregs[8];
+ unsigned int fpsr:32;
+ unsigned int fpcr:32;
+ unsigned char ftype[8];
+ unsigned int init_flag;
};
-struct user_fpxregs_struct
+struct user_regs
{
- unsigned short int cwd;
- unsigned short int swd;
- unsigned short int twd;
- unsigned short int fop;
- long int fip;
- long int fcs;
- long int foo;
- long int fos;
- long int mxcsr;
- long int reserved;
- long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
- long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
- long int padding[56];
-};
-
-struct user_regs_struct
-{
- long int ebx;
- long int ecx;
- long int edx;
- long int esi;
- long int edi;
- long int ebp;
- long int eax;
- long int xds;
- long int xes;
- long int xfs;
- long int xgs;
- long int orig_eax;
- long int eip;
- long int xcs;
- long int eflags;
- long int esp;
- long int xss;
+ unsigned long int uregs[18];
};
struct user
{
- struct user_regs_struct regs;
- int u_fpvalid;
- struct user_fpregs_struct i387;
- unsigned long int u_tsize;
- unsigned long int u_dsize;
- unsigned long int u_ssize;
- unsigned long start_code;
- unsigned long start_stack;
- long int signal;
- int reserved;
- struct user_regs_struct* u_ar0;
- struct user_fpregs_struct* u_fpstate;
- unsigned long int magic;
- char u_comm [32];
- int u_debugreg [8];
-};
+ struct user_regs regs; /* General registers */
+ int u_fpvalid; /* True if math co-processor being used. */
-#define PAGE_SHIFT 12
-#define PAGE_SIZE (1UL << PAGE_SHIFT)
-#define PAGE_MASK (~(PAGE_SIZE-1))
-#define NBPG PAGE_SIZE
-#define UPAGES 1
-#define HOST_TEXT_START_ADDR (u.start_code)
-#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+ unsigned long int u_tsize; /* Text segment size (pages). */
+ unsigned long int u_dsize; /* Data segment size (pages). */
+ unsigned long int u_ssize; /* Stack segment size (pages). */
+
+ unsigned long start_code; /* Starting virtual address of text. */
+ unsigned long start_stack; /* Starting virtual address of stack. */
+
+ long int signal; /* Signal that caused the core dump. */
+ int reserved; /* No longer used */
+ struct user_regs *u_ar0; /* help gdb to find the general registers. */
+
+ unsigned long magic; /* uniquely identify a core file */
+ char u_comm[32]; /* User command that was responsible */
+ int u_debugreg[8];
+ struct user_fpregs u_fp; /* Floating point registers */
+ struct user_fpregs *u_fp0; /* help gdb to find the FP registers. */
+};
-#endif /* _SYS_USER_H */
+#endif /* sys/user.h */
diff --git a/include/sys/utsname.h b/include/sys/utsname.h
index 7625a5b6b..ca195cb4d 100644
--- a/include/sys/utsname.h
+++ b/include/sys/utsname.h
@@ -1,20 +1,74 @@
-#ifndef __SYS_UTSNAME_H
-#define __SYS_UTSNAME_H
+/* Copyright (C) 1991, 92, 94, 96, 97, 99 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-#include <features.h>
-#include <sys/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. */
-struct utsname {
- char sysname[65];
- char nodename[65];
- char release[65];
- char version[65];
- char machine[65];
- char domainname[65];
-};
+/*
+ * POSIX Standard: 4.4 System Identification <sys/utsname.h>
+ */
+
+#ifndef _SYS_UTSNAME_H
+#define _SYS_UTSNAME_H 1
+
+#include <features.h>
__BEGIN_DECLS
-extern int uname __P ((struct utsname * __utsbuf));
-__END_DECLS
+#include <bits/utsname.h>
+
+#ifndef _UTSNAME_NODENAME_LENGTH
+# define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
+#endif
+
+/* Structure describing the system and machine. */
+struct utsname
+ {
+ /* Name of the implementation of the operating system. */
+ char sysname[_UTSNAME_LENGTH];
+
+ /* Name of this node on the network. */
+ char nodename[_UTSNAME_NODENAME_LENGTH];
+
+ /* Current release level of this implementation. */
+ char release[_UTSNAME_LENGTH];
+ /* Current version level of this release. */
+ char version[_UTSNAME_LENGTH];
+
+ /* Name of the hardware type the system is running on. */
+ char machine[_UTSNAME_LENGTH];
+
+#if _UTSNAME_DOMAIN_LENGTH - 0
+ /* Name of the domain of this node on the network. */
+# ifdef __USE_GNU
+ char domainname[_UTSNAME_DOMAIN_LENGTH];
+# else
+ char __domainname[_UTSNAME_DOMAIN_LENGTH];
+# endif
#endif
+ };
+
+#ifdef __USE_SVID
+# define SYS_NMLN _UTSNAME_LENGTH
+#endif
+
+
+/* Put information about the system in NAME. */
+extern int uname (struct utsname *__name) __THROW;
+
+
+__END_DECLS
+
+#endif /* sys/utsname.h */
diff --git a/include/sys/vm86.h b/include/sys/vm86.h
deleted file mode 100644
index 851814e13..000000000
--- a/include/sys/vm86.h
+++ /dev/null
@@ -1,125 +0,0 @@
-#if !__AS386_16__
-
-#ifndef _SYS_VM86_H
-#define _SYS_VM86_H
-
-#include <features.h>
-#ifndef _LINUX_VM86_H
-#define _LINUX_VM86_H
-
-/*
- * I'm guessing at the VIF/VIP flag usage, but hope that this is how
- * the Pentium uses them. Linux will return from vm86 mode when both
- * VIF and VIP is set.
- *
- * On a Pentium, we could probably optimize the virtual flags directly
- * in the eflags register instead of doing it "by hand" in vflags...
- *
- * Linus
- */
-
-#define TF_MASK 0x00000100
-#define IF_MASK 0x00000200
-#define IOPL_MASK 0x00003000
-#define NT_MASK 0x00004000
-#define VM_MASK 0x00020000
-#define AC_MASK 0x00040000
-#define VIF_MASK 0x00080000 /* virtual interrupt flag */
-#define VIP_MASK 0x00100000 /* virtual interrupt pending */
-#define ID_MASK 0x00200000
-
-#define BIOSSEG 0x0f000
-
-#define CPU_086 0
-#define CPU_186 1
-#define CPU_286 2
-#define CPU_386 3
-#define CPU_486 4
-#define CPU_586 5
-
-/*
- * Return values for the 'vm86()' system call
- */
-#define VM86_TYPE(retval) ((retval) & 0xff)
-#define VM86_ARG(retval) ((retval) >> 8)
-
-#define VM86_SIGNAL 0 /* return due to signal */
-#define VM86_UNKNOWN 1 /* unhandled GP fault - IO-instruction or similar */
-#define VM86_INTx 2 /* int3/int x instruction (ARG = x) */
-#define VM86_STI 3 /* sti/popf/iret instruction enabled virtual interrupts */
-
-/*
- * This is the stack-layout when we have done a "SAVE_ALL" from vm86
- * mode - the main change is that the old segment descriptors aren't
- * useful any more and are forced to be zero by the kernel (and the
- * hardware when a trap occurs), and the real segment descriptors are
- * at the end of the structure. Look at ptrace.h to see the "normal"
- * setup.
- */
-
-struct vm86_regs {
-/*
- * normal regs, with special meaning for the segment descriptors..
- */
- long ebx;
- long ecx;
- long edx;
- long esi;
- long edi;
- long ebp;
- long eax;
- long __null_ds;
- long __null_es;
- long __null_fs;
- long __null_gs;
- long orig_eax;
- long eip;
- unsigned short cs, __csh;
- long eflags;
- long esp;
- unsigned short ss, __ssh;
-/*
- * these are specific to v86 mode:
- */
- unsigned short es, __esh;
- unsigned short ds, __dsh;
- unsigned short fs, __fsh;
- unsigned short gs, __gsh;
-};
-
-struct revectored_struct {
- unsigned long __map[8]; /* 256 bits */
-};
-
-struct vm86_struct {
- struct vm86_regs regs;
- unsigned long flags;
- unsigned long screen_bitmap;
- unsigned long cpu_type;
- struct revectored_struct int_revectored;
- struct revectored_struct int21_revectored;
-};
-
-/*
- * flags masks
- */
-#define VM86_SCREEN_BITMAP 0x0001
-
-#ifdef __KERNEL__
-
-void handle_vm86_fault(struct vm86_regs *, long);
-void handle_vm86_debug(struct vm86_regs *, long);
-
-#endif
-
-#endif
-
-__BEGIN_DECLS
-
-extern vm86(struct vm86_struct * __info);
-
-__END_DECLS
-
-#endif /*_SYS_VM86_H */
-
-#endif
diff --git a/include/sys/wait.h b/include/sys/wait.h
index 2ba604de6..03ac5fe35 100644
--- a/include/sys/wait.h
+++ b/include/sys/wait.h
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 92, 93, 94, 96, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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. */
/*
* POSIX Standard: 3.2.1 Wait for Process Termination <sys/wait.h>
@@ -27,65 +27,64 @@
__BEGIN_DECLS
-#include <bits/types.h>
-
-#if defined __USE_XOPEN && !defined pid_t
-typedef __pid_t pid_t;
-# define pid_t pid_t
-#endif
+#include <signal.h>
+#include <sys/resource.h>
+/* These macros could also be defined int <stdlib.h>. */
+#if !defined _STDLIB_H || !defined __USE_XOPEN
/* This will define the `W*' macros for the flag
bits to `waitpid', `wait3', and `wait4'. */
-#include <bits/waitflags.h>
+# include <bits/waitflags.h>
-#ifdef __USE_BSD
+# ifdef __USE_BSD
/* Lots of hair to allow traditional BSD use of `union wait'
as well as POSIX.1 use of `int' for the status word. */
-# if defined __GNUC__ && !defined __cplusplus
-# define __WAIT_INT(status) \
+# if defined __GNUC__ && !defined __cplusplus
+# define __WAIT_INT(status) \
(__extension__ ({ union { __typeof(status) __in; int __i; } __u; \
__u.__in = (status); __u.__i; }))
-# else
-# define __WAIT_INT(status) (*(int *) &(status))
-# endif
+# else
+# define __WAIT_INT(status) (*(int *) &(status))
+# endif
/* This is the type of the argument to `wait'. The funky union
causes redeclarations with ether `int *' or `union wait *' to be
allowed without complaint. __WAIT_STATUS_DEFN is the type used in
the actual function definitions. */
-# if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
-# define __WAIT_STATUS __ptr_t
-# define __WAIT_STATUS_DEFN __ptr_t
-# else
+# if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
+# define __WAIT_STATUS void *
+# define __WAIT_STATUS_DEFN void *
+# else
/* This works in GCC 2.6.1 and later. */
typedef union
{
union wait *__uptr;
int *__iptr;
} __WAIT_STATUS __attribute__ ((__transparent_union__));
-# define __WAIT_STATUS_DEFN int *
-#endif
+# define __WAIT_STATUS_DEFN int *
+# endif
-#else /* Don't use BSD. */
+# else /* Don't use BSD. */
-# define __WAIT_INT(status) (status)
-# define __WAIT_STATUS int *
-# define __WAIT_STATUS_DEFN int *
+# define __WAIT_INT(status) (status)
+# define __WAIT_STATUS int *
+# define __WAIT_STATUS_DEFN int *
-#endif /* Use BSD. */
+# endif /* Use BSD. */
/* This will define all the `__W*' macros. */
-#include <bits/waitstatus.h>
+# include <bits/waitstatus.h>
-#define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status))
-#define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status))
-#define WSTOPSIG(status) __WSTOPSIG(__WAIT_INT(status))
-#define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status))
-#define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status))
-#define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status))
+# define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status))
+# define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status))
+# define WSTOPSIG(status) __WSTOPSIG(__WAIT_INT(status))
+# define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status))
+# define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status))
+# define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status))
+#endif /* <stdlib.h> not included. */
#ifdef __USE_BSD
# define WCOREFLAG __WCOREFLAG
@@ -107,8 +106,7 @@ typedef enum
/* Wait for a child to die. When one does, put its status in *STAT_LOC
and return its process ID. For errors, return (pid_t) -1. */
-extern __pid_t __wait __P ((__WAIT_STATUS __stat_loc));
-extern __pid_t wait __P ((__WAIT_STATUS __stat_loc));
+extern __pid_t wait (__WAIT_STATUS __stat_loc) __THROW;
#ifdef __USE_BSD
/* Special values for the PID argument to `waitpid' and `wait4'. */
@@ -128,8 +126,7 @@ extern __pid_t wait __P ((__WAIT_STATUS __stat_loc));
return PID and store the dead child's status in STAT_LOC.
Return (pid_t) -1 for errors. If the WUNTRACED bit is
set in OPTIONS, return status for stopped children; otherwise don't. */
-extern __pid_t waitpid __P ((__pid_t __pid, int *__stat_loc,
- int __options));
+extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options) __THROW;
#if defined __USE_SVID || defined __USE_XOPEN
# define __need_siginfo_t
@@ -142,8 +139,8 @@ extern __pid_t waitpid __P ((__pid_t __pid, int *__stat_loc,
If the WNOHANG bit is set in OPTIONS, and that child
is not already dead, clear *INFOP and return 0. If successful, store
exit code and status in *INFOP. */
-extern int waitid __P ((idtype_t __idtype, __id_t __id, siginfo_t *__infop,
- int __options));
+extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
+ int __options) __THROW;
#endif
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
@@ -156,8 +153,8 @@ struct rusage;
nil, store information about the child's resource usage there. If the
WUNTRACED bit is set in OPTIONS, return status for stopped children;
otherwise don't. */
-extern __pid_t wait3 __P ((__WAIT_STATUS __stat_loc,
- int __options, struct rusage * __usage));
+extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
+ struct rusage * __usage) __THROW;
#endif
#ifdef __USE_BSD
@@ -166,8 +163,8 @@ extern __pid_t wait3 __P ((__WAIT_STATUS __stat_loc,
struct rusage;
/* PID is like waitpid. Other args are like wait3. */
-extern __pid_t wait4 __P ((__pid_t __pid, __WAIT_STATUS __stat_loc,
- int __options, struct rusage *__usage));
+extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
+ struct rusage *__usage) __THROW;
#endif /* Use BSD. */