e), (__const__)) /* Test for negative number. */ __MATHDECL_PRIV (int, signbit,, (_Mdouble_ __value), (__const__)) /* Multiply-add function computed as a ternary operation. */ __MATHCALLI (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)) #endif /* Use ISO C99. */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 __END_NAMESPACE_C99 #endif #if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) \ && defined __UCLIBC_SUSV3_LEGACY__ /* Return X times (2 to the Nth power). */ __MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n)) #endif /* The `struct utmp' type, describing entries in the utmp file. GNU version. Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002 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 _UTMP_H # error "Never include directly; use instead." #endif #include #include #include #include #define UT_LINESIZE 32 #define UT_NAMESIZE 32 #define UT_HOSTSIZE 256 /* The structure describing an entry in the database of previous logins. */ struct lastlog { #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 int32_t ll_time; #else __time_t ll_time; #endif char ll_line[UT_LINESIZE]; char ll_host[UT_HOSTSIZE]; }; /* The structure describing the status of a terminated process. This type is used in `struct utmp' below. */ struct exit_status { short int e_termination; /* Process termination status. */ short int e_exit; /* Process exit status. */ }; /* The structure describing an entry in the user accounting database. */ struct utmp { short int ut_type; /* Type of login. */ pid_t ut_pid; /* Process ID of login process. */ char ut_line[UT_LINESIZE]; /* Devicename. */ char ut_id[4]; /* Inittab ID. */ char ut_user[UT_NAMESIZE]; /* Username. */ char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */ struct exit_status ut_exit; /* Exit status of a process marked as DEAD_PROCESS. */ /* The ut_session and ut_tv fields must be the same size when compiled 32- and 64-bit. This allows data files and shared memory to be shared between 32- and 64-bit applications. */ #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 int32_t ut_session; /* Session ID, used for windowing. */ struct { int32_t tv_sec; /* Seconds. */ int32_t tv_usec; /* Microseconds. */ } ut_tv; /* Time entry was made. */ #else long int ut_session; /* Session ID, used for windowing. */ struct timeval ut_tv; /* Time entry was made. */ #endif int32_t ut_addr_v6[4]; /* Internet address of remote host. */ char __unused[20]; /* Reserved for future use. */ }; /* Backwards compatibility hacks. */ #define ut_name ut_user #ifndef _NO_UT_TIME /* We have a problem here: `ut_time' is also used otherwise. Define _NO_UT_TIME if the compiler complains. */ # define ut_time ut_tv.tv_sec #endif #define ut_xtime ut_tv.tv_sec #define ut_addr ut_addr_v6[0] /* Values for the `ut_type' field of a `struct utmp'. */ #define EMPTY 0 /* No valid user accounting information. */ #define RUN_LVL 1 /* The system's runlevel. */ #define BOOT_TIME 2 /* Time of system boot. */ #define NEW_TIME 3 /* Time after system clock changed. */ #define OLD_TIME 4 /* Time when system clock changed. */ #define INIT_PROCESS 5 /* Process spawned by the init process. */ #define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ #define USER_PROCESS 7 /* Normal process. */ #define DEAD_PROCESS 8 /* Terminated process. */ #define ACCOUNTING 9 /* Old Linux name for the EMPTY type. */ #define UT_UNKNOWN EMPTY /* Tell the user that we have a modern system with UT_HOST, UT_PID, UT_TYPE, UT_ID and UT_TV fields. */ #define _HAVE_UT_TYPE 1 #define _HAVE_UT_PID 1 #define _HAVE_UT_ID 1 #define _HAVE_UT_TV 1 #define _HAVE_UT_HOST 1 /* `HUGE_VALF' constant for IEEE 754 machines (where it is infinity). Used by and functions for overflow. Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004 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 _MATH_H # error "Never use directly; include instead." #endif /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ #if __GNUC_PREREQ(3,3) # define HUGE_VALF (__builtin_huge_valf()) #elif __GNUC_PREREQ(2,96) # define HUGE_VALF (__extension__ 0x1.0p255f) #elif defined __GNUC__ # define HUGE_VALF \ (__extension__ \ ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ { __l: 0x7f800000UL }).__d) #else /* not GCC */ typedef union { unsigned char __c[4]; float __f; } __huge_valf_t; # if __BYTE_ORDER == __BIG_ENDIAN # define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } # endif # if __BYTE_ORDER == __LITTLE_ENDIAN # define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } # endif static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; # define HUGE_VALF (__huge_valf.__f) #endif /* GCC. */ /* Copyright (C) 1996, 1997, 2006 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. */ #if !defined _SYS_UIO_H && !defined _FCNTL_H # error "Never include directly; use instead." #endif #ifndef _BITS_UIO_H #define _BITS_UIO_H 1 #include /* We should normally use the Linux kernel header file to define this type and macros but this calls for trouble because of the header includes other kernel headers. */ /* Size of object which can be written atomically. This macro has different values in different kernel versions. The latest versions of the kernel use 1024 and this is good choice. Since the C library implementation of readv/writev is able to emulate the functionality even if the currently running kernel does not support this large value the readv/writev call will not fail because of this. */ #define UIO_MAXIOV 1024 #define UIO_FASTIOV 8 /* Structure for scatter/gather I/O. */ struct iovec { void *iov_base; /* Pointer to data. */ size_t iov_len; /* Length of data. */ }; #endif /* Copyright (C) 1997, 1998, 2000, 2001, 2003 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. */ /* Define the machine-dependent type `jmp_buf'. Intel 386 version. */ #ifndef _BITS_SETJMP_H #define _BITS_SETJMP_H 1 #if !defined _SETJMP_H && !defined _PTHREAD_H # error "Never include directly; use instead." #endif #if defined __USE_MISC || defined _ASM # define JB_BX 0 # define JB_SI 1 # define JB_DI 2 # define JB_BP 3 # define JB_SP 4 # define JB_PC 5 # define JB_SIZE 24 #endif #ifndef _ASM typedef int __jmp_buf[6]; #endif /* Test if longjmp to JMPBUF would unwind the frame containing a local variable at ADDRESS. */ #define _JMPBUF_UNWINDS(jmpbuf, address) \ ((void *) (address) < (void *) (jmpbuf)[JB_SP]) #endif /* bits/setjmp.h */ /* Set flags signalling availability of kernel features based on given kernel version number. Copyright (C) 1999-2003, 2004, 2005 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. */ /* This file must not contain any C code. At least it must be protected to allow using the file also in assembler files. */ #if defined __mips__ # include #endif #include #define __LINUX_KERNEL_VERSION LINUX_VERSION_CODE /* We assume for __LINUX_KERNEL_VERSION the same encoding used in linux/version.h. I.e., the major, minor, and subminor all get a byte with the major number being in the highest byte. This means we can do numeric comparisons. In the following we will define certain symbols depending on whether the describes kernel feature is available in the kernel version given by __LINUX_KERNEL_VERSION. We are not always exactly recording the correct versions in which the features were introduced. If somebody cares these values can afterwards be corrected. Most of the numbers here are set corresponding to 2.2.0. */ /* `getcwd' system call. */ #if __LINUX_KERNEL_VERSION >= 131584 # define __ASSUME_GETCWD_SYSCALL 1 #endif /* When was `poll' introduced? */ #if __LINUX_KERNEL_VERSION >= 131584 # define __ASSUME_POLL_SYSCALL 1 #endif /* Real-time signal became usable in 2.1.70. */ #if __LINUX_KERNEL_VERSION >= 131398 # define __ASSUME_REALTIME_SIGNALS 1 #endif /* When were the `pread'/`pwrite' syscalls introduced? */ #if __LINUX_KERNEL_VERSION >= 131584 # define __ASSUME_PREAD_SYSCALL 1 # define __ASSUME_PWRITE_SYSCALL 1 #endif /* When was `poll' introduced? */ #if __LINUX_KERNEL_VERSION >= 131584 # define __ASSUME_POLL_SYSCALL 1 #endif /* The `lchown' syscall was introduced in 2.1.80. */ #if __LINUX_KERNEL_VERSION >= 131408 # define __ASSUME_LCHOWN_SYSCALL 1 #endif /* When did the `setresuid' sysall became available? */ #if __LINUX_KERNEL_VERSION >= 131584 && !defined __sparc__ # define __ASSUME_SETRESUID_SYSCALL 1 #endif /* The SIOCGIFNAME ioctl is available starting with 2.1.50. */ #if __LINUX_KERNEL_VERSION >= 131408 # define __ASSUME_SIOCGIFNAME 1 #endif /* MSG_NOSIGNAL was at least available with Linux 2.2.0. */ #if __LINUX_KERNEL_VERSION >= 131584 # define __ASSUME_MSG_NOSIGNAL 1 #endif /* On x86 another `getrlimit' syscall was added in 2.3.25. */ #if __LINUX_KERNEL_VERSION >= 131865 && defined __i386__ # define __ASSUME_NEW_GETRLIMIT_SYSCALL 1 #endif /* On x86 the truncate64/ftruncate64 syscalls were introduced in 2.3.31. */ #if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__ # define __ASSUME_TRUNCATE64_SYSCALL 1 #endif /* On x86 the mmap2 syscall was introduced in 2.3.31. */ #if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__ # define __ASSUME_MMAP2_SYSCALL 1 #endif /* On x86 the stat64/lstat64/fstat64 syscalls were introduced in 2.3.34. */ #if __LINUX_KERNEL_VERSION >= 131874 && defined __i386__ # define __ASSUME_STAT64_SYSCALL 1 #endif /* On sparc and ARM the truncate64/ftruncate64/mmap2/stat64/lstat64/fstat64 syscalls were introduced in 2.3.35. */ #if __LINUX_KERNEL_VERSION >= 131875 && (defined __sparc__ || defined __arm__) # define __ASSUME_TRUNCATE64_SYSCALL 1 # define __ASSUME_MMAP2_SYSCALL 1 # define __ASSUME_STAT64_SYSCALL 1 #endif /* I know for sure that getrlimit are in 2.3.35 on powerpc. */ #if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__ # define __ASSUME_NEW_GETRLIMIT_SYSCALL 1 #endif /* I know for sure that these are in 2.3.35 on powerpc. But PowerPC64 does not support separate 64-bit syscalls, already 64-bit */ #if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__ \ && !defined __powerpc64__ # define __ASSUME_TRUNCATE64_SYSCALL 1 # define __ASSUME_STAT64_SYSCALL 1 #endif /* Linux 2.3.39 introduced 32bit UID/GIDs. Some platforms had 32 bit type all along. */ #if __LINUX_KERNEL_VERSION >= 131879 || defined __powerpc__ || defined __mips__ # define __ASSUME_32BITUIDS 1 #endif /* Linux 2.3.39 sparc added setresuid. */ #if __LINUX_KERNEL_VERSION >= 131879 && defined __sparc__ # define __ASSUME_SETRESUID_SYSCALL 1 #endif #if __LINUX_KERNEL_VERSION >= 131879 # define __ASSUME_SETRESGID_SYSCALL 1 #endif /* Linux 2.3.39 introduced IPC64. Except for powerpc. */ #if __LINUX_KERNEL_VERSION >= 131879 && !defined __powerpc__ # define __ASSUME_IPC64 1 #endif /* MIPS platforms had IPC64 all along. */ #if defined __mips__ # define __ASSUME_IPC64 1 #endif /* We can use the LDTs for threading with Linux 2.3.99 and newer. */ #if __LINUX_KERNEL_VERSION >= 131939 # define __ASSUME_LDT_WORKS 1 #endif /* Linux 2.4.0 on PPC introduced a correct IPC64. But PowerPC64 does not support a separate 64-bit sys call, already 64-bit */ #if __LINUX_KERNEL_VERSION >= 132096 && defined __powerpc__ \ && !defined __powerpc64__ # define __ASSUME_IPC64 1 #endif /* SH kernels got stat64, mmap2, and truncate64 during 2.4.0-test. */ #if __LINUX_KERNEL_VERSION >= 132096 && defined __sh__ # define __ASSUME_TRUNCATE64_SYSCALL 1 # define __ASSUME_MMAP2_SYSCALL 1 # define __ASSUME_STAT64_SYSCALL 1 #endif /* The changed st_ino field appeared in 2.4.0-test6. But we cannot distinguish this version from other 2.4.0 releases. Therefore play save and assume it available is for 2.4.1 and up. However, SH is lame, and still does not have a 64-bit inode field. */ #if __LINUX_KERNEL_VERSION >= 132097 && !defined __alpha__ && !defined __sh__ # define __ASSUME_ST_INO_64_BIT 1 #endif /* To support locking of large files a new fcntl() syscall was introduced in 2.4.0-test7. We test for 2.4.1 for the earliest version we know the syscall is available. */ #if __LINUX_KERNEL_VERSION >= 132097 && (defined __i386__ || defined __sparc__) # define __ASSUME_FCNTL64 1 #endif /* The AT_CLKTCK auxiliary vector entry was introduction in the 2.4.0 series. */ #if __LINUX_KERNEL_VERSION >= 132097 # define __ASSUME_AT_CLKTCK 1 #endif /* Arm got fcntl64 in 2.4.4, PowerPC and SH have it also in 2.4.4 (I don't know when it got introduced). But PowerPC64 does not support separate FCNTL64 call, FCNTL is already 64-bit */ #if __LINUX_KERNEL_VERSION >= 132100 \ && (defined __arm__ || defined __powerpc__ || defined __sh__) \ && !defined __powerpc64__ # define __ASSUME_FCNTL64 1 #endif /* The getdents64 syscall was introduced in 2.4.0-test7. We test for 2.4.1 for the earliest version we know the syscall is available. */ #if __LINUX_KERNEL_VERSION >= 132097 # define __ASSUME_GETDENTS64_SYSCALL 1 #endif /* When did O_DIRECTORY became available? Early in 2.3 but when? Be safe, use 2.3.99. */ #if __LINUX_KERNEL_VERSION >= 131939 # define __ASSUME_O_DIRECTORY 1 #endif /* Starting with one of the 2.4.0 pre-releases the Linux kernel passes up the page size information. */ #if __LINUX_KERNEL_VERSION >= 132097 # define __ASSUME_AT_PAGESIZE 1 #endif /* Starting with at least 2.4.0 the kernel passes the uid/gid unconditionally up to the child. */ #if __LINUX_KERNEL_VERSION >= 132097 # define __ASSUME_AT_XID 1 #endif /* Starting with 2.4.5 kernels PPC passes the AUXV in the standard way and the vfork syscall made it into the official kernel. */ #if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__ # define __ASSUME_STD_AUXV 1 # define __ASSUME_VFORK_SYSCALL 1 #endif /* Starting with 2.4.5 kernels the mmap2 syscall made it into the official kernel. But PowerPC64 does not support a separate MMAP2 call. */ #if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__ \ && !defined __powerpc64__ # define __ASSUME_MMAP2_SYSCALL 1 #endif /* Starting with 2.4.21 PowerPC implements the new prctl syscall. This allows applications to get/set the Floating Point Exception Mode. */ #if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc__ # define __ASSUME_NEW_PRCTL_SYSCALL 1 #endif /* Starting with 2.4.21 the PowerPC32 clone syscall works as expected. */ #if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc__ \ && !defined __powerpc64__ # define __ASSUME_FIXED_CLONE_SYSCALL 1 #endif /* Starting with 2.4.21 PowerPC64 implements the new rt_sigreturn syscall. The new rt_sigreturn takes an ucontext pointer allowing rt_sigreturn to be used in the set/swapcontext implementation. */ #if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc64__ # define __ASSUME_NEW_RT_SIGRETURN_SYSCALL 1 #endif /* On x86, the set_thread_area syscall was introduced in 2.5.29, but its semantics was changed in 2.5.30, and again after 2.5.31. */ #if __LINUX_KERNEL_VERSION >= 132384 && defined __i386__ # define __ASSUME_SET_THREAD_AREA_SYSCALL 1 #endif /* The vfork syscall on x86 and arm was definitely available in 2.4. */ #if __LINUX_KERNEL_VERSION >= 132097 && (defined __i386__ || defined __arm__) # define __ASSUME_VFORK_SYSCALL 1 #endif /* There are an infinite number of PA-RISC kernel versions numbered 2.4.0. But they've not really been released as such. We require and expect the final version here. */ #ifdef __hppa__ # define __ASSUME_32BITUIDS 1 # define __ASSUME_TRUNCATE64_SYSCALL 1 # define __ASSUME_MMAP2_SYSCALL 1 # define __ASSUME_STAT64_SYSCALL 1 # define __ASSUME_IPC64 1 # define __ASSUME_ST_INO_64_BIT 1 # define __ASSUME_FCNTL64 1 # define __ASSUME_GETDENTS64_SYSCALL 1 #endif /* Alpha switched to a 64-bit timeval sometime before 2.2.0. */ #if __LINUX_KERNEL_VERSION >= 131584 && defined __alpha__ # define __ASSUME_TIMEVAL64 1 #endif #if defined __mips__ && _MIPS_SIM == _ABIN32 # define __ASSUME_FCNTL64 1 #endif /* The late 2.5 kernels saw a lot of new CLONE_* flags. Summarize their availability with one define. The changes were made first for i386 and the have to be done separately for the other archs. For i386 we pick 2.5.50 as the first version with support. */ #if __LINUX_KERNEL_VERSION >= 132402 && defined __i386__ # define __ASSUME_CLONE_THREAD_FLAGS 1 #endif /* Support for various CLOEXEC and NONBLOCK flags was added for x86, x86-64, PPC, IA-64, SPARC< and S390 in 2.6.23. */ #if __LINUX_KERNEL_VERSION >= 0x020617 \ && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \ || defined __ia64__ || defined __sparc__ || defined __s390__) # define __ASSUME_O_CLOEXEC 1 #endif /* These features were surely available with 2.4.12. */ #if __LINUX_KERNEL_VERSION >= 132108 && defined __mc68000__ # define __ASSUME_MMAP2_SYSCALL 1 # define __ASSUME_TRUNCATE64_SYSCALL 1 # define __ASSUME_STAT64_SYSCALL 1 # define __ASSUME_FCNTL64 1 # define __ASSUME_VFORK_SYSCALL 1 #endif /* Beginning with 2.5.63 support for realtime and monotonic clocks and timers based on them is available. */ #if __LINUX_KERNEL_VERSION >= 132415 # define __ASSUME_POSIX_TIMERS 1 #endif /* Beginning with 2.6.12 the clock and timer supports CPU clocks. */ #if __LINUX_KERNEL_VERSION >= 0x2060c # define __ASSUME_POSIX_CPU_TIMERS 1 #endif /* The late 2.5 kernels saw a lot of new CLONE_* flags. Summarize their availability with one define. The changes were made first for i386 and the have to be done separately for the other archs. For ia64, s390*, PPC, x86-64 we pick 2.5.64 as the first version with support. */ #if __LINUX_KERNEL_VERSION >= 132416 \ && (defined __ia64__ || defined __s390__ || defined __powerpc__ \ || defined __x86_64__ || defined __sh__) # define __ASSUME_CLONE_THREAD_FLAGS 1 #endif /* With kernel 2.4.17 we alwaysÙÚÛÜÝ have netlink support. */ #if __LINUX_KERNEL_VERSION >= (132096+17) # define __ASSUME_NETLINK_SUPPORT 1 #endif /* The requeue futex functionality was introduced in 2.5.70. */ #if __LINUX_KERNEL_VERSION >= 132422 # define __ASSUME_FUTEX_REQUEUE 1 #endif /* The statfs64 syscalls are available in 2.5.74. */ #if __LINUX_KERNEL_VERSION >= 132426 # define __ASSUME_STATFS64 1 #endif /* Starting with at least 2.5.74 the kernel passes the setuid-like exec flag unconditionally up to the child. */ #if __LINUX_KERNEL_VERSION >= 132426 # define __ASSUME_AT_SECURE 1 #endif /* Starting with the 2.5.75 kernel the kernel fills in the correct value in the si_pid field passed as part of the siginfo_t struct to signal handlers. */ #if __LINUX_KERNEL_VERSION >= 132427 # define __ASSUME_CORRECT_SI_PID 1 #endif /* The tgkill syscall was instroduced for i386 in 2.5.75. For Alpha it was introduced in 2.6.0-test1 which unfortunately cannot be distinguished from 2.6.0. On x86-64, ppc, and ppc64 it was introduced in 2.6.0-test3. */ #if (__LINUX_KERNEL_VERSION >= 132427 && defined __i386__) \ || (__LINUX_KERNEL_VERSION >= 132609 && defined __alpha__) \ || (__LINUX_KERNEL_VERSION >= 132609 && defined __x86_64__) \ || (__LINUX_KERNEL_VERSION >= 132609 && defined __powerpc__) \ || (__LINUX_KERNEL_VERSION >= 132609 && defined __sh__) # define __ASSUME_TGKILL 1 #endif /* The utimes syscall has been available for some architectures forever. For x86 it was introduced after 2.5.75, for x86-64, ppc, and ppc64 it was introduced in 2.6.0-test3. */ #if defined __alpha__ || defined __ia64__ || defined __hppa__ \ || defined __sparc__ \ || (__LINUX_KERNEL_VERSION > 132427 && defined __i386__) \ || (__LINUX_KERNEL_VERSION > 132609 && defined __x86_64__) \ || (__LINUX_KERNEL_VERSION >= 132609 && defined __powerpc__) \ || (__LINUX_KERNEL_VERSION >= 132609 && defined __sh__) # define __ASSUME_UTIMES 1 #endif // XXX Disabled for now since the semantics we want is not achieved. #if 0 /* The CLONE_STOPPED flag was introduced in the 2.6.0-test1 series. */ #if __LINUX_KERNEL_VERSION >= 132609 # define __ASSUME_CLONE_STOPPED 1 #endif #endif /* The fixed version of the posix_fadvise64 syscall appeared in 2.6.0-test3. At least for x86. Powerpc support appeared in 2.6.2, but for 32-bit userspace only. */ #if (__LINUX_KERNEL_VERSION >= 132609 && defined __i386__) \ || (__LINUX_KERNEL_VERSION >= 132610 && defined __powerpc__ \ && !defined __powerpc64__) # define __ASSUME_FADVISE64_64_SYSCALL 1 #endif /* The PROT_GROWSDOWN/PROT_GROWSUP flags were introduced in the 2.6.0-test series. */ #if __LINUX_KERNEL_VERSION >= 132609 # define __ASSUME_PROT_GROWSUPDOWN 1 #endif /* Starting with 2.6.0 PowerPC adds signal/swapcontext support for Vector SIMD (AKA Altivec, VMX) instructions and register state. This changes the overall size of the sigcontext and adds the swapcontext syscall. */ #if __LINUX_KERNEL_VERSION >= 132608 && defined __powerpc__ # define __ASSUME_SWAPCONTEXT_SYSCALL 1 #endif /* The CLONE_DETACHED flag is not necessary in 2.6.2 kernels, it is implied. */ #if __LINUX_KERNEL_VERSION >= 132610 # define __ASSUME_NO_CLONE_DETACHED 1 #endif /* Starting with version 2.6.4-rc1 the getdents syscall returns d_type information as well and in between 2.6.5 and 2.6.8 most compat wrappers were fixed too. Except s390{,x} which was fixed in 2.6.11. */ #if (__LINUX_KERNEL_VERSION >= 0x020608 && !defined __s390__) \ || (__LINUX_KERNEL_VERSION >= 0x02060b && defined __s390__) # define __ASSUME_GETDENTS32_D_TYPE 1 #endif /* Starting with version 2.5.3, the initial location returned by `brk' after exec is always rounded up to the next page. */ #if __LINUX_KERNEL_VERSION >= 132355 # define __ASSUME_BRK_PAGE_ROUNDED 1 #endif /* Starting with version 2.6.9, the waitid system call is available. Except for powerpc and powerpc64, where it is available in 2.6.12. */ #if (__LINUX_KERNEL_VERSION >= 0x020609 && !defined __powerpc__) \ || (__LINUX_KERNEL_VERSION >= 0x02060c && defined __powerpc__) # define __ASSUME_WAITID_SYSCALL 1 #endif /* Starting with version 2.6.9, SSI_IEEE_RAISE_EXCEPTION exists. */ #if __LINUX_KERNEL_VERSION >= 0x020609 && defined __alpha__ #define __ASSUME_IEEE_RAISE_EXCEPTION 1 #endif /* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29. */ #if __LINUX_KERNEL_VERSION >= 0x02061d # define __ASSUME_FUTEX_CLOCK_REALTIME 1 #endif /* Support for PI futexes was added in 2.6.18. */ #if __LINUX_KERNEL_VERSION >= 0x020612 # define __ASSUME_FUTEX_LOCK_PI 1 #endif /* Support for private futexes was added in 2.6.22. */ #if __LINUX_KERNEL_VERSION >= 0x020616 # define __ASSUME_PRIVATE_FUTEX 1 #endif /* Declarations for getopt. Copyright (C) 1989-1994,1996-1999,2001,2003,2004 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 _GETOPT_H #include #ifndef __need_getopt # define _GETOPT_H 1 #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifndef __THROW # ifndef __GNUC_PREREQ # define __GNUC_PREREQ(maj, min) (0) # endif # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # else # define __THROW # endif #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #if defined __GNU_LIBRARY__ || defined __UCLIBC__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW; #else /* not __GNU_LIBRARY__ */ extern int getopt (); #endif /* __GNU_LIBRARY__ */ #if defined __UCLIBC_HAS_GNU_GETOPT__ || defined __UCLIBC_HAS_GETOPT_LONG__ #ifndef __need_getopt extern int getopt_long (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; extern int getopt_long_only (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; #endif #endif #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ /* Signal number definitions. Linux version. Copyright (C) 1995,1996,1997,1998,1999,2003 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. */ #ifdef _SIGNAL_H #define SIGHUP 1 /* Hangup (POSIX). */ #define SIGINT 2 /* Interrupt (ANSI). */ #define SIGQUIT 3 /* Quit (POSIX). */ #define SIGILL 4 /* Illegal instruction (ANSI). */ #define SIGTRAP 5 /* Trace trap (POSIX). */ #define SIGABRT 6 /* Abort (ANSI). */ #define SIGIOT 6 /* IOT trap (4.2 BSD). */ #define SIGBUS 7 /* BUS error (4.2 BSD). */ #define SIGFPE 8 /* Floating-point exception (ANSI). */ #define SIGKILL 9 /* Kill, unblockable (POSIX). */ #define SIGUSR1 10 /* User-defined signal 1 (POSIX). */ #define SIGSEGV 11 /* Segmentation violation (ANSI). */ #define SIGUSR2 12 /* User-defined signal 2 (POSIX). */ #define SIGPIPE 13 /* Broken pipe (POSIX). */ #define SIGALRM 14 /* Alarm clock (POSIX). */ #define SIGTERM 15 /* Termination (ANSI). */ #define SIGSTKFLT 16 /* Stack fault. */ #define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ #define SIGCHLD 17 /* Child status has changed (POSIX). */ #define SIGCONT 18 /* Continue (POSIX). */ #define SIGSTOP 19 /* Stop, unblockable (POSIX). */ #define SIGTSTP 20 /* Keyboard stop (POSIX). */ #define SIGTTIN 21 /* Background read from tty (POSIX). */ #define SIGTTOU 22 /* Background write to tty (POSIX). */ #define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */ #define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ #define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ #define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ #define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ #define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ #define SIGPOLL SIGIO /* Pollable event occurred (System V). */ #define SIGIO 29 /* I/O now possible (4.2 BSD). */ #define SIGPWR 30 /* Power failure restart (System V). */ #define SIGSYS 31 /* Bad system call. */ #define SIGUNUSED 31 #endif /* included. */ /* Copyright (C) 2004 Erik Andersen * * This 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. */ /* Supply an architecture specific value for PAGE_SIZE and friends. */ #ifndef _UCLIBC_PAGE_H #define _UCLIBC_PAGE_H /* PAGE_SHIFT determines the page size -- in this case 4096 */ #define PAGE_SHIFT 12 #define PAGE_SIZE (1UL << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) #endif /* _UCLIBC_PAGE_H */ /* bits/types.h -- definitions of __*_t types underlying *_t types. Copyright (C) 2002, 2003, 2004, 2005 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. */ /* * Never include this file directly; use instead. */ #ifndef _BITS_TYPES_H #define _BITS_TYPES_H 1 #include #include #define __need_size_t #include /* Convenience types. */ typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; /* Fixed-size types, underlying types depend on word size and compiler. */ typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; #if __WORDSIZE == 64 typedef signed long int __int64_t; typedef unsigned long int __uint64_t; #elif defined(__GNUC__) __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; #endif /* quad_t is also 64 bits. */ #if __WORDSIZE == 64 typedef long int __quad_t; typedef unsigned long int __u_quad_t; #elif defined(__GNUC__) __extension__ typedef long long int __quad_t; __extension__ typedef unsigned long long int __u_quad_t; #else typedef struct { long __val[2]; } __quad_t; typedef struct { __u_long __val[2]; } __u_quad_t; #endif /* The machine-dependent file defines __*_T_TYPE macros for each of the OS types we define below. The definitions of those macros must use the following macros for underlying types. We define __S_TYPE and __U_TYPE for the signed and unsigned variants of each of the following integer types on this machine. 16 -- "natural" 16-bit type (always short) 32 -- "natural" 32-bit type (always int) 64 -- "natural" 64-bit type (long or long long) LONG32 -- 32-bit type, traditionally long QUAD -- 64-bit type, always long long WORD -- natural type of __WORDSIZE bits (int or long) LONGWORD -- type of __WORDSIZE bits, traditionally long We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the conventional uses of `long' or `long long' type modifiers match the types we define, even when a less-adorned type would be the same size. This matters for (somewhat) portably writing printf/scanf formats for these types, where using the appropriate l or ll format modifiers can make the typedefs and the formats match up across all GNU platforms. If we used `long' when it's 64 bits where `long long' is expected, then the compiler would warn about the formats not matching the argument types, and the programmer changing them to shut up the compiler would break the program's portability. Here we assume what is presently the case in all the GCC configurations we support: long long is always 64 bits, long is always word/address size, and int is always 32 bits. */ #define __S16_TYPE short int #define __U16_TYPE unsigned short int #define __S32_TYPE int #define __U32_TYPE unsigned int #define __SLONGWORD_TYPE long int #define __ULONGWORD_TYPE unsigned long int #if __WORDSIZE == 32 # define __SQUAD_TYPE __quad_t # define __UQUAD_TYPE __u_quad_t # define __SWORD_TYPE int # define __UWORD_TYPE unsigned int # define __SLONG32_TYPE long int # define __ULONG32_TYPE unsigned long int # define __S64_TYPE __quad_t # define __U64_TYPE __u_quad_t /* We want __extension__ before typedef's that use nonstandard base types such as `long long' in C89 mode. */ # define __STD_TYPE __extension__ typedef #elif __WORDSIZE == 64 # define __SQUAD_TYPE long int # define __UQUAD_TYPE unsigned long int # define __SWORD_TYPE long int # define __UWORD_TYPE unsigned long int # define __SLONG32_TYPE int # define __ULONG32_TYPE unsigned int # define __S64_TYPE long int # define __U64_TYPE unsigned long int /* No need to mark the typedef with __extension__. */ # define __STD_TYPE typedef #else # error your machine is neither 32 bit or 64 bit ... it must be magical #endif #include /* Defines __*_T_TYPE macros. */ __STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */ __STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */ __STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */ __STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */ __STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/ __STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */ __STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */ __STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */ __STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */ __STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */ __STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */ __STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */ __STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */ __STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */ __STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */ __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ __STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ __STD_TYPE __SWBLK_T_TYPE __swblk_t; /* Type of a swap block maybe? */ __STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ /* Clock ID used in clock and timer functions. */ __STD_TYPE __CLOCKID_T_TYPE __clockid_t; /* Timer ID returned by `timer_create'. */ __STD_TYPE __TIMER_T_TYPE __timer_t; /* Type to represent block size. */ __STD_TYPE __BLKSIZE_T_TYPE __blksize_t; /* Types from the Large File Support interface. */ /* Type to count number of disk blocks. */ __STD_TYPE __BLKCNT_T_TYPE __blkcnt_t; __STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t; /* Type to count file system blocks. */ __STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t; __STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t; /* Type to count file system nodes. */ __STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t; __STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t; __STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */ /* These few don't really vary by system, they always correspond to one of the other defined types. */ typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */ typedef __quad_t *__qaddr_t; typedef char *__caddr_t; /* Duplicates info from stdint.h but this is used in unistd.h. */ __STD_TYPE __SWORD_TYPE __intptr_t; /* Duplicate info from sys/socket.h. */ __STD_TYPE __U32_TYPE __socklen_t; #undef __STD_TYPE /* Now add the thread types. */ #if defined __UCLIBC_HAS_THREADS__ && (defined __USE_POSIX199506 || defined __USE_UNIX98) # include #endif #endif /* bits/types.h */ /* System-dependent timing definitions. Generic version. Copyright (C) 1996,1997,1999-2002,2003 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. */ /* * Never include this file directly; use instead. */ #ifndef __need_timeval # ifndef _BITS_TIME_H # define _BITS_TIME_H 1 /* ISO/IEC 9899:1990 7.12.1: The macro `CLOCKS_PER_SEC' is the number per second of the value returned by the `clock' function. */ /* CAE XSH, Issue 4, Version 2: The value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems. */ # define CLOCKS_PER_SEC 1000000l /* Get the arch-specific value of __UCLIBC_CLK_TCK_CONST used for CLK_TCK * in sysconf() and clock(). */ #include # if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK presents the real value for clock ticks per second for the system. */ # include /* Note (uClibc): glibc #defines CLK_TCK as a sysconf() call. */ # define CLK_TCK ((__clock_t) __UCLIBC_CLK_TCK_CONST) # endif # ifdef __USE_POSIX199309 /* Identifier for system-wide realtime clock. */ # define CLOCK_REALTIME 0 /* Monotonic system-wide clock. */ # define CLOCK_MONOTONIC 1 /* High-resolution timer from the CPU. */ # define CLOCK_PROCESS_CPUTIME_ID 2 /* Thread-specific CPU-time clock. */ # define CLOCK_THREAD_CPUTIME_ID 3 /* Flag to indicate time is absolute. */ # define TIMER_ABSTIME 1 # endif # endif /* bits/time.h */ #endif #ifdef __need_timeval # undef __need_timeval # ifndef _STRUCT_TIMEVAL # define _STRUCT_TIMEVAL 1 # include /* A time value that is accurate to the nearest microsecond but also has a range of years. */ struct timeval { __time_t tv_sec; /* Seconds. */ __suseconds_t tv_usec; /* Microseconds. */ }; # endif /* struct timeval */ #endif /* need timeval */ /* Copyright (C) 2002 Manuel Novoa III * * This 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. */ /* ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION! * * Besides uClibc, I'm using this code in my libc for elks, which is * a 16-bit environment with a fairly limited compiler. It would make * things much easier for me if this file isn't modified unnecessarily. * In particular, please put any new or replacement functions somewhere * else, and modify the makefile to use your version instead. * Thanks. Manuel * * ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION! */ #if !defined(_CTYPE_H) && !defined(_WCTYPE_H) #error Always include <{w}ctype.h> rather than #endif #ifndef _BITS_UCLIBC_CTYPE_H #define _BITS_UCLIBC_CTYPE_H /* Define some ctype macros valid for the C/POSIX locale. */ /* ASCII ords of \t, \f, \n, \r, and \v are 9, 12, 10, 13, 11 respectively. */ #define __C_isspace(c) \ ((sizeof(c) == sizeof(char)) \ ? ((((c) == ' ') || (((unsigned char)((c) - 9)) <= (13 - 9)))) \ : ((((c) == ' ') || (((unsigned int)((c) - 9)) <= (13 - 9))))) #define __C_isblank(c) (((c) == ' ') || ((c) == '\t')) #define __C_isdigit(c) \ ((sizeof(c) == sizeof(char)) \ ? (((unsigned char)((c) - '0')) < 10) \ : (((unsigned int)((c) - '0')) < 10)) #define __C_isxdigit(c) \ (__C_isdigit(c) \ || ((sizeof(c) == sizeof(char)) \ ? (((unsigned char)((((c)) | 0x20) - 'a')) < 6) \ : (((unsigned int)((((c)) | 0x20) - 'a')) < 6))) #define __C_iscntrl(c) \ ((sizeof(c) == sizeof(char)) \ ? ((((unsigned char)(c)) < 0x20) || ((c) == 0x7f)) \ : ((((unsigned int)(c)) < 0x20) || ((c) == 0x7f))) #define __C_isalpha(c) \ ((sizeof(c) == sizeof(char)) \ ? (((unsigned char)(((c) | 0x20) - 'a')) < 26) \ : (((unsigned int)(((c) | 0x20) - 'a')) < 26)) #define __C_isalnum(c) (__C_isalpha(c) || __C_isdigit(c)) #define __C_isprint(c) \ ((sizeof(c) == sizeof(char)) \ ? (((unsigned char)((c) - 0x20)) <= (0x7e - 0x20)) \ : (((unsigned int)((c) - 0x20)) <= (0x7e - 0x20))) #define __C_islower(c) \ ((sizeof(c) == sizeof(char)) \ ? (((unsigned char)((c) - 'a')) < 26) \ : (((unsigned int)((c) - 'a')) < 26)) #define __C_isupper(c) \ ((sizeof(c) == sizeof(char)) \ ? (((unsigned char)((c) - 'A')) < 26) \ : (((unsigned int)((c) - 'A')) < 26)) #define __C_ispunct(c) \ ((!__C_isalnum(c)) \ && ((sizeof(c) == sizeof(char)) \ ? (((unsigned char)((c) - 0x21)) <= (0x7e - 0x21)) \ : (((unsigned int)((c) - 0x21)) <= (0x7e - 0x21)))) #define __C_isgraph(c) \ ((sizeof(c) == sizeof(char)) \ ? (((unsigned char)((c) - 0x21)) <= (0x7e - 0x21)) \ : (((unsigned int)((c) - 0x21)) <= (0x7e - 0x21))) #define __C_tolower(c) (__C_isupper(c) ? ((c) | 0x20) : (c)) #define __C_toupper(c) (__C_islower(c) ? ((c) ^ 0x20) : (c)) /**********************************************************************/ __BEGIN_DECLS /* Now some non-ansi/iso c99 macros. */ #ifdef __UCLIBC_SUSV4_LEGACY__ #define __isascii(c) (((c) & ~0x7f) == 0) #define __toascii(c) ((c) & 0x7f) /* Works correctly *only* on lowercase letters! */ #define _toupper(c) ((c) ^ 0x20) /* Works correctly *only* on letters (of any case) and numbers */ #define _tolower(c) ((c) | 0x20) #endif __END_DECLS /**********************************************************************/ #ifdef __GNUC__ # define __body_C_macro(f,args) __C_ ## f args # define __body(f,c) \ (__extension__ ({ \ int __res; \ if (sizeof(c) > sizeof(char)) { \ int __c = (c); \ __res = __body_C_macro(f,(__c)); \ } else { \ unsigned char __c = (c); \ __res = __body_C_macro(f,(__c)); \ } \ __res; \ })) # define __isspace(c) __body(isspace,c) # define __isblank(c) __body(isblank,c) # define __isdigit(c) __body(isdigit,c) # define __isxdigit(c) __body(isxdigit,c) # define __iscntrl(c) __body(iscntrl,c) # define __isalpha(c) __body(isalpha,c) # define __isalnum(c) __body(isalnum,c) # define __isprint(c) __body(isprint,c) # define __islower(c) __body(islower,c) # define __isupper(c) __body(isupper,c) # define __ispunct(c) __body(ispunct,c) # define __isgraph(c) __body(isgraph,c) /*locale-aware ctype.h has no __tolower, why stub locale *tries to have it? remove after 0.9.31 *# define __tolower(c) __body(tolower,c) *# define __toupper(c) __body(toupper,c) */ /* Do not combine in one #if - unifdef tool is not that clever */ # ifndef __cplusplus # define isspace(c) __isspace(c) # define isblank(c) __isblank(c) # define isdigit(c) __isdigit(c) # define isxdigit(c) __isxdigit(c) # define iscntrl(c) __iscntrl(c) # define isalpha(c) __isalpha(c) # define isalnum(c) __isalnum(c) # define isprint(c) __isprint(c) # define islower(c) __islower(c) # define isupper(c) __isupper(c) # define ispunct(c) __ispunct(c) # define isgraph(c) __isgraph(c) # define tolower(c) __body(tolower,c) # define toupper(c) __body(toupper,c) # endif #else /* !_GNUC__ */ # ifndef __cplusplus /* These macros should be safe from side effects! * (not all __C_xxx macros are) */ # define isdigit(c) __C_isdigit(c) # define isalpha(c) __C_isalpha(c) # define isprint(c) __C_isprint(c) # define islower(c) __C_islower(c) # define isupper(c) __C_isupper(c) # define isgraph(c) __C_isgraph(c) # endif #endif /* __GNUC__ */ /**********************************************************************/ #endif /* _BITS_UCLIBC_CTYPE_H */ /* Copyright (C) 1997, 1998, 1999, 2000, 2004 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. */ #if !defined _MATH_H && !defined _COMPLEX_H # error "Never use directly; include instead" #endif #if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF # define _MATH_H_MATHDEF 1 # if defined __FLT_EVAL_METHOD__ && __FLT_EVAL_METHOD__ == 0 /* When using -mfpmath=sse, values are computed with the precission of the used type. */ typedef float float_t; /* `float' expressions are evaluated as `float'. */ typedef double double_t; /* `double' expressions are evaluated as `double'. */ # else /* The ix87 FPUs evaluate all values in the 80 bit floating-point format which is also available for the user as `long double'. Therefore we define: */ typedef long double float_t; /* `float' expressions are evaluated as `long double'. */ typedef long double double_t; /* `double' expressions are evaluated as `long double'. */ # endif /* The values returned by `ilogb' for 0 and NaN respectively. */ # define FP_ILOGB0 (-2147483647 - 1) # define FP_ILOGBNAN (-2147483647 - 1) #endif /* ISO C99 */ #if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ # define __NO_LONG_DOUBLE_MATH 1 #endif /* Macros to swap the order of bytes in integer values. Copyright (C) 1997,1998,2000,2001,2002,2005 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. */ #if !defined _BYTESWAP_H && !defined _NETINET_IN_H # error "Never use dire