From f4017d205738b913f1002433cde5d4b4e93fbd81 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 26 Nov 1997 04:23:08 +0000 Subject: Update. 1997-11-26 04:28 Ulrich Drepper * eld/dl-profile.c (_dl_start_profile): Avoid FP calculation when computing s_scale. Patch by a sun . * iconv/gconv_close.c: Correct freeing of descriptor data. * iconv/gconv_simple.c: Return correct error values for illegal or incomplete characters. * Makefile (iconvdata/%): Special goal to simplify iconvdata development. * iconvdata/Makefile: New file. * iconvdata/configure: Likewise. * iconvdata/extra-module.mk: Likewise. * iconvdata/gconv-modules: Likewise. * iconvdata/iso6937.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/iso8859-10.c: Likewise. * iconvdata/iso8859-10.h: Likewise. * iconvdata/iso8859-2.c: Likewise. * iconvdata/iso8859-2.h: Likewise. * iconvdata/iso8859-3.c: Likewise. * iconvdata/iso8859-3.h: Likewise. * iconvdata/iso8859-4.c: Likewise. * iconvdata/iso8859-4.h: Likewise. * iconvdata/iso8859-5.c: Likewise. * iconvdata/iso8859-5.h: Likewise. * iconvdata/iso8859-6.c: Likewise. * iconvdata/iso8859-6.h: Likewise. * iconvdata/iso8859-7.c: Likewise. * iconvdata/iso8859-7.h: Likewise. * iconvdata/iso8859-8.c: Likewise. * iconvdata/iso8859-8.h: Likewise. * iconvdata/iso8859-9.c: Likewise. * iconvdata/iso8859-9.h: Likewise. * iconvdata/iso8859-generic.c: Likewise. * iconvdata/t61.c: Likewise. * string/Makefile (routines): Add strcasestr. * string/string.h: Add prototype for strcasestr. * sysdeps/generic/strcasestr.c: New file. * wcsmbs/mbrtowc.c: Simplify special case a bit. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/mbsnrtowcs.c: Correctly handle incomplete characters. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/mbsrtowcs.c: Make sure SRC argument is correct when partial character is read. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wmemrtombs.c: Likewise. * wcsmbs/wmemrtowcs.c: Likewise. * io/ftw.h: Include instead of . * login/pty.h: Include instead og . * sysdeps/i386/__longjmp.S: Define _SETJMP_H. * sysdeps/i386/elf/setjmp.S: Likewise. * sysdeps/unix/sysv/linux/kernel_termios.h: Do include . * sysdeps/posix/mk-stdiolim.c: Output file with comment. * sysdeps/unix/sysv/linux/stdio_lim.h.in: Add comment. * sysdeps/unix/sysv/linux/sys/mman.h: Pretty print. * sysvipc/sys/ipc.h: Likewise. * sysvipc/sys/msg.h: Likewise. * sysvipc/sys/sem.h: Likewise. * sysvipc/sys/shm.h: Likewise. * sysdeps/alpha/bits/endian.h: Issue error message if the header is used directly. * sysdeps/alpha/bits/setjmp.h: Likewise. * sysdeps/alpha/fpu/bits/fenv.h: Likewise. * sysdeps/arm/bits/endian.h: Likewise. * sysdeps/arm/bits/setjmp.h: Likewise. * sysdeps/generic/bits/byteswap.h: Likewise. * sysdeps/generic/bits/confname.h: Likewise. * sysdeps/generic/bits/dirent.h: Likewise. * sysdeps/generic/bits/dlfcn.h: Likewise. * sysdeps/generic/bits/endian.h: Likewise. * sysdeps/generic/bits/fenv.h: Likewise. * sysdeps/generic/bits/huge_val.h: Likewise. * sysdeps/generic/bits/in.h: Likewise. * sysdeps/generic/bits/ioctl-types.h: Likewise. * sysdeps/generic/bits/ioctls.h: Likewise. * sysdeps/generic/bits/ipc.h: Likewise. * sysdeps/generic/bits/msq.h: Likewise. * sysdeps/generic/bits/poll.h: Likewise. * sysdeps/generic/bits/resource.h: Likewise. * sysdeps/generic/bits/sched.h: Likewise. * sysdeps/generic/bits/sem.h: Likewise. * sysdeps/generic/bits/setjmp.h: Likewise. * sysdeps/generic/bits/shm.h: Likewise. * sysdeps/generic/bits/sigaction.h: Likewise. * sysdeps/generic/bits/sigcontext.h: Likewise. * sysdeps/generic/bits/socket.h: Likewise. * sysdeps/generic/bits/stat.h: Likewise. * sysdeps/generic/bits/statfs.h: Likewise. * sysdeps/generic/bits/stdio_lim.h: Likewise. * sysdeps/generic/bits/termios.h: Likewise. * sysdeps/generic/bits/time.h: Likewise. * sysdeps/generic/bits/uio.h: Likewise. * sysdeps/generic/bits/utmp.h: Likewise. * sysdeps/generic/bits/utmpx.h: Likewise. * sysdeps/generic/bits/utsname.h: Likewise. * sysdeps/generic/bits/waitflags.h: Likewise. * sysdeps/generic/bits/waitstatus.h: Likewise. * sysdeps/gnu/bits/utmp.h: Likewise. * sysdeps/gnu/bits/utmpx.h: Likewise. * sysdeps/i386/bits/byteswap.h: Likewise. * sysdeps/i386/bits/endian.h: Likewise. * sysdeps/i386/bits/huge_val.h: Likewise. * sysdeps/i386/bits/setjmp.h: Likewise. * sysdeps/i386/fpu/bits/fenv.h: Likewise. * sysdeps/ieee754/bits/huge_val.h: Likewise. * sysdeps/m68k/bits/byteswap.h: Likewise. * sysdeps/m68k/bits/endian.h: Likewise. * sysdeps/m68k/bits/setjmp.h: Likewise. * sysdeps/m68k/fpu/bits/fenv.h: Likewise. * sysdeps/mach/hurd/alpha/bits/sigcontext.h: Likewise. * sysdeps/mach/hurd/bits/ioctls.h: Likewise. * sysdeps/mach/hurd/bits/stat.h: Likewise. * sysdeps/mach/hurd/hppa/bits/sigcontext.h: Likewise. * sysdeps/mach/hurd/i386/bits/sigcontext.h: Likewise. * sysdeps/mach/hurd/mips/bits/sigcontext.h: Likewise. * sysdeps/mips/bits/dlfcn.h: Likewise. * sysdeps/mips/bits/endian.h: Likewise. * sysdeps/mips/bits/setjmp.h: Likewise. * sysdeps/mips/dec/bits/endian.h: Likewise. * sysdeps/mips/mips64/bits/setjmp.h: Likewise. * sysdeps/mips/mipsel/bits/endian.h: Likewise. * sysdeps/mips/p40/bits/endian.h: Likewise. * sysdeps/powerpc/bits/endian.h: Likewise. * sysdeps/powerpc/bits/fenv.h: Likewise. * sysdeps/powerpc/bits/setjmp.h: Likewise. * sysdeps/sparc/sparc32/bits/endian.h: Likewise. * sysdeps/sparc/sparc32/bits/setjmp.h: Likewise. * sysdeps/sparc/sparc32/fpu/bits/fenv.h: Likewise. * sysdeps/sparc/sparc64/bits/endian.h: Likewise. * sysdeps/sparc/sparc64/fpu/bits/fenv.h: Likewise. * sysdeps/unix/bsd/bits/dirent.h: Likewise. * sysdeps/unix/bsd/bits/stat.h: Likewise. * sysdeps/unix/bsd/bits/waitflags.h: Likewise. * sysdeps/unix/bsd/bsd4.4/bits/dirent.h: Likewise. * sysdeps/unix/bsd/osf/alpha/bits/stat.h: Likewise. * sysdeps/unix/bsd/osf/bits/sigaction.h: Likewise. * sysdeps/unix/bsd/sun/m68k/bits/sigcontext.h: Likewise. * sysdeps/unix/bsd/sun/sparc/bits/sigcontext.h: Likewise. * sysdeps/unix/bsd/sun/sunos4/bits/resource.h: Likewise. * sysdeps/unix/bsd/sun/sunos4/bits/termios.h: Likewise. * sysdeps/unix/bsd/sun/sunos4/bits/utsname.h: Likewise. * sysdeps/unix/bsd/ultrix4/bits/utsname.h: Likewise. * sysdeps/unix/bsd/ultrix4/mips/bits/sigcontext.h: Likewise. * sysdeps/unix/common/bits/dirent.h: Likewise. * sysdeps/unix/sysv/bits/dirent.h: Likewise. * sysdeps/unix/sysv/bits/stat.h: Likewise. * sysdeps/unix/sysv/bits/utmp.h: Likewise. * sysdeps/unix/sysv/bits/utsname.h: Likewise. * sysdeps/unix/sysv/irix4/bits/confname.h: Likewise. * sysdeps/unix/sysv/irix4/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/ioctls.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/ipc.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/mman.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/time.h: Likewise. * sysdeps/unix/sysv/linux/bits/dirent.h: Likewise. * sysdeps/unix/sysv/linux/bits/in.h: Likewise. * sysdeps/unix/sysv/linux/bits/ioctl-types.h: Likewise. * sysdeps/unix/sysv/linux/bits/ioctls.h: Likewise. * sysdeps/unix/sysv/linux/bits/ipc.h: Likewise. * sysdeps/unix/sysv/linux/bits/msq.h: Likewise. * sysdeps/unix/sysv/linux/bits/poll.h: Likewise. * sysdeps/unix/sysv/linux/bits/resource.h: Likewise. * sysdeps/unix/sysv/linux/bits/sched.h: Likewise. * sysdeps/unix/sysv/linux/bits/sem.h: Likewise. * sysdeps/unix/sysv/linux/bits/shm.h: Likewise. * sysdeps/unix/sysv/linux/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/bits/sigcontext.h: Likewise. * sysdeps/unix/sysv/linux/bits/socket.h: Likewise. * sysdeps/unix/sysv/linux/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/bits/statfs.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/bits/time.h: Likewise. * sysdeps/unix/sysv/linux/bits/uio.h: Likewise. * sysdeps/unix/sysv/linux/bits/utsname.h: Likewise. * sysdeps/unix/sysv/linux/bits/waitflags.h: Likewise. * sysdeps/unix/sysv/linux/i386/bits/mman.h: Likewise. * sysdeps/unix/sysv/linux/m68k/bits/mman.h: Likewise. * sysdeps/unix/sysv/linux/m68k/bits/poll.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/endian.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/ipc.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/mman.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/poll.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/shm.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/socket.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/statfs.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/time.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/ioctls.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/poll.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/bits/mman.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/bits/mman.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/bits/setjmp.h: Likewise. * sysdeps/unix/sysv/minix/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/sco3.2.4/bits/confname.h: Likewise. * sysdeps/unix/sysv/sco3.2.4/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/sysv4/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/sysv4/bits/utsname.h: Likewise. * sysdeps/unix/sysv/sysv4/bits/waitflags.h: Likewise. * sysdeps/unix/sysv/sysv4/i386/bits/stat.h: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h: Likewise. * sysdeps/vax/bits/huge_val.h: Likewise. * sysdeps/vax/bits/setjmp.h: Likewise. * sysdeps/wordsize-32/bits/elfclass.h: Likewise. * sysdeps/wordsize-64/bits/elfclass.h: Likewise. 1997-11-25 Andreas Jaeger * libio/stdio.h: Correct comment of sys_nerr/sys_errlist 1997-11-25 Paul Eggert * strftime.c (strftime): No longer any need to undef or declare if emacs is defined. (my_strftime): When checking a -1 returned by mktime, don't blow up if localtime_r returns NULL. 1997-11-24 Andreas Schwab * README.template: Fix spelling. 1997-11-25 Andreas Jaeger * configure.in: Enhance --enable-add-ons description a wee bit. 1997-11-24 Andreas Jaeger * glibcbug.in: Add more information of build environment and flags. 1997-11-23 Andreas Schwab * sysdeps/posix/getcwd.c: Recognize EOF from readdir and translate it into ENOENT. --- bits/byteswap.h | 7 +++-- bits/confname.h | 4 +++ bits/dirent.h | 6 ++++- bits/dlfcn.h | 7 +++-- bits/endian.h | 4 +++ bits/fenv.h | 2 +- bits/huge_val.h | 4 +-- bits/in.h | 15 +++++------ bits/ioctl-types.h | 25 +++++++---------- bits/ioctls.h | 4 +++ bits/ipc.h | 30 ++++++++------------- bits/msq.h | 6 ----- bits/poll.h | 3 +++ bits/resource.h | 7 ++++- bits/sched.h | 4 +-- bits/sem.h | 9 +------ bits/setjmp.h | 4 +++ bits/shm.h | 29 ++++++++------------ bits/sigaction.h | 4 +++ bits/sigcontext.h | 4 +++ bits/socket.h | 9 +------ bits/stat.h | 36 +++++++++++-------------- bits/statfs.h | 12 +++------ bits/termios.h | 78 ++++++++++++++++++++++++++++-------------------------- bits/time.h | 18 +++++++------ bits/uio.h | 2 +- bits/utmp.h | 8 +----- bits/utsname.h | 22 +++++++++++++++ bits/waitflags.h | 2 +- bits/waitstatus.h | 34 ++++++++++++------------ 30 files changed, 200 insertions(+), 199 deletions(-) (limited to 'bits') diff --git a/bits/byteswap.h b/bits/byteswap.h index 9404cc452e..04a5efe9f0 100644 --- a/bits/byteswap.h +++ b/bits/byteswap.h @@ -17,8 +17,9 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _BITS_BYTESWAP_H -#define _BITS_BYTESWAP_H 1 +#if !defined _BYTESWAP_H && !defined _NETINET_IN_H +# error "Never use directly; include instead." +#endif /* Swap bytes in 16 bit value. */ #define __bswap_16(x) \ @@ -39,5 +40,3 @@ __r.__l[1] = __bswap_32 (__v.__l[0]); \ __r.__ll; }) #endif - -#endif /* bits/byteswap.h */ diff --git a/bits/confname.h b/bits/confname.h index 40228e11ed..4653887468 100644 --- a/bits/confname.h +++ b/bits/confname.h @@ -17,6 +17,10 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _UNISTD_H +# error "Never use directly; include instead." +#endif + /* Values for the NAME argument to `pathconf' and `fpathconf'. */ enum { diff --git a/bits/dirent.h b/bits/dirent.h index 2f7dca78aa..366cdf8ce2 100644 --- a/bits/dirent.h +++ b/bits/dirent.h @@ -1,5 +1,5 @@ /* Directory entry structure `struct dirent'. Stub version. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 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 @@ -17,6 +17,10 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _DIRENT_H +# error "Never use directly; include instead." +#endif + struct dirent { char d_name[1]; /* Variable length. */ diff --git a/bits/dlfcn.h b/bits/dlfcn.h index 79604fe8ff..7c33694018 100644 --- a/bits/dlfcn.h +++ b/bits/dlfcn.h @@ -17,8 +17,9 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _BITS_DLFCN_H -#define _BITS_DLFCN_H 1 +#ifndef _DLFCN_H +# error "Never use directly; include instead." +#endif /* The MODE argument to `dlopen' contains one of the following: */ #define RTLD_LAZY 0x001 /* Lazy function call binding. */ @@ -29,5 +30,3 @@ the symbols of the loaded object and its dependencies are made visible as if the object were linked directly into the program. */ #define RTLD_GLOBAL 0x100 - -#endif /* bits/dlfcn.h */ diff --git a/bits/endian.h b/bits/endian.h index 597f079a0f..45afd4ae47 100644 --- a/bits/endian.h +++ b/bits/endian.h @@ -6,4 +6,8 @@ So if cross-compiling to a machine with a different byte order, the bits/endian.h file for that machine must exist. */ +#ifndef _ENDIAN_H +# error "Never use directly; include instead." +#endif + #error Machine byte order unknown. diff --git a/bits/fenv.h b/bits/fenv.h index f45deb07c1..c42540fa61 100644 --- a/bits/fenv.h +++ b/bits/fenv.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ #ifndef _FENV_H -#error "Never use directly; include instead." +# error "Never use directly; include instead." #endif diff --git a/bits/huge_val.h b/bits/huge_val.h index 8f137d1734..0c30c86f33 100644 --- a/bits/huge_val.h +++ b/bits/huge_val.h @@ -1,6 +1,6 @@ /* Stub `HUGE_VAL' constant. Used by and functions for overflow. - Copyright (C) 1992, 1996 Free Software Foundation, Inc. + Copyright (C) 1992, 1996, 1997 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 @@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA. */ #ifndef _MATH_H -#error "Never use directly; include instead." +# error "Never use directly; include instead." #endif diff --git a/bits/in.h b/bits/in.h index 7241bd24c3..83d7ae6b10 100644 --- a/bits/in.h +++ b/bits/in.h @@ -18,8 +18,9 @@ /* Generic version. */ -#ifndef _NETINET_INBITS_H -#define _NETINET_INBITS_H 1 +#ifndef _NETINET_IN_H +# error "Never use directly; include instead." +#endif /* Link numbers. */ #define IMPLINK_IP 155 @@ -55,10 +56,10 @@ struct ip_opts /* Structure used for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. */ struct ip_mreq -{ - struct in_addr imr_multiaddr; /* IP multicast address of group */ - struct in_addr imr_interface; /* local IP address of interface */ -}; + { + struct in_addr imr_multiaddr; /* IP multicast address of group */ + struct in_addr imr_interface; /* local IP address of interface */ + }; /* IPV6 socket options. */ #define IPV6_ADDRFORM 1 @@ -80,5 +81,3 @@ struct ip_mreq #define IPV6_MULTICAST_LOOP 19 #define IPV6_ADD_MEMBERSHIP 20 #define IPV6_DROP_MEMBERSHIP 21 - -#endif /* netinet/inbits.h */ diff --git a/bits/ioctl-types.h b/bits/ioctl-types.h index 1d5c8a002f..26283a0f10 100644 --- a/bits/ioctl-types.h +++ b/bits/ioctl-types.h @@ -1,5 +1,5 @@ /* Structure types for pre-termios terminal ioctls. Generic Unix version. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 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 @@ -17,15 +17,11 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* - * Never include this file directly; use instead. - */ - -#ifndef _BITS_IOCTL_TYPES_H -#define _BITS_IOCTL_TYPES_H 1 - +#ifndef _SYS_IOCTL_H +# error "Never use directly; include instead." +#endif -#if defined(TIOCGETC) || defined(TIOCSETC) +#if defined TIOCGETC || defined TIOCSETC /* Type of ARG for TIOCGETC and TIOCSETC requests. */ struct tchars { @@ -41,7 +37,7 @@ struct tchars _IOT (_IOTS (char), 6, 0, 0, 0, 0) #endif -#if defined(TIOCGLTC) || defined(TIOCSLTC) +#if defined TIOCGLTC || defined TIOCSLTC /* Type of ARG for TIOCGLTC and TIOCSLTC requests. */ struct ltchars { @@ -70,7 +66,7 @@ struct sgttyb #define _IOT_sgttyb /* Hurd ioctl type field. */ \ _IOT (_IOTS (char), 6, _IOTS (short int), 1, 0, 0) -#if defined(TIOCGWINSZ) || defined(TIOCSWINSZ) +#if defined TIOCGWINSZ || defined TIOCSWINSZ /* Type of ARG for TIOCGWINSZ and TIOCSWINSZ requests. */ struct winsize { @@ -86,13 +82,13 @@ struct winsize _IOT (_IOTS (unsigned short int), 4, 0, 0, 0, 0) #endif -#if defined (TIOCGSIZE) || defined (TIOCSSIZE) +#if defined TIOCGSIZE || defined TIOCSSIZE /* The BSD-style ioctl constructor macros use `sizeof', which can't be used in a preprocessor conditional. Since the commands are always unique regardless of the size bits, we can safely define away `sizeof' for the purpose of the conditional. */ # define sizeof(type) 0 -# if defined (TIOCGWINSZ) && TIOCGSIZE == TIOCGWINSZ +# if defined TIOCGWINSZ && TIOCGSIZE == TIOCGWINSZ /* Many systems that have TIOCGWINSZ define TIOCGSIZE for source compatibility with Sun; they define `struct ttysize' to have identical layout as `struct winsize' and #define TIOCGSIZE to be TIOCGWINSZ @@ -116,6 +112,3 @@ struct ttysize # endif # undef sizeof /* See above. */ #endif - - -#endif /* bits/ioctl-types.h */ diff --git a/bits/ioctls.h b/bits/ioctls.h index 3b6178bfae..d3ecad9515 100644 --- a/bits/ioctls.h +++ b/bits/ioctls.h @@ -1 +1,5 @@ +#ifndef _SYS_IOCTL_H +# error "Never use directly; include instead." +#endif + /* This space intentionally left blank. */ diff --git a/bits/ipc.h b/bits/ipc.h index a5ecbd90b7..58f419be1d 100644 --- a/bits/ipc.h +++ b/bits/ipc.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , August 1995. @@ -17,10 +17,9 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _SYS_IPC_BUF_H - -#define _SYS_IPC_BUF_H 1 -#include +#ifndef _SYS_IPC_H +# error "Never use directly; include instead." +#endif #include @@ -34,23 +33,16 @@ #define IPC_SET 1 /* set `ipc_perm' options */ #define IPC_STAT 2 /* get `ipc_perm' options */ - -__BEGIN_DECLS - /* Special key values. */ #define IPC_PRIVATE ((key_t) 0) /* private key */ /* Data structure used to pass permission information to IPC operations. */ struct ipc_perm -{ - __uid_t uid; /* owner's user ID */ - __gid_t gid; /* owner's group ID */ - __uid_t cuid; /* creator's user ID */ - __gid_t cgid; /* creator's group ID */ - __mode_t mode; /* read/write permission */ -}; - -__END_DECLS - -#endif /* _SYS_IPC_BUF_H */ + { + __uid_t uid; /* owner's user ID */ + __gid_t gid; /* owner's group ID */ + __uid_t cuid; /* creator's user ID */ + __gid_t cgid; /* creator's group ID */ + __mode_t mode; /* read/write permission */ + }; diff --git a/bits/msq.h b/bits/msq.h index 37daa9bf8c..a263869a0e 100644 --- a/bits/msq.h +++ b/bits/msq.h @@ -1,6 +1,5 @@ /* Copyright (C) 1995, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , August 1995. 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 @@ -21,14 +20,11 @@ #error "Never use directly; include instead." #endif - -#include #include /* Define options for message queue functions. */ #define MSG_NOERROR 010000 /* no error if message is too big */ -__BEGIN_DECLS /* Structure of record for one message inside the kernel. The type `struct __msg' is opaque. */ @@ -43,5 +39,3 @@ struct msqid_ds __pid_t msg_lspid; /* pid of last msgsnd() */ __pid_t msg_lrpid; /* pid of last msgrcv() */ }; - -__END_DECLS diff --git a/bits/poll.h b/bits/poll.h index 55ec70e363..68f611a428 100644 --- a/bits/poll.h +++ b/bits/poll.h @@ -16,6 +16,9 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _SYS_POLL_H +# error "Never use directly; include instead." +#endif /* Event types that can be polled for. These bits may be set in `events' to indicate the interesting event types; they will appear in `revents' diff --git a/bits/resource.h b/bits/resource.h index 46cf9a7af5..d0ebeb56c8 100644 --- a/bits/resource.h +++ b/bits/resource.h @@ -17,6 +17,10 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _SYS_RESOURCE_H +# error "Never use directly; include instead." +#endif + /* These are the values for 4.4 BSD and GNU. Earlier BSD systems have a subset of these kinds of resource limit. In systems where `getrlimit' and `setrlimit' are not system calls, these are the values used by the C @@ -107,7 +111,8 @@ enum __rusage_who #define RUSAGE_CHILDREN RUSAGE_CHILDREN }; -#include /* For `struct timeval'. */ +#define __need_timeval +#include /* For `struct timeval'. */ /* Structure which says how much of each resource has been used. */ struct rusage diff --git a/bits/sched.h b/bits/sched.h index bb5da5676f..0c246c8f9a 100644 --- a/bits/sched.h +++ b/bits/sched.h @@ -1,6 +1,6 @@ /* Definitions of constants and data structure for POSIX 1003.1b-1993 scheduling interface. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 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 @@ -19,7 +19,7 @@ Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SCHED_H -#error "Never use directly; include instead." +# error "Never include directly; use instead." #endif diff --git a/bits/sem.h b/bits/sem.h index 1d3e41bd56..8b9f97c62a 100644 --- a/bits/sem.h +++ b/bits/sem.h @@ -1,6 +1,5 @@ /* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , August 1995. 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 @@ -18,11 +17,9 @@ Boston, MA 02111-1307, USA. */ #ifndef _SYS_SEM_H -#error "Never use directly; include instead." +# error "Never include directly; use instead." #endif - -#include #include /* Flags for `semop'. */ @@ -38,8 +35,6 @@ #define SETALL 17 /* set all semval's */ -__BEGIN_DECLS - /* Data structure describing a set of semaphores. */ struct semid_ds { @@ -57,5 +52,3 @@ union semun unsigned short int *array; /* array for GETALL & SETALL */ struct seminfo *__buf; /* buffer for IPC_INFO */ }; - -__END_DECLS diff --git a/bits/setjmp.h b/bits/setjmp.h index 6620e5ab15..9150d8d764 100644 --- a/bits/setjmp.h +++ b/bits/setjmp.h @@ -1,3 +1,7 @@ /* Define the machine-dependent type `jmp_buf'. Stub version. */ +#ifndef _SETJMP_H +# error "Never include directly; use instead." +#endif + typedef int __jmp_buf[1]; diff --git a/bits/shm.h b/bits/shm.h index b41d0c1e86..8c97999626 100644 --- a/bits/shm.h +++ b/bits/shm.h @@ -1,6 +1,5 @@ /* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , August 1995. 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 @@ -18,11 +17,9 @@ Boston, MA 02111-1307, USA. */ #ifndef _SYS_SHM_H -#error "Never use directly; include instead." +# error "Never include directly; use instead." #endif - -#include #include /* Flags for `shmat'. */ @@ -35,19 +32,15 @@ #define SHM_UNLOCK 12 /* unlock segment (root only) */ -__BEGIN_DECLS - /* Data structure describing a set of semaphores. */ struct shmid_ds -{ - struct ipc_perm sem_perm; /* operation permission struct */ - int shm_segsz; /* size of segment in bytes */ - __time_t sem_atime; /* time of last shmat() */ - __time_t sem_dtime; /* time of last shmdt() */ - __time_t sem_ctime; /* time of last change by shmctl() */ - __pid_t shm_cpid; /* pid of creator */ - __pid_t shm_lpid; /* pid of last shmop */ - unsigned short int shm_nattch; /* number of current attaches */ -}; - -__END_DECLS + { + struct ipc_perm sem_perm; /* operation permission struct */ + int shm_segsz; /* size of segment in bytes */ + __time_t sem_atime; /* time of last shmat() */ + __time_t sem_dtime; /* time of last shmdt() */ + __time_t sem_ctime; /* time of last change by shmctl() */ + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + unsigned short int shm_nattch; /* number of current attaches */ + }; diff --git a/bits/sigaction.h b/bits/sigaction.h index e89479bd1c..4499517b1a 100644 --- a/bits/sigaction.h +++ b/bits/sigaction.h @@ -16,6 +16,10 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _SIGNAL_H +# error "Never include directly; use instead." +#endif + /* These definitions match those used by the 4.4 BSD kernel. If the operating system has a `sigaction' system call that correctly implements the POSIX.1 behavior, there should be a system-dependent diff --git a/bits/sigcontext.h b/bits/sigcontext.h index 46e4df8c64..576fd30c37 100644 --- a/bits/sigcontext.h +++ b/bits/sigcontext.h @@ -17,6 +17,10 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _SIGNAL_H +# error "Never use directly; include instead." +#endif + /* State of this thread when the signal was taken. */ struct sigcontext { diff --git a/bits/socket.h b/bits/socket.h index af42dfac78..a2858b8de8 100644 --- a/bits/socket.h +++ b/bits/socket.h @@ -18,17 +18,12 @@ Boston, MA 02111-1307, USA. */ #ifndef _SYS_SOCKET_H -#error "Never include directly; use instead." +# error "Never include directly; use instead." #endif - -#include - #define __need_size_t #include -__BEGIN_DECLS - /* Type for length arguments in socket calls. */ typedef unsigned int socklen_t; @@ -201,5 +196,3 @@ struct linger int l_onoff; /* Nonzero to linger on close. */ int l_linger; /* Time to linger. */ }; - -__END_DECLS diff --git a/bits/stat.h b/bits/stat.h index 3648fed738..a0edf2be52 100644 --- a/bits/stat.h +++ b/bits/stat.h @@ -16,16 +16,13 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* - * Never include this file directly; use instead. - */ +#ifndef _SYS_STAT_H +# error "Never include directly; use instead." +#endif /* This structure needs to be defined in accordance with the implementation of __stat, __fstat, and __lstat. */ -#ifndef _BITS_STAT_H -#define _BITS_STAT_H 1 - #include /* Structure describing file characteristics. */ @@ -73,20 +70,17 @@ struct stat #ifdef __USE_LARGEFILE64 struct stat64 { - __dev_t st_dev; /* Device. */ - - __ino64_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __off64_t st_size; /* Size of file, in bytes. */ - - __time_t st_atime; /* Time of last access. */ - __time_t st_mtime; /* Time of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - }; -#endif + __dev_t st_dev; /* Device. */ + __ino64_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __off64_t st_size; /* Size of file, in bytes. */ -#endif /* bits/stat.h */ + __time_t st_atime; /* Time of last access. */ + __time_t st_mtime; /* Time of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + }; +#endif diff --git a/bits/statfs.h b/bits/statfs.h index 9fa3388801..a92cf52315 100644 --- a/bits/statfs.h +++ b/bits/statfs.h @@ -17,12 +17,9 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* - * Never include this file directly; use instead. - */ - -#ifndef _BITS_STATFS_H -#define _BITS_STATFS_H 1 +#ifndef _SYS_STATFS_H +# error "Never include directly; use instead." +#endif #include @@ -47,6 +44,3 @@ struct statfs unsigned int f_namelen; unsigned int f_spare[6]; }; - - -#endif /* bits/statfs.h */ diff --git a/bits/termios.h b/bits/termios.h index 9a6aed2bba..da059cbf06 100644 --- a/bits/termios.h +++ b/bits/termios.h @@ -1,5 +1,5 @@ /* termios type and macro definitions. 4.4 BSD/generic GNU version. - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1996, 1997 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 @@ -17,31 +17,35 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + /* These macros are also defined in some files (with numerically identical values), but this serves to shut up cpp's complaining. */ #ifdef __USE_BSD -#ifdef MDMBUF -#undef MDMBUF -#endif -#ifdef FLUSHO -#undef FLUSHO -#endif -#ifdef PENDIN -#undef PENDIN -#endif +# ifdef MDMBUF +# undef MDMBUF +# endif +# ifdef FLUSHO +# undef FLUSHO +# endif +# ifdef PENDIN +# undef PENDIN +# endif #endif /* __USE_BSD */ #ifdef ECHO -#undef ECHO +# undef ECHO #endif #ifdef TOSTOP -#undef TOSTOP +# undef TOSTOP #endif #ifdef NOFLSH -#undef NOFLSH +# undef NOFLSH #endif @@ -85,15 +89,15 @@ struct termios tcflag_t c_oflag; #define OPOST (1 << 0) /* Perform output processing. */ #ifdef __USE_BSD -#define ONLCR (1 << 1) /* Map NL to CR-NL on output. */ -#define OXTABS (1 << 2) /* Expand tabs to spaces. */ -#define ONOEOT (1 << 8) /* Discard EOT (^D) on output. */ +# define ONLCR (1 << 1) /* Map NL to CR-NL on output. */ +# define OXTABS (1 << 2) /* Expand tabs to spaces. */ +# define ONOEOT (1 << 8) /* Discard EOT (^D) on output. */ #endif /* Control modes. */ tcflag_t c_cflag; #ifdef __USE_BSD -#define CIGNORE (1 << 0) /* Ignore these control flags. */ +# define CIGNORE (1 << 0) /* Ignore these control flags. */ #endif #define CSIZE (CS5|CS6|CS7|CS8) /* Number of bits per byte (mask). */ #define CS5 0 /* 5 bits per byte. */ @@ -107,15 +111,15 @@ struct termios #define HUPCL (1 << 14) /* Hang up on last close. */ #define CLOCAL (1 << 15) /* Ignore modem status lines. */ #ifdef __USE_BSD -#define CCTS_OFLOW (1 << 16) /* CTS flow control of output. */ -#define CRTS_IFLOW (1 << 17) /* RTS flow control of input. */ -#define MDMBUF (1 << 20) /* Carrier flow control of output. */ +# define CCTS_OFLOW (1 << 16) /* CTS flow control of output. */ +# define CRTS_IFLOW (1 << 17) /* RTS flow control of input. */ +# define MDMBUF (1 << 20) /* Carrier flow control of output. */ #endif /* Local modes. */ tcflag_t c_lflag; #ifdef __USE_BSD -#define ECHOKE (1 << 0) /* Visual erase for KILL. */ +# define ECHOKE (1 << 0) /* Visual erase for KILL. */ #endif #define _ECHOE (1 << 1) /* Visual erase for ERASE. */ #define ECHOE _ECHOE @@ -126,15 +130,15 @@ struct termios #define _ECHONL (1 << 4) /* Echo NL even if ECHO is off. */ #define ECHONL _ECHONL #ifdef __USE_BSD -#define ECHOPRT (1 << 5) /* Hardcopy visual erase. */ -#define ECHOCTL (1 << 6) /* Echo control characters as ^X. */ +# define ECHOPRT (1 << 5) /* Hardcopy visual erase. */ +# define ECHOCTL (1 << 6) /* Echo control characters as ^X. */ #endif #define _ISIG (1 << 7) /* Enable signals. */ #define ISIG _ISIG #define _ICANON (1 << 8) /* Do erase and kill processing. */ #define ICANON _ICANON #ifdef __USE_BSD -#define ALTWERASE (1 << 9) /* Alternate WERASE algorithm. */ +# define ALTWERASE (1 << 9) /* Alternate WERASE algorithm. */ #endif #define _IEXTEN (1 << 10) /* Enable DISCARD and LNEXT. */ #define IEXTEN _IEXTEN @@ -142,9 +146,9 @@ struct termios #define _TOSTOP (1 << 22) /* Send SIGTTOU for background output. */ #define TOSTOP _TOSTOP #ifdef __USE_BSD -#define FLUSHO (1 << 23) /* Output being flushed (state). */ -#define NOKERNINFO (1 << 25) /* Disable VSTATUS. */ -#define PENDIN (1 << 29) /* Retype pending input (state). */ +# define FLUSHO (1 << 23) /* Output being flushed (state). */ +# define NOKERNINFO (1 << 25) /* Disable VSTATUS. */ +# define PENDIN (1 << 29) /* Retype pending input (state). */ #endif #define _NOFLSH (1 << 31) /* Disable flush after interrupt. */ #define NOFLSH _NOFLSH @@ -153,32 +157,32 @@ struct termios #define VEOF 0 /* End-of-file character [ICANON]. */ #define VEOL 1 /* End-of-line character [ICANON]. */ #ifdef __USE_BSD -#define VEOL2 2 /* Second EOL character [ICANON]. */ +# define VEOL2 2 /* Second EOL character [ICANON]. */ #endif #define VERASE 3 /* Erase character [ICANON]. */ #ifdef __USE_BSD -#define VWERASE 4 /* Word-erase character [ICANON]. */ +# define VWERASE 4 /* Word-erase character [ICANON]. */ #endif #define VKILL 5 /* Kill-line character [ICANON]. */ #ifdef __USE_BSD -#define VREPRINT 6 /* Reprint-line character [ICANON]. */ +# define VREPRINT 6 /* Reprint-line character [ICANON]. */ #endif #define VINTR 8 /* Interrupt character [ISIG]. */ #define VQUIT 9 /* Quit character [ISIG]. */ #define VSUSP 10 /* Suspend character [ISIG]. */ #ifdef __USE_BSD -#define VDSUSP 11 /* Delayed suspend character [ISIG]. */ +# define VDSUSP 11 /* Delayed suspend character [ISIG]. */ #endif #define VSTART 12 /* Start (X-ON) character [IXON, IXOFF]. */ #define VSTOP 13 /* Stop (X-OFF) character [IXON, IXOFF]. */ #ifdef __USE_BSD -#define VLNEXT 14 /* Literal-next character [IEXTEN]. */ -#define VDISCARD 15 /* Discard character [IEXTEN]. */ +# define VLNEXT 14 /* Literal-next character [IEXTEN]. */ +# define VDISCARD 15 /* Discard character [IEXTEN]. */ #endif #define VMIN 16 /* Minimum number of bytes read at once [!ICANON]. */ #define VTIME 17 /* Time-out value (tenths of a second) [!ICANON]. */ #ifdef __USE_BSD -#define VSTATUS 18 /* Status character [ICANON]. */ +# define VSTATUS 18 /* Status character [ICANON]. */ #endif #define NCCS 20 /* Value duplicated in . */ cc_t c_cc[NCCS]; @@ -202,8 +206,8 @@ struct termios #define B19200 19200 /* 19200 baud. */ #define B38400 38400 /* 38400 baud. */ #ifdef __USE_BSD -#define EXTA 19200 -#define EXTB 38400 +# define EXTA 19200 +# define EXTB 38400 #endif }; @@ -215,7 +219,7 @@ struct termios #define TCSADRAIN 1 /* Change when pending output is written. */ #define TCSAFLUSH 2 /* Flush pending input before changing. */ #ifdef __USE_BSD -#define TCSASOFT 0x10 /* Flag: Don't alter hardware state. */ +# define TCSASOFT 0x10 /* Flag: Don't alter hardware state. */ #endif /* Values for the QUEUE_SELECTOR argument to `tcflush'. */ diff --git a/bits/time.h b/bits/time.h index e41a991b44..cdbd39f91d 100644 --- a/bits/time.h +++ b/bits/time.h @@ -21,6 +21,16 @@ * Never include this file directly; use instead. */ +#ifndef __need_timeval +# ifndef _BITS_TIME_H +# define _BITS_TIME_H 1 + +# define CLOCKS_PER_SEC 60 + +# endif /* bits/time.h */ +#endif + + #ifdef __need_timeval # undef __need_timeval # ifndef _STRUCT_TIMEVAL @@ -34,11 +44,3 @@ struct timeval }; # endif /* struct timeval */ #endif /* need timeval */ - - -#ifndef _BITS_TIME_H -#define _BITS_TIME_H 1 - -#define CLOCKS_PER_SEC 60 - -#endif /* bits/time.h */ diff --git a/bits/uio.h b/bits/uio.h index 1a12697008..56533c1c58 100644 --- a/bits/uio.h +++ b/bits/uio.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ #ifndef _SYS_UIO_H -#error "Never use directly; include instead." +# error "Never include directly; use instead." #endif diff --git a/bits/utmp.h b/bits/utmp.h index ccc318bfa1..62817d36d1 100644 --- a/bits/utmp.h +++ b/bits/utmp.h @@ -17,12 +17,9 @@ Boston, MA 02111-1307, USA. */ #ifndef _UTMP_H -# error "Never use directly; include instead." +# error "Never include directly; use instead." #endif - -#include - #include #include @@ -31,7 +28,6 @@ #define UT_LINESIZE 8 #define UT_HOSTSIZE 16 -__BEGIN_DECLS struct lastlog { @@ -51,5 +47,3 @@ struct utmp #define _HAVE_UT_HOST 1 /* We have the ut_host field. */ - -__END_DECLS diff --git a/bits/utsname.h b/bits/utsname.h index 5594bcc4da..ea3f163cef 100644 --- a/bits/utsname.h +++ b/bits/utsname.h @@ -1,3 +1,25 @@ +/* Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _UTSNAME_H +# error "Never include directly; use instead." +#endif + /* The size of the character arrays used to hold the information in a `struct utsname'. Enlarge this as necessary. */ #define _UTSNAME_LENGTH 1024 diff --git a/bits/waitflags.h b/bits/waitflags.h index 127eb6ce4c..596df932b7 100644 --- a/bits/waitflags.h +++ b/bits/waitflags.h @@ -18,7 +18,7 @@ Boston, MA 02111-1307, USA. */ #ifndef _SYS_WAIT_H -#error "Never use directly; include instead." +# error "Never include directly; use instead." #endif diff --git a/bits/waitstatus.h b/bits/waitstatus.h index 8e97f2702c..1ec55107f9 100644 --- a/bits/waitstatus.h +++ b/bits/waitstatus.h @@ -18,7 +18,7 @@ Boston, MA 02111-1307, USA. */ #ifndef _SYS_WAIT_H -#error "Never use directly; include instead." +# error "Never include directly; use instead." #endif @@ -39,11 +39,11 @@ /* Nonzero if STATUS indicates termination by a signal. */ #ifdef __GNUC__ -#define __WIFSIGNALED(status) \ +# define __WIFSIGNALED(status) \ (__extension__ ({ int __status = (status); \ !__WIFSTOPPED(__status) && !__WIFEXITED(__status); })) #else /* Not GCC. */ -#define __WIFSIGNALED(status) (!__WIFSTOPPED(status) && !__WIFEXITED(status)) +# define __WIFSIGNALED(status) (!__WIFSTOPPED(status) && !__WIFEXITED(status)) #endif /* GCC. */ /* Nonzero if STATUS indicates the child is stopped. */ @@ -60,45 +60,45 @@ #ifdef __USE_BSD -#include +# include union wait { int w_status; struct { -#if __BYTE_ORDER == __LITTLE_ENDIAN +# if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int __w_termsig:7; /* Terminating signal. */ unsigned int __w_coredump:1; /* Set if dumped core. */ unsigned int __w_retcode:8; /* Return code if exited normally. */ unsigned int:16; -#endif /* Little endian. */ -#if __BYTE_ORDER == __BIG_ENDIAN +# endif /* Little endian. */ +# if __BYTE_ORDER == __BIG_ENDIAN unsigned int:16; unsigned int __w_retcode:8; unsigned int __w_coredump:1; unsigned int __w_termsig:7; -#endif /* Big endian. */ +# endif /* Big endian. */ } __wait_terminated; struct { -#if __BYTE_ORDER == __LITTLE_ENDIAN +# if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int __w_stopval:8; /* W_STOPPED if stopped. */ unsigned int __w_stopsig:8; /* Stopping signal. */ unsigned int:16; -#endif /* Little endian. */ -#if __BYTE_ORDER == __BIG_ENDIAN +# endif /* Little endian. */ +# if __BYTE_ORDER == __BIG_ENDIAN unsigned int:16; unsigned int __w_stopsig:8; /* Stopping signal. */ unsigned int __w_stopval:8; /* W_STOPPED if stopped. */ -#endif /* Big endian. */ +# endif /* Big endian. */ } __wait_stopped; }; -#define w_termsig __wait_terminated.__w_termsig -#define w_coredump __wait_terminated.__w_coredump -#define w_retcode __wait_terminated.__w_retcode -#define w_stopsig __wait_stopped.__w_stopsig -#define w_stopval __wait_stopped.__w_stopval +# define w_termsig __wait_terminated.__w_termsig +# define w_coredump __wait_terminated.__w_coredump +# define w_retcode __wait_terminated.__w_retcode +# define w_stopsig __wait_stopped.__w_stopsig +# define w_stopval __wait_stopped.__w_stopval #endif /* Use BSD. */ -- cgit 1.4.1