diff options
| author | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 18:26:36 +0000 |
|---|---|---|
| committer | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 18:26:36 +0000 |
| commit | 0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (patch) | |
| tree | 2ea1f8305970753e4a657acb2ccc15ca3eec8e2c /include | |
| parent | 7d58530341304d403a6626d7f7a1913165fe2f32 (diff) | |
| download | glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.xz glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.zip | |
2.5-18.1
Diffstat (limited to 'include')
58 files changed, 666 insertions, 375 deletions
diff --git a/include/aio.h b/include/aio.h index e3dc86f99a..be40c0bcef 100644 --- a/include/aio.h +++ b/include/aio.h @@ -1,6 +1,12 @@ #ifndef _AIO_H #include <rt/aio.h> -/* Now define the internal interfaces. */ +/* Now define the internal interfaces. */ extern void __aio_init (__const struct aioinit *__init); + +/* Flag to signal we need to be compatible with glibc < 2.4 in + lio_listio and we do not issue events for each individual list + element. */ +#define LIO_NO_INDIVIDUAL_EVENT 128 + #endif diff --git a/include/alloca.h b/include/alloca.h index de541f4e5a..563d7868bd 100644 --- a/include/alloca.h +++ b/include/alloca.h @@ -42,7 +42,7 @@ extern int __libc_alloca_cutoff (size_t size) __attribute__ ((const)); len = __newlen; \ __newbuf; }) #else -# define extern_alloca(buf, len, newlen) \ +# define extend_alloca(buf, len, newlen) \ __alloca (((len) = (newlen))) #endif diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h index 944fe732a6..efbe956602 100644 --- a/include/arpa/nameser.h +++ b/include/arpa/nameser.h @@ -1 +1,46 @@ #include <resolv/arpa/nameser.h> + +/* If the machine allows unaligned access we can do better than using + the NS_GET16, NS_GET32, NS_PUT16, and NS_PUT32 macros from the + installed header. */ +#include <string.h> +#include <stdint.h> +#include <netinet/in.h> + +extern struct _ns_flagdata _ns_flagdata[] attribute_hidden; + +#if _STRING_ARCH_unaligned + +# undef NS_GET16 +# define NS_GET16(s, cp) \ + do { \ + uint16_t *t_cp = (uint16_t *) (cp); \ + (s) = ntohs (*t_cp); \ + (cp) += NS_INT16SZ; \ + } while (0) + +# undef NS_GET32 +# define NS_GET32(l, cp) \ + do { \ + uint32_t *t_cp = (uint32_t *) (cp); \ + (l) = ntohl (*t_cp); \ + (cp) += NS_INT32SZ; \ + } while (0) + +# undef NS_PUT16 +# define NS_PUT16(s, cp) \ + do { \ + uint16_t *t_cp = (uint16_t *) (cp); \ + *t_cp = htons (s); \ + (cp) += NS_INT16SZ; \ + } while (0) + +# undef NS_PUT32 +# define NS_PUT32(l, cp) \ + do { \ + uint32_t *t_cp = (uint32_t *) (cp); \ + *t_cp = htonl (l); \ + (cp) += NS_INT32SZ; \ + } while (0) + +#endif diff --git a/include/atomic.h b/include/atomic.h index 8a23f6ee9e..d44728b215 100644 --- a/include/atomic.h +++ b/include/atomic.h @@ -1,5 +1,5 @@ /* Internal macros for atomic operations for GNU C Library. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -108,7 +108,7 @@ __typeof (*(mem)) __value = (newvalue); \ \ do \ - __oldval = (*__memp); \ + __oldval = *__memp; \ while (__builtin_expect (atomic_compare_and_exchange_bool_acq (__memp, \ __value, \ __oldval),\ @@ -130,7 +130,7 @@ __typeof (*(mem)) __value = (value); \ \ do \ - __oldval = (*__memp); \ + __oldval = *__memp; \ while (__builtin_expect (atomic_compare_and_exchange_bool_acq (__memp, \ __oldval \ + __value,\ @@ -141,6 +141,41 @@ #endif + +#ifndef atomic_max +# define atomic_max(mem, value) \ + do { \ + __typeof (*(mem)) __oldval; \ + __typeof (mem) __memp = (mem); \ + __typeof (*(mem)) __value = (value); \ + do { \ + __oldval = *__memp; \ + if (__oldval >= __value) \ + break; \ + } while (__builtin_expect (atomic_compare_and_exchange_bool_acq (__memp, \ + __value, \ + __oldval),\ + 0)); \ + } while (0) +#endif + +#ifndef atomic_min +# define atomic_min(mem, value) \ + do { \ + __typeof (*(mem)) __oldval; \ + __typeof (mem) __memp = (mem); \ + __typeof (*(mem)) __value = (value); \ + do { \ + __oldval = *__memp; \ + if (__oldval <= __value) \ + break; \ + } while (__builtin_expect (atomic_compare_and_exchange_bool_acq (__memp, \ + __value, \ + __oldval),\ + 0)); \ + } while (0) +#endif + #ifndef atomic_add # define atomic_add(mem, value) (void) atomic_exchange_and_add ((mem), (value)) #endif @@ -238,6 +273,41 @@ __oldval & __mask; }) #endif +/* Atomically *mem &= mask and return the old value of *mem. */ +#ifndef atomic_and +# define atomic_and(mem, mask) \ + ({ __typeof (*(mem)) __oldval; \ + __typeof (mem) __memp = (mem); \ + __typeof (*(mem)) __mask = (mask); \ + \ + do \ + __oldval = (*__memp); \ + while (__builtin_expect (atomic_compare_and_exchange_bool_acq (__memp, \ + __oldval \ + & __mask, \ + __oldval),\ + 0)); \ + \ + __oldval; }) +#endif + +/* Atomically *mem |= mask and return the old value of *mem. */ +#ifndef atomic_or +# define atomic_or(mem, mask) \ + ({ __typeof (*(mem)) __oldval; \ + __typeof (mem) __memp = (mem); \ + __typeof (*(mem)) __mask = (mask); \ + \ + do \ + __oldval = (*__memp); \ + while (__builtin_expect (atomic_compare_and_exchange_bool_acq (__memp, \ + __oldval \ + | __mask, \ + __oldval),\ + 0)); \ + \ + __oldval; }) +#endif #ifndef atomic_full_barrier # define atomic_full_barrier() __asm ("" ::: "memory") @@ -254,6 +324,12 @@ #endif +#ifndef atomic_forced_read +# define atomic_forced_read(x) \ + ({ __typeof (x) __x; __asm ("" : "=r" (__x) : "0" (x)); __x; }) +#endif + + #ifndef atomic_delay # define atomic_delay() do { /* nothing */ } while (0) #endif diff --git a/include/bits/socket2.h b/include/bits/socket2.h new file mode 100644 index 0000000000..a81fd9fa78 --- /dev/null +++ b/include/bits/socket2.h @@ -0,0 +1 @@ +#include <socket/bits/socket2.h> diff --git a/include/bits/stdlib-ldbl.h b/include/bits/stdlib-ldbl.h new file mode 100644 index 0000000000..62509494a3 --- /dev/null +++ b/include/bits/stdlib-ldbl.h @@ -0,0 +1 @@ +#include <stdlib/bits/stdlib-ldbl.h> diff --git a/include/bits/stdlib.h b/include/bits/stdlib.h new file mode 100644 index 0000000000..8541e278c7 --- /dev/null +++ b/include/bits/stdlib.h @@ -0,0 +1 @@ +#include <stdlib/bits/stdlib.h> diff --git a/include/bits/syslog.h b/include/bits/syslog.h new file mode 100644 index 0000000000..060b893482 --- /dev/null +++ b/include/bits/syslog.h @@ -0,0 +1 @@ +#include <misc/bits/syslog.h> diff --git a/include/bits/unistd.h b/include/bits/unistd.h new file mode 100644 index 0000000000..1a91dcc72e --- /dev/null +++ b/include/bits/unistd.h @@ -0,0 +1 @@ +#include <posix/bits/unistd.h> diff --git a/include/bits/wchar-ldbl.h b/include/bits/wchar-ldbl.h new file mode 100644 index 0000000000..29baa2f4d5 --- /dev/null +++ b/include/bits/wchar-ldbl.h @@ -0,0 +1 @@ +#include <wcsmbs/bits/wchar-ldbl.h> diff --git a/include/bits/wchar2.h b/include/bits/wchar2.h new file mode 100644 index 0000000000..a18dccfc55 --- /dev/null +++ b/include/bits/wchar2.h @@ -0,0 +1 @@ +#include <wcsmbs/bits/wchar2.h> diff --git a/include/dirent.h b/include/dirent.h index f09a88f21c..8f23aee234 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -1,9 +1,12 @@ #ifndef _DIRENT_H # include <dirstream.h> # include <dirent/dirent.h> +# include <sys/stat.h> +# include <stdbool.h> /* Now define the internal interfaces. */ extern DIR *__opendir (__const char *__name); +extern DIR *__fdopendir (int __fd); extern int __closedir (DIR *__dirp); extern struct dirent *__readdir (DIR *__dirp); extern struct dirent64 *__readdir64 (DIR *__dirp); @@ -23,4 +26,7 @@ extern int __alphasort64 (const void *a, const void *b) __attribute_pure__; extern int __versionsort64 (const void *a, const void *b) __attribute_pure__; +extern DIR *__alloc_dir (int fd, bool close_fd, const struct stat64 *statp) + internal_function; + #endif diff --git a/include/dlfcn.h b/include/dlfcn.h index bfa1b9041b..9144dd2f3f 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -1,15 +1,31 @@ #ifndef _DLFCN_H #include <dlfcn/dlfcn.h> #include <link.h> /* For ElfW. */ +#include <stdbool.h> /* Internally used flag. */ #define __RTLD_DLOPEN 0x80000000 #define __RTLD_SPR |
