diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-09-27 05:21:15 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-09-27 05:21:15 +0000 |
commit | e83a36ce9f97ac0f59117b3a62fd2dd8461b1fd5 (patch) | |
tree | 85ce10f2fc87fba69e07a13d7036d074e195dea7 /include/sys | |
parent | 65eee187317b93773d2409d0e7e2814d34c6a0e1 (diff) |
Rev all the header files to sync things with glibc 2.2.4
Diffstat (limited to 'include/sys')
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. |