diff options
Diffstat (limited to 'newlib/libc/sys/linux')
-rw-r--r-- | newlib/libc/sys/linux/bits/dirent.h | 53 | ||||
-rw-r--r-- | newlib/libc/sys/linux/bits/initspin.h | 28 | ||||
-rw-r--r-- | newlib/libc/sys/linux/bits/libc-lock.h | 382 | ||||
-rw-r--r-- | newlib/libc/sys/linux/bits/pthreadtypes.h | 152 | ||||
-rw-r--r-- | newlib/libc/sys/linux/bits/typesizes.h | 66 | ||||
-rw-r--r-- | newlib/libc/sys/linux/net/nscd/nscd-client.h | 312 | ||||
-rw-r--r-- | newlib/libc/sys/linux/net/nscd/nscd_proto.h | 67 |
7 files changed, 0 insertions, 1060 deletions
diff --git a/newlib/libc/sys/linux/bits/dirent.h b/newlib/libc/sys/linux/bits/dirent.h deleted file mode 100644 index e6eb17a41..000000000 --- a/newlib/libc/sys/linux/bits/dirent.h +++ /dev/null @@ -1,53 +0,0 @@ -/* 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 - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_DIRENT_H -# error "Never use <bits/dirent.h> directly; include <dirent.h> instead." -#endif - -struct dirent - { -#ifndef __USE_FILE_OFFSET64 - __ino_t d_ino; - __off_t d_off; -#else - __ino64_t d_ino; - __off64_t d_off; -#endif - unsigned short int d_reclen; - unsigned char d_type; - char d_name[256]; /* We must not include limits.h! */ - }; - -#ifdef __USE_LARGEFILE64 -struct dirent64 - { - __ino64_t d_ino; - __off64_t d_off; - unsigned short int d_reclen; - unsigned char d_type; - char d_name[256]; /* We must not include limits.h! */ - }; -#endif - -#define d_fileno d_ino /* Backwards compatibility. */ - -#undef _DIRENT_HAVE_D_NAMLEN -#define _DIRENT_HAVE_D_RECLEN -#define _DIRENT_HAVE_D_OFF -#define _DIRENT_HAVE_D_TYPE diff --git a/newlib/libc/sys/linux/bits/initspin.h b/newlib/libc/sys/linux/bits/initspin.h deleted file mode 100644 index a19ec077e..000000000 --- a/newlib/libc/sys/linux/bits/initspin.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Generic definitions for spinlock initializers. - Copyright (C) 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU 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; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* Initial value of a spinlock. Most platforms should use zero, - unless they only implement a "test and clear" operation instead of - the usual "test and set". */ -#define __LT_SPINLOCK_INIT 0 - -/* Macros for lock initializers, using the above definition. */ -#define __LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT } -#define __ALT_LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT } -#define __ATOMIC_INITIALIZER { 0, __LT_SPINLOCK_INIT } diff --git a/newlib/libc/sys/linux/bits/libc-lock.h b/newlib/libc/sys/linux/bits/libc-lock.h deleted file mode 100644 index 5779a6c93..000000000 --- a/newlib/libc/sys/linux/bits/libc-lock.h +++ /dev/null @@ -1,382 +0,0 @@ -/* libc-internal interface for mutex locks. LinuxThreads version. - Copyright (C) 1996,1997,1998,1999,2000,2001,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; 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 _BITS_LIBC_LOCK_H -#define _BITS_LIBC_LOCK_H 1 - -#include <pthread.h> - -#if defined _LIBC && !defined NOT_IN_libc -#include <linuxthreads/internals.h> -#endif - -#define _IO_MTSAFE_IO /* add this as we always want this in newlib */ - -/* Mutex type. */ -#if defined(_LIBC) || defined(_IO_MTSAFE_IO) -typedef pthread_mutex_t __libc_lock_t; -typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t; -# ifdef __USE_UNIX98 -typedef pthread_rwlock_t __libc_rwlock_t; -# else -typedef struct __libc_rwlock_opaque__ __libc_rwlock_t; -# endif -typedef __libc_lock_recursive_t __rtld_lock_recursive_t; -#else -typedef struct __libc_lock_opaque__ __libc_lock_t; -typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t; -typedef struct __libc_rwlock_opaque__ __libc_rwlock_t; -#endif - -/* Type for key to thread-specific data. */ -typedef pthread_key_t __libc_key_t; - -/* Define a lock variable NAME with storage class CLASS. The lock must be - initialized with __libc_lock_init before it can be used (or define it - with __libc_lock_define_initialized, below). Use `extern' for CLASS to - declare a lock defined in another module. In public structure - definitions you must use a pointer to the lock structure (i.e., NAME - begins with a `*'), because its storage size will not be known outside - of libc. */ -#define __libc_lock_define(CLASS,NAME) \ - CLASS __libc_lock_t NAME; -#define __libc_rwlock_define(CLASS,NAME) \ - CLASS __libc_rwlock_t NAME; -#define __libc_lock_define_recursive(CLASS,NAME) \ - CLASS __libc_lock_recursive_t NAME; -#define __rtld_lock_define_recursive(CLASS,NAME) \ - CLASS __rtld_lock_recursive_t NAME; - -/* Define an initialized lock variable NAME with storage class CLASS. - - For the C library we take a deeper look at the initializer. For - this implementation all fields are initialized to zero. Therefore - we don't initialize the variable which allows putting it into the - BSS section. (Except on PA-RISC and other odd architectures, where - initialized locks must be set to one due to the lack of normal - atomic operations.) */ - -#if __LT_SPINLOCK_INIT == 0 -# define __libc_lock_define_initialized(CLASS,NAME) \ - CLASS __libc_lock_t NAME; -#else -# define __libc_lock_define_initialized(CLASS,NAME) \ - CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER; -#endif - -#define __libc_rwlock_define_initialized(CLASS,NAME) \ - CLASS __libc_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER; - -/* Define an initialized recursive lock variable NAME with storage - class CLASS. */ -#define __libc_lock_define_initialized_recursive(CLASS,NAME) \ - CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER; -#define _LIBC_LOCK_RECURSIVE_INITIALIZER \ - {PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP} - -#define __rtld_lock_define_initialized_recursive(CLASS,NAME) \ - CLASS __rtld_lock_recursive_t NAME = _RTLD_LOCK_RECURSIVE_INITIALIZER; -#define _RTLD_LOCK_RECURSIVE_INITIALIZER \ - {PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP} - -#if defined _LIBC && defined IS_IN_libpthread -# define __libc_maybe_call(FUNC, ARGS, ELSE) FUNC ARGS -#else -# if defined __PIC__ || (defined _LIBC && defined SHARED) -# define __libc_maybe_call(FUNC, ARGS, ELSE) \ - (__extension__ ({ __typeof (FUNC) *_fn = (FUNC); \ - _fn != NULL ? (*_fn) ARGS : ELSE; })) -# else -# define __libc_maybe_call(FUNC, ARGS, ELSE) \ - (FUNC != NULL ? FUNC ARGS : ELSE) -# endif -#endif -#if defined _LIBC && !defined NOT_IN_libc && defined SHARED -# define __libc_maybe_call2(FUNC, ARGS, ELSE) \ - ({__builtin_expect (__libc_pthread_functions.ptr_##FUNC != NULL, 0) \ - ? __libc_pthread_functions.ptr_##FUNC ARGS : ELSE; }) -#else -# define __libc_maybe_call2(FUNC, ARGS, ELSE) __libc_maybe_call (__##FUNC, ARGS, ELSE) -#endif - -/* Initialize the named lock variable, leaving it in a consistent, unlocked - state. */ -#if defined _LIBC && !defined NOT_IN_libc && defined SHARED -#define __libc_lock_init(NAME) \ - ({ \ - (NAME).__m_count = 0; \ - (NAME).__m_owner = NULL; \ - (NAME).__m_kind = PTHREAD_MUTEX_TIMED_NP; \ - (NAME).__m_lock.__status = 0; \ - (NAME).__m_lock.__spinlock = __LT_SPINLOCK_INIT; \ - 0; }) -#else -#define __libc_lock_init(NAME) \ - (__libc_maybe_call2 (pthread_mutex_init, (&(NAME), NULL), 0)) -#endif -#define __libc_rwlock_init(NAME) \ - (__libc_maybe_call (__pthread_rwlock_init, (&(NAME), NULL), 0)); - -/* Same as last but this time we initialize a recursive mutex. */ -#if defined _LIBC && !defined NOT_IN_libc && defined SHARED -#define __libc_lock_init_recursive(NAME) \ - ({ \ - (NAME).mutex.__m_count = 0; \ - (NAME).mutex.__m_owner = NULL; \ - (NAME).mutex.__m_kind = PTHREAD_MUTEX_RECURSIVE_NP; \ - (NAME).mutex.__m_lock.__status = 0; \ - (NAME).mutex.__m_lock.__spinlock = __LT_SPINLOCK_INIT; \ - 0; }) -#else -#define __libc_lock_init_recursive(NAME) \ - do { \ - if (__pthread_mutex_init != NULL) \ - { \ - pthread_mutexattr_t __attr; \ - __pthread_mutexattr_init (&__attr); \ - __pthread_mutexattr_settype (&__attr, PTHREAD_MUTEX_RECURSIVE_NP); \ - __pthread_mutex_init (&(NAME).mutex, &__attr); \ - __pthread_mutexattr_destroy (&__attr); \ - } \ - } while (0); -#endif -#define __rtld_lock_init_recursive(NAME) \ - __libc_lock_init_recursive (NAME) - -/* Finalize the named lock variable, which must be locked. It cannot be - used again until __libc_lock_init is called again on it. This must be - called on a lock variable before the containing storage is reused. */ -#define __libc_lock_fini(NAME) \ - (__libc_maybe_call2 (pthread_mutex_destroy, (&(NAME)), 0)); -#define __libc_rwlock_fini(NAME) \ - (__libc_maybe_call (__pthread_rwlock_destroy, (&(NAME)), 0)); - -/* Finalize recursive named lock. */ -#define __libc_lock_fini_recursive(NAME) __libc_lock_fini ((NAME).mutex) -#define __rtld_lock_fini_recursive(NAME) __libc_lock_fini_recursive (NAME) - -/* Lock the named lock variable. */ -#define __libc_lock_lock(NAME) \ - (__libc_maybe_call2 (pthread_mutex_lock, (&(NAME)), 0)); -#define __libc_rwlock_rdlock(NAME) \ - (__libc_maybe_call (__pthread_rwlock_rdlock, (&(NAME)), 0)); -#define __libc_rwlock_wrlock(NAME) \ - (__libc_maybe_call (__pthread_rwlock_wrlock, (&(NAME)), 0)); - -/* Lock the recursive named lock variable. */ -#define __libc_lock_lock_recursive(NAME) __libc_lock_lock ((NAME).mutex) - -/* Try to lock the named lock variable. */ -#define __libc_lock_trylock(NAME) \ - (__libc_maybe_call2 (pthread_mutex_trylock, (&(NAME)), 0)) -#define __libc_rwlock_tryrdlock(NAME) \ - (__libc_maybe_call (__pthread_rwlock_tryrdlock, (&(NAME)), 0)) -#define __libc_rwlock_trywrlock(NAME) \ - (__libc_maybe_call (__pthread_rwlock_trywrlock, (&(NAME)), 0)) - -/* Try to lock the recursive named lock variable. */ -#define __libc_lock_trylock_recursive(NAME) __libc_lock_trylock ((NAME).mutex) -#define __rtld_lock_trylock_recursive(NAME) \ - __libc_lock_trylock_recursive (NAME) - -/* Unlock the named lock variable. */ -#define __libc_lock_unlock(NAME) \ - (__libc_maybe_call2 (pthread_mutex_unlock, (&(NAME)), 0)); -#define __libc_rwlock_unlock(NAME) \ - (__libc_maybe_call (__pthread_rwlock_unlock, (&(NAME)), 0)); - -/* Unlock the recursive named lock variable. */ -#define __libc_lock_unlock_recursive(NAME) __libc_lock_unlock ((NAME).mutex) - -#if defined _LIBC && defined SHARED -# define __rtld_lock_default_lock_recursive(lock) \ - ++((pthread_mutex_t *)(lock))->__m_count; - -# define __rtld_lock_default_unlock_recursive(lock) \ - --((pthread_mutex_t *)(lock))->__m_count; - -# define __rtld_lock_lock_recursive(NAME) \ - GL(dl_rtld_lock_recursive) (&(NAME).mutex) - -# define __rtld_lock_unlock_recursive(NAME) \ - GL(dl_rtld_unlock_recursive) (&(NAME).mutex) -#else -#define __rtld_lock_lock_recursive(NAME) __libc_lock_lock_recursive (NAME) -#define __rtld_lock_unlock_recursive(NAME) __libc_lock_unlock_recursive (NAME) -#endif - -/* Define once control variable. */ -#if PTHREAD_ONCE_INIT == 0 -/* Special case for static variables where we can avoid the initialization - if it is zero. */ -# define __libc_once_define(CLASS, NAME) \ - CLASS pthread_once_t NAME -#else -# define __libc_once_define(CLASS, NAME) \ - CLASS pthread_once_t NAME = PTHREAD_ONCE_INIT -#endif - -/* Call handler iff the first call. */ -#define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \ - do { \ - if (__pthread_once != NULL) \ - __pthread_once (&(ONCE_CONTROL), (INIT_FUNCTION)); \ - else if ((ONCE_CONTROL) == PTHREAD_ONCE_INIT) { \ - INIT_FUNCTION (); \ - (ONCE_CONTROL) = 2; \ - } \ - } while (0) - - -/* Start critical region with cleanup. */ -#define __libc_cleanup_region_start(DOIT, FCT, ARG) \ - { struct _pthread_cleanup_buffer _buffer; \ - int _avail = (DOIT) && _pthread_cleanup_push_defer != NULL; \ - if (_avail) { \ - _pthread_cleanup_push_defer (&_buffer, (FCT), (ARG)); \ - } - -/* End critical region with cleanup. */ -#define __libc_cleanup_region_end(DOIT) \ - if (_avail) { \ - _pthread_cleanup_pop_restore (&_buffer, (DOIT)); \ - } \ - } - -/* Sometimes we have to exit the block in the middle. */ -#define __libc_cleanup_end(DOIT) \ - if (_avail) { \ - _pthread_cleanup_pop_restore (&_buffer, (DOIT)); \ - } - -#define __libc_cleanup_push(fct, arg) \ - { struct _pthread_cleanup_buffer _buffer; \ - __libc_maybe_call (_pthread_cleanup_push, (&_buffer, (fct), (arg)), 0) - -#define __libc_cleanup_pop(execute) \ - __libc_maybe_call (_pthread_cleanup_pop, (&_buffer, execute), 0); \ - } - -/* Create thread-specific key. */ -#define __libc_key_create(KEY, DESTRUCTOR) \ - (__libc_maybe_call (__pthread_key_create, (KEY, DESTRUCTOR), 1)) - -/* Get thread-specific data. */ -#define __libc_getspecific(KEY) \ - (__libc_maybe_call (__pthread_getspecific, (KEY), NULL)) - -/* Set thread-specific data. */ -#define __libc_setspecific(KEY, VALUE) \ - (__libc_maybe_call (__pthread_setspecific, (KEY, VALUE), 0)) - - -/* Register handlers to execute before and after `fork'. */ -#define __libc_atfork(PREPARE, PARENT, CHILD) \ - (__libc_maybe_call (__pthread_atfork, (PREPARE, PARENT, CHILD), 0)) - -/* Functions that are used by this file and are internal to the GNU C - library. */ - -extern int __pthread_mutex_init (pthread_mutex_t *__mutex, - __const pthread_mutexattr_t *__mutex_attr); - -extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex); - -extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex); - -extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); - -extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex); - -extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr); - -extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr); - -extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr, - int __kind); - -#ifdef __USE_UNIX98 -extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock, - __const pthread_rwlockattr_t *__attr); - -extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock); - -extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock); - -extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock); - -extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock); - -extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock); - -extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock); -#endif - -extern int __pthread_key_create (pthread_key_t *__key, - void (*__destr_function) (void *)); - -extern int __pthread_setspecific (pthread_key_t __key, - __const void *__pointer); - -extern void *__pthread_getspecific (pthread_key_t __key); - -extern int __pthread_once (pthread_once_t *__once_control, - void (*__init_routine) (void)); - -extern int __pthread_atfork (void (*__prepare) (void), - void (*__parent) (void), - void (*__child) (void)); - - - -/* Make the pthread functions weak so that we can elide them from - single-threaded processes. */ -#ifndef __NO_WEAK_PTHREAD_ALIASES -# pragma weak __pthread_mutex_init -# pragma weak __pthread_mutex_destroy -# pragma weak __pthread_mutex_lock -# pragma weak __pthread_mutex_trylock -# pragma weak __pthread_mutex_unlock -# pragma weak __pthread_mutexattr_init -# pragma weak __pthread_mutexattr_destroy -# pragma weak __pthread_mutexattr_settype -# pragma weak __pthread_rwlock_destroy -# pragma weak __pthread_rwlock_rdlock -# pragma weak __pthread_rwlock_tryrdlock -# pragma weak __pthread_rwlock_wrlock -# pragma weak __pthread_rwlock_trywrlock -# pragma weak __pthread_rwlock_unlock -# pragma weak __pthread_key_create -# pragma weak __pthread_setspecific -# pragma weak __pthread_getspecific -# pragma weak __pthread_once -# pragma weak __pthread_initialize -# pragma weak __pthread_atfork -# pragma weak _pthread_cleanup_push_defer -# pragma weak _pthread_cleanup_pop_restore -# pragma weak _pthread_cleanup_push -# pragma weak _pthread_cleanup_pop -#endif - -/* We need portable names for some functions. E.g., when they are - used as argument to __libc_cleanup_region_start. */ -#define __libc_mutex_unlock __pthread_mutex_unlock - -#endif /* bits/libc-lock.h */ diff --git a/newlib/libc/sys/linux/bits/pthreadtypes.h b/newlib/libc/sys/linux/bits/pthreadtypes.h deleted file mode 100644 index d1daef07a..000000000 --- a/newlib/libc/sys/linux/bits/pthreadtypes.h +++ /dev/null @@ -1,152 +0,0 @@ -/* Linuxthreads - a simple clone()-based implementation of Posix */ -/* threads for Linux. */ -/* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */ -/* */ -/* This program 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. */ -/* */ -/* This program 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. */ - -#if !defined _BITS_TYPES_H && !defined _PTHREAD_H -# error "Never include <bits/pthreadtypes.h> directly; use <sys/types.h> instead." -#endif - -#ifndef _BITS_PTHREADTYPES_H -#define _BITS_PTHREADTYPES_H 1 - -#define __need_schedparam -#include <bits/sched.h> - -/* Fast locks (not abstract because mutexes and conditions aren't abstract). */ -struct _pthread_fastlock -{ - long int __status; /* "Free" or "taken" or head of waiting list */ - int __spinlock; /* Used by compare_and_swap emulation. Also, - adaptive SMP lock stores spin count here. */ -}; - -#ifndef _PTHREAD_DESCR_DEFINED -/* Thread descriptors */ -typedef struct _pthread_descr_struct *_pthread_descr; -# define _PTHREAD_DESCR_DEFINED -#endif - - -/* Attributes for threads. */ -typedef struct __pthread_attr_s -{ - int __detachstate; - int __schedpolicy; - struct __sched_param __schedparam; - int __inheritsched; - int __scope; - size_t __guardsize; - int __stackaddr_set; - void *__stackaddr; - size_t __stacksize; -} pthread_attr_t; - - -/* Conditions (not abstract because of PTHREAD_COND_INITIALIZER */ - -#ifdef __GLIBC_HAVE_LONG_LONG -__extension__ typedef long long __pthread_cond_align_t; -#else -typedef long __pthread_cond_align_t; -#endif - -typedef struct -{ - struct _pthread_fastlock __c_lock; /* Protect against concurrent access */ - _pthread_descr __c_waiting; /* Threads waiting on this condition */ - char __padding[48 - sizeof (struct _pthread_fastlock) - - sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)]; - __pthread_cond_align_t __align; -} pthread_cond_t; - - -/* Attribute for conditionally variables. */ -typedef struct -{ - int __dummy; -} pthread_condattr_t; - -/* Keys for thread-specific data */ -typedef unsigned int pthread_key_t; - - -/* Mutexes (not abstract because of PTHREAD_MUTEX_INITIALIZER). */ -/* (The layout is unnatural to maintain binary compatibility - with earlier releases of LinuxThreads.) */ -typedef struct -{ - int __m_reserved; /* Reserved for future use */ - int __m_count; /* Depth of recursive locking */ - _pthread_descr __m_owner; /* Owner thread (if recursive or errcheck) */ - int __m_kind; /* Mutex kind: fast, recursive or errcheck */ - struct _pthread_fastlock __m_lock; /* Underlying fast lock */ -} pthread_mutex_t; - - -/* Attribute for mutex. */ -typedef struct -{ - int __mutexkind; -} pthread_mutexattr_t; - - -/* Once-only execution */ -typedef int pthread_once_t; - - -#if defined __USE_UNIX98 || defined __USE_XOPEN2K -/* Read-write locks. */ -typedef struct _pthread_rwlock_t -{ - struct _pthread_fastlock __rw_lock; /* Lock to guarantee mutual exclusion */ - int __rw_readers; /* Number of readers */ - _pthread_descr __rw_writer; /* Identity of writer, or NULL if none */ - _pthread_descr __rw_read_waiting; /* Threads waiting for reading */ - _pthread_descr __rw_write_waiting; /* Threads waiting for writing */ - int __rw_kind; /* Reader/Writer preference selection */ - int __rw_pshared; /* Shared between processes or not */ -} pthread_rwlock_t; - - -/* Attribute for read-write locks. */ -typedef struct -{ - int __lockkind; - int __pshared; -} pthread_rwlockattr_t; -#endif - -#ifdef __USE_XOPEN2K -/* POSIX spinlock data type. */ -typedef volatile int pthread_spinlock_t; - -/* POSIX barrier. */ -typedef struct { - struct _pthread_fastlock __ba_lock; /* Lock to guarantee mutual exclusion */ - int __ba_required; /* Threads needed for completion */ - int __ba_present; /* Threads waiting */ - _pthread_descr __ba_waiting; /* Queue of waiting threads */ -} pthread_barrier_t; - -/* barrier attribute */ -typedef struct { - int __pshared; -} pthread_barrierattr_t; - -#endif - - -/* Thread identifiers */ -typedef unsigned long int pthread_t; - -#endif /* bits/pthreadtypes.h */ diff --git a/newlib/libc/sys/linux/bits/typesizes.h b/newlib/libc/sys/linux/bits/typesizes.h deleted file mode 100644 index 45264ac9c..000000000 --- a/newlib/libc/sys/linux/bits/typesizes.h +++ /dev/null @@ -1,66 +0,0 @@ -/* bits/typesizes.h -- underlying types for *_t. Generic version. - Copyright (C) 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. */ - -#ifndef _BITS_TYPES_H -# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead." -#endif - -#ifndef _BITS_TYPESIZES_H -#define _BITS_TYPESIZES_H 1 - -/* See <bits/types.h> for the meaning of these macros. This file exists so - that <bits/types.h> need not vary across different GNU platforms. */ - -#define __DEV_T_TYPE __UQUAD_TYPE -#define __UID_T_TYPE __U32_TYPE -#define __GID_T_TYPE __U32_TYPE -#define __INO_T_TYPE __ULONGWORD_TYPE -#define __INO64_T_TYPE __UQUAD_TYPE -#define __MODE_T_TYPE __U32_TYPE -#define __NLINK_T_TYPE __UWORD_TYPE -#define __OFF_T_TYPE __SLONGWORD_TYPE -#define __OFF64_T_TYPE __SQUAD_TYPE -#define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __ULONGWORD_TYPE -#define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT_T_TYPE __SLONGWORD_TYPE -#define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE -#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE -#define __FSFILCNT64_T_TYPE __UQUAD_TYPE -#define __ID_T_TYPE __U32_TYPE -#define __CLOCK_T_TYPE __SLONGWORD_TYPE -#define __TIME_T_TYPE __SLONGWORD_TYPE -#define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE -#define __DADDR_T_TYPE __S32_TYPE -#define __SWBLK_T_TYPE __SLONGWORD_TYPE -#define __KEY_T_TYPE __S32_TYPE -#define __CLOCKID_T_TYPE __S32_TYPE -#define __TIMER_T_TYPE __S32_TYPE -#define __BLKSIZE_T_TYPE __SLONGWORD_TYPE -#define __FSID_T_TYPE struct { int __val[2]; } -#define __SSIZE_T_TYPE __SWORD_TYPE - -/* Number of descriptors that can fit in an `fd_set'. */ -#define __FD_SETSIZE 1024 - - -#endif /* bits/typesizes.h */ diff --git a/newlib/libc/sys/linux/net/nscd/nscd-client.h b/newlib/libc/sys/linux/net/nscd/nscd-client.h deleted file mode 100644 index 0ba8a2198..000000000 --- a/newlib/libc/sys/linux/net/nscd/nscd-client.h +++ /dev/null @@ -1,312 +0,0 @@ -/* Copyright (c) 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998. - - 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 defines everything that client code should need to - know to talk to the nscd daemon. */ - -#ifndef _NSCD_CLIENT_H -#define _NSCD_CLIENT_H 1 - -#include <stdbool.h> -#include <stdint.h> -#include <sys/types.h> -#include <machine/atomic.h> -#include <nscd-types.h> - - -/* Version number of the daemon interface */ -#define NSCD_VERSION 2 - -/* Path of the file where the PID of the running system is stored. */ -#define _PATH_NSCDPID "/var/run/nscd/nscd.pid" - -/* Path for the Unix domain socket. */ -#define _PATH_NSCDSOCKET "/var/run/nscd/socket" - -/* Path for the configuration file. */ -#define _PATH_NSCDCONF "/etc/nscd.conf" - - -/* Available services. */ -typedef enum -{ - GETPWBYNAME, - GETPWBYUID, - GETGRBYNAME, - GETGRBYGID, - GETHOSTBYNAME, - GETHOSTBYNAMEv6, - GETHOSTBYADDR, - GETHOSTBYADDRv6, - LASTDBREQ = GETHOSTBYADDRv6, - SHUTDOWN, /* Shut the server down. */ - GETSTAT, /* Get the server statistic. */ - INVALIDATE, /* Invalidate one special cache. */ - GETFDPW, - GETFDGR, - GETFDHST, - GETAI, - INITGROUPS, - LASTREQ -} request_type; - - -/* Header common to all requests */ -typedef struct -{ - int32_t version; /* Version number of the daemon interface. */ - request_type type; /* Service requested. */ - int32_t key_len; /* Key length. */ -} request_header; - - -/* Structure sent in reply to password query. Note that this struct is - sent also if the service is disabled or there is no record found. */ -typedef struct -{ - int32_t version; - int32_t found; - nscd_ssize_t pw_name_len; - nscd_ssize_t pw_passwd_len; - uid_t pw_uid; - gid_t pw_gid; - nscd_ssize_t pw_gecos_len; - nscd_ssize_t pw_dir_len; - nscd_ssize_t pw_shell_len; -} pw_response_header; - - -/* Structure sent in reply to group query. Note that this struct is - sent also if the service is disabled or there is no record found. */ -typedef struct -{ - int32_t version; - int32_t found; - nscd_ssize_t gr_name_len; - nscd_ssize_t gr_passwd_len; - gid_t gr_gid; - nscd_ssize_t gr_mem_cnt; -} gr_response_header; - - -/* Structure sent in reply to host query. Note that this struct is - sent also if the service is disabled or there is no record found. */ -typedef struct -{ - int32_t version; - int32_t found; - nscd_ssize_t h_name_len; - nscd_ssize_t h_aliases_cnt; - int32_t h_addrtype; - int32_t h_length; - nscd_ssize_t h_addr_list_cnt; - int32_t error; -} hst_response_header; - - -/* Structure sent in reply to addrinfo query. Note that this struct is - sent also if the service is disabled or there is no record found. */ -typedef struct -{ - int32_t version; - int32_t found; - nscd_ssize_t naddrs; - nscd_ssize_t addrslen; - nscd_ssize_t canonlen; - int32_t error; -} ai_response_header; - -/* Structure filled in by __nscd_getai. */ -struct nscd_ai_result -{ - int naddrs; - char *canon; - uint8_t *family; - char *addrs; -}; - -/* Structure sent in reply to initgroups query. Note that this struct is - sent also if the service is disabled or there is no record found. */ -typedef struct -{ - int32_t version; - int32_t found; - nscd_ssize_t ngrps; -} initgr_response_header; - - -/* Type for offsets in data part of database. */ -typedef uint32_t ref_t; -/* Value for invalid/no reference. */ -#define ENDREF UINT32_MAX - -/* Timestamp type. */ -typedef uint64_t nscd_time_t; - -/* Alignment requirement of the beginning of the data region. */ -#define ALIGN 16 - - -/* Head of record in data part of database. */ -struct datahead -{ - nscd_ssize_t allocsize; /* Allocated Bytes. */ - nscd_ssize_t recsize; /* Size of the record. */ - nscd_time_t timeout; /* Time when this entry becomes invalid. */ - uint8_t notfound; /* Nonzero if data has not been found. */ - uint8_t nreloads; /* Reloads without use. */ - uint8_t usable; /* False if the entry must be ignored. */ - uint64_t :40; /* Alignment. */ - - /* We need to have the following element aligned for the response - header data types and their use in the 'struct dataset' types - defined in the XXXcache.c files. */ - union - { - pw_response_header pwdata; - gr_response_header grdata; - hst_response_header hstdata; - ai_response_header aidata; - initgr_response_header initgrdata; - nscd_ssize_t align1; - nscd_time_t align2; - } data[0]; -}; - - -/* Structure for one hash table entry. */ -struct hashentry -{ - request_type type:8; /* Which type of dataset. */ - bool first; /* True if this was the original key. */ - nscd_ssize_t len; /* Length of key. */ - ref_t key; /* Pointer to key. */ - int32_t owner; /* If secure table, this is the owner. */ - ref_t next; /* Next entry in this hash bucket list. */ - ref_t packet; /* Records for the result. */ - union - { - struct hashentry *dellist; /* Next record to be deleted. This can be a - pointer since only nscd uses this field. */ - ref_t *prevp; /* Pointer to field containing forward - reference. */ - }; -}; - - -/* Current persistent database version. */ -#define DB_VERSION 1 - -/* Maximum time allowed between updates of the timestamp. */ -#define MAPPING_TIMEOUT (5 * 60) - - -/* Header of persistent database file. */ -struct database_pers_head -{ - int32_t version; - int32_t header_size; - volatile int32_t gc_cycle; - volatile int32_t nscd_certainly_running; - volatile nscd_time_t timestamp; - - nscd_ssize_t module; - nscd_ssize_t data_size; - - nscd_ssize_t first_free; /* Offset of first free byte in data area. */ - - nscd_ssize_t nentries; - nscd_ssize_t maxnentries; - nscd_ssize_t maxnsearched; - - uint64_t poshit; - uint64_t neghit; - uint64_t posmiss; - uint64_t negmiss; - - uint64_t rdlockdelayed; - uint64_t wrlockdelayed; - - uint64_t addfailed; - - ref_t array[0]; -}; - - -/* Mapped database record. */ -struct mapped_database -{ - const struct database_pers_head *head; - const char *data; - size_t mapsize; - int counter; /* > 0 indicates it is usable. */ -}; -#define NO_MAPPING ((struct mapped_database *) -1l) - -struct locked_map_ptr -{ - int lock; - struct mapped_database *mapped; -}; -#define libc_locked_map_ptr(class, name) class struct locked_map_ptr name - - -/* Open socket connection to nscd server. */ -extern int __nscd_open_socket (const char *key, size_t keylen, - request_type type, void *response, - size_t responselen) attribute_hidden; - -/* Get reference of mapping. */ -extern struct mapped_database *__nscd_get_map_ref (request_type type, - const char *name, - struct locked_map_ptr *mapptr, - int *gc_cyclep); - -/* Unmap database. */ -extern void __nscd_unmap (struct mapped_database *mapped); - -/* Drop reference of mapping. */ -static inline int __nscd_drop_map_ref (struct mapped_database *map, - int *gc_cycle) -{ - if (map != NO_MAPPING) - { - int now_cycle = map->head->gc_cycle; - if (__builtin_expect (now_cycle != *gc_cycle, 0)) - { - /* We might have read inconsistent data. */ - *gc_cycle = now_cycle; - return -1; - } - - if (atomic_decrement_and_test (&map->counter) == 0) - __nscd_unmap (map); - } - - return 0; -} - - -/* Search the mapped database. */ -extern const struct datahead *__nscd_cache_search (request_type type, - const char *key, - size_t keylen, - const struct mapped_database *mapped); - -#endif /* nscd.h */ diff --git a/newlib/libc/sys/linux/net/nscd/nscd_proto.h b/newlib/libc/sys/linux/net/nscd/nscd_proto.h deleted file mode 100644 index 64d9bd004..000000000 --- a/newlib/libc/sys/linux/net/nscd/nscd_proto.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998. - - 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 _NSCD_PROTO_H -#define _NSCD_PROTO_H 1 - -#include <grp.h> -#include <netdb.h> -#include <pwd.h> - -/* Interval in which we transfer retry to contact the NSCD. */ -#define NSS_NSCD_RETRY 100 - -/* Type needed in the interfaces. */ -struct nscd_ai_result; - - -/* Variables for communication between NSCD handler functions and NSS. */ -extern int __nss_not_use_nscd_passwd attribute_hidden; -extern int __nss_not_use_nscd_group attribute_hidden; -extern int __nss_not_use_nscd_hosts attribute_hidden; - -extern int __nscd_getpwnam_r (const char *name, struct passwd *resultbuf, - char *buffer, size_t buflen, - struct passwd **result); -extern int __nscd_getpwuid_r (uid_t uid, struct passwd *resultbuf, - char *buffer, size_t buflen, - struct passwd **result); -extern int __nscd_getgrnam_r (const char *name, struct group *resultbuf, - char *buffer, size_t buflen, - struct group **result); -extern int __nscd_getgrgid_r (gid_t gid, struct group *resultbuf, - char *buffer, size_t buflen, - struct group **result); -extern int __nscd_gethostbyname_r (const char *name, - struct hostent *resultbuf, - char *buffer, size_t buflen, - struct hostent **result, int *h_errnop); -extern int __nscd_gethostbyname2_r (const char *name, int af, - struct hostent *resultbuf, - char *buffer, size_t buflen, - struct hostent **result, int *h_errnop); -extern int __nscd_gethostbyaddr_r (const void *addr, socklen_t len, int type, - struct hostent *resultbuf, - char *buffer, size_t buflen, - struct hostent **result, int *h_errnop); -extern int __nscd_getai (const char *key, struct nscd_ai_result **result, - int *h_errnop); -extern int __nscd_getgrouplist (const char *user, gid_t group, long int *size, - gid_t **groupsp, long int limit); -#endif /* _NSCD_PROTO_H */ |