summaryrefslogtreecommitdiff
path: root/include/sys
diff options
context:
space:
mode:
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/cdefs.h47
-rw-r--r--include/sys/dir.h5
-rw-r--r--include/sys/file.h7
-rw-r--r--include/sys/fsuid.h5
-rw-r--r--include/sys/ioctl.h6
-rw-r--r--include/sys/ipc.h7
-rw-r--r--include/sys/kd.h5
-rw-r--r--include/sys/kdaemon.h5
-rw-r--r--include/sys/klog.h5
-rw-r--r--include/sys/mman.h30
-rw-r--r--include/sys/mount.h67
-rw-r--r--include/sys/msg.h17
-rw-r--r--include/sys/mtio.h5
-rw-r--r--include/sys/param.h23
-rw-r--r--include/sys/personality.h5
-rw-r--r--include/sys/poll.h12
-rw-r--r--include/sys/queue.h842
-rw-r--r--include/sys/quota.h96
-rw-r--r--include/sys/reboot.h5
-rw-r--r--include/sys/resource.h15
-rw-r--r--include/sys/select.h9
-rw-r--r--include/sys/sem.h7
-rw-r--r--include/sys/sendfile.h6
-rw-r--r--include/sys/shm.h12
-rw-r--r--include/sys/socket.h58
-rw-r--r--include/sys/stat.h87
-rw-r--r--include/sys/statfs.h16
-rw-r--r--include/sys/statvfs.h21
-rw-r--r--include/sys/swap.h9
-rw-r--r--include/sys/syscall.h16
-rw-r--r--include/sys/sysctl.h5
-rw-r--r--include/sys/sysinfo.h14
-rw-r--r--include/sys/syslog.h7
-rw-r--r--include/sys/sysmacros.h34
-rw-r--r--include/sys/time.h36
-rw-r--r--include/sys/timeb.h5
-rw-r--r--include/sys/times.h6
-rw-r--r--include/sys/timex.h19
-rw-r--r--include/sys/ttydefaults.h6
-rw-r--r--include/sys/types.h11
-rw-r--r--include/sys/uio.h9
-rw-r--r--include/sys/un.h5
-rw-r--r--include/sys/ustat.h5
-rw-r--r--include/sys/utsname.h29
-rw-r--r--include/sys/wait.h67
-rw-r--r--include/sys/xattr.h31
46 files changed, 958 insertions, 781 deletions
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index 588c1ebb2..f725ce98c 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_CDEFS_H
#define _SYS_CDEFS_H 1
@@ -38,20 +37,33 @@
#ifdef __GNUC__
+/* All functions, except those with callbacks or those that
+ synchronize memory, are leaf functions. */
+# if __GNUC_PREREQ (4, 6) && !defined _LIBC
+# define __LEAF , __leaf__
+# define __LEAF_ATTR __attribute__ ((__leaf__))
+# else
+# define __LEAF
+# define __LEAF_ATTR
+# endif
+
/* GCC can always grok prototypes. For C++ programs we add throw()
to help it optimize the function calls. But this works only with
gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions
as non-throwing using a function attribute since programs can use
the -fexceptions options for C code as well. */
# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
-# define __THROW __attribute__ ((__nothrow__))
-# define __NTH(fct) __attribute__ ((__nothrow__)) fct
+# define __THROW __attribute__ ((__nothrow__ __LEAF))
+# define __THROWNL __attribute__ ((__nothrow__))
+# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
# else
# if defined __cplusplus && __GNUC_PREREQ (2,8)
# define __THROW throw ()
-# define __NTH(fct) fct throw ()
+# define __THROWNL throw ()
+# define __NTH(fct) __LEAF_ATTR fct throw ()
# else
# define __THROW
+# define __THROWNL
# define __NTH(fct) fct
# endif
# endif
@@ -61,12 +73,9 @@
# define __inline /* No inline functions. */
# define __THROW
+# define __THROWNL
# define __NTH(fct) fct
-# define __const const
-# define __signed signed
-# define __volatile volatile
-
#endif /* GCC. */
/* These two macros are not used in glibc anymore. They are kept here
@@ -120,14 +129,6 @@
#endif
-/* Support for bounded pointers. */
-#ifndef __BOUNDED_POINTERS__
-# define __bounded /* nothing */
-# define __unbounded /* nothing */
-# define __ptrvalue /* nothing */
-#endif
-
-
/* Fortify support. */
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
#define __bos0(ptr) __builtin_object_size (ptr, 0)
@@ -178,9 +179,13 @@
# ifdef __cplusplus
# define __REDIRECT_NTH(name, proto, alias) \
name proto __THROW __asm__ (__ASMNAME (#alias))
+# define __REDIRECT_NTHNL(name, proto, alias) \
+ name proto __THROWNL __asm__ (__ASMNAME (#alias))
# else
# define __REDIRECT_NTH(name, proto, alias) \
name proto __asm__ (__ASMNAME (#alias)) __THROW
+# define __REDIRECT_NTHNL(name, proto, alias) \
+ name proto __asm__ (__ASMNAME (#alias)) __THROWNL
# endif
# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
@@ -226,6 +231,12 @@
# define __attribute_pure__ /* Ignore */
#endif
+#if __GNUC_PREREQ (2,96)
+# define __attribute_const__ __attribute__((__const__))
+#else
+# define __attribute_const__ /* unimplemented */
+#endif
+
/* At some point during the gcc 3.1 development the `used' attribute
for functions was introduced. We don't want to use it unconditionally
(although this would be possible) since it generates warnings. */
diff --git a/include/sys/dir.h b/include/sys/dir.h
index 2611d6cd9..5352f9029 100644
--- a/include/sys/dir.h
+++ b/include/sys/dir.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_DIR_H
#define _SYS_DIR_H 1
diff --git a/include/sys/file.h b/include/sys/file.h
index 93b36350a..42dfa44b5 100644
--- a/include/sys/file.h
+++ b/include/sys/file.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_FILE_H
#define _SYS_FILE_H 1
@@ -39,7 +38,7 @@ __BEGIN_DECLS
/* Operations for the `flock' call. */
#define LOCK_SH 1 /* Shared lock. */
-#define LOCK_EX 2 /* Exclusive lock. */
+#define LOCK_EX 2 /* Exclusive lock. */
#define LOCK_UN 8 /* Unlock. */
/* Can be OR'd in to one of the above. */
diff --git a/include/sys/fsuid.h b/include/sys/fsuid.h
index 4ecb19918..2fd512e74 100644
--- a/include/sys/fsuid.h
+++ b/include/sys/fsuid.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_FSUID_H
#define _SYS_FSUID_H 1
diff --git a/include/sys/ioctl.h b/include/sys/ioctl.h
index 6d8a0f40b..3ff134c8d 100644
--- a/include/sys/ioctl.h
+++ b/include/sys/ioctl.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_IOCTL_H
#define _SYS_IOCTL_H 1
@@ -40,6 +39,7 @@ __BEGIN_DECLS
One argument may follow; its presence and type depend on REQUEST.
Return value depends on REQUEST. Usually -1 indicates error. */
extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
+libc_hidden_proto(ioctl)
__END_DECLS
diff --git a/include/sys/ipc.h b/include/sys/ipc.h
index 42806db2b..02aab5255 100644
--- a/include/sys/ipc.h
+++ b/include/sys/ipc.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_IPC_H
#define _SYS_IPC_H 1
@@ -51,7 +50,7 @@ typedef __key_t key_t;
__BEGIN_DECLS
/* Generates key for System V style IPC. */
-extern key_t ftok (__const char *__pathname, int __proj_id) __THROW;
+extern key_t ftok (const char *__pathname, int __proj_id) __THROW;
__END_DECLS
diff --git a/include/sys/kd.h b/include/sys/kd.h
index d459c079e..44ab953bc 100644
--- a/include/sys/kd.h
+++ b/include/sys/kd.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_KD_H
#define _SYS_KD_H 1
diff --git a/include/sys/kdaemon.h b/include/sys/kdaemon.h
index 61491f93d..921e07274 100644
--- a/include/sys/kdaemon.h
+++ b/include/sys/kdaemon.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/* Interfaces to control the various kernel daemons. */
diff --git a/include/sys/klog.h b/include/sys/klog.h
index 35f5fe40e..f5fef94b0 100644
--- a/include/sys/klog.h
+++ b/include/sys/klog.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_KLOG_H
diff --git a/include/sys/mman.h b/include/sys/mman.h
index 10471e683..71d553af4 100644
--- a/include/sys/mman.h
+++ b/include/sys/mman.h
@@ -1,5 +1,5 @@
/* Definitions for BSD-style memory management.
- Copyright (C) 1994-2000, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1994-2000, 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
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_MMAN_H
#define _SYS_MMAN_H 1
@@ -57,9 +56,10 @@ __BEGIN_DECLS
#ifndef __USE_FILE_OFFSET64
extern void *mmap (void *__addr, size_t __len, int __prot,
int __flags, int __fd, __off_t __offset) __THROW;
+libc_hidden_proto(mmap)
#else
-# ifdef __REDIRECT
-extern void * __REDIRECT (mmap,
+# ifdef __REDIRECT_NTH
+extern void * __REDIRECT_NTH (mmap,
(void *__addr, size_t __len, int __prot,
int __flags, int __fd, __off64_t __offset),
mmap64);
@@ -75,6 +75,7 @@ extern void *mmap64 (void *__addr, size_t __len, int __prot,
/* Deallocate any mapping for the region starting at ADDR and extending LEN
bytes. Returns 0 if successful, -1 for errors (and sets errno). */
extern int munmap (void *__addr, size_t __len) __THROW;
+libc_hidden_proto(munmap)
/* Change the memory protection of the region starting at ADDR and
extending LEN bytes to PROT. Returns 0 if successful, -1 for errors
@@ -98,7 +99,7 @@ static __inline__ int msync (void *__addr, size_t __len, int __flags) { return 0
#endif
-#if defined __USE_BSD && defined __UCLIBC_LINUX_SPECIFIC__
+#if defined __USE_BSD && (defined __UCLIBC_LINUX_SPECIFIC__ || defined __UCLIBC_HAS_THREADS_NATIVE__)
/* Advise the system about particular usage patterns the program follows
for the region starting at ADDR and extending LEN bytes. */
extern int madvise (void *__addr, size_t __len, int __advice) __THROW;
@@ -113,10 +114,10 @@ extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW;
/* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to
be memory resident. */
-extern int mlock (__const void *__addr, size_t __len) __THROW;
+extern int mlock (const void *__addr, size_t __len) __THROW;
/* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */
-extern int munlock (__const void *__addr, size_t __len) __THROW;
+extern int munlock (const void *__addr, size_t __len) __THROW;
/* Cause all currently mapped pages of the process to be memory resident
until unlocked by a call to the `munlockall', until the process exits,
@@ -131,8 +132,8 @@ extern int munlockall (void) __THROW;
/* On no-mmu systems, memory cannot be swapped out, so
* these functions will always succeed. */
-static __inline__ int mlock (__const void *__addr, size_t __len) { return 0; }
-static __inline__ int munlock (__const void *__addr, size_t __len) { return 0; }
+static __inline__ int mlock (const void *__addr, size_t __len) { return 0; }
+static __inline__ int munlock (const void *__addr, size_t __len) { return 0; }
static __inline__ int mlockall (int __flags) { return 0; }
static __inline__ int munlockall (void) { return 0; }
#endif
@@ -156,19 +157,22 @@ extern int mincore (void *__start, size_t __len, unsigned char *__vec)
resides after a successful call. */
extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
int __flags, ...) __THROW;
+libc_hidden_proto(mremap)
+#ifdef __UCLIBC_LINUX_SPECIFIC__
/* Remap arbitrary pages of a shared backing store within an existing
VMA. */
extern int remap_file_pages (void *__start, size_t __size, int __prot,
size_t __pgoff, int __flags) __THROW;
#endif
+#endif
/* Open shared memory segment. */
-extern int shm_open (__const char *__name, int __oflag, mode_t __mode);
+extern int shm_open (const char *__name, int __oflag, mode_t __mode);
/* Remove shared memory segment. */
-extern int shm_unlink (__const char *__name);
+extern int shm_unlink (const char *__name);
__END_DECLS
diff --git a/include/sys/mount.h b/include/sys/mount.h
index b30554987..c0e7b84f8 100644
--- a/include/sys/mount.h
+++ b/include/sys/mount.h
@@ -1,5 +1,5 @@
/* Header file for mounting/unmount Linux filesystems.
- Copyright (C) 1996,1997,1998,1999,2000,2004 Free Software Foundation, Inc.
+ Copyright (C) 1996-2000, 2004, 2010, 2012 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
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/* This is taken from /usr/include/linux/fs.h. */
@@ -47,23 +46,46 @@ enum
#define MS_REMOUNT MS_REMOUNT
MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
#define MS_MANDLOCK MS_MANDLOCK
- S_WRITE = 128, /* Write on file/directory/symlink. */
-#define S_WRITE S_WRITE
- S_APPEND = 256, /* Append-only file. */
-#define S_APPEND S_APPEND
- S_IMMUTABLE = 512, /* Immutable file. */
-#define S_IMMUTABLE S_IMMUTABLE
+ MS_DIRSYNC = 128, /* Directory modifications are synchronous. */
+#define MS_DIRSYNC MS_DIRSYNC
MS_NOATIME = 1024, /* Do not update access times. */
#define MS_NOATIME MS_NOATIME
MS_NODIRATIME = 2048, /* Do not update directory access times. */
#define MS_NODIRATIME MS_NODIRATIME
MS_BIND = 4096, /* Bind directory at different place. */
#define MS_BIND MS_BIND
+ MS_MOVE = 8192,
+#define MS_MOVE MS_MOVE
+ MS_REC = 16384,
+#define MS_REC MS_REC
+ MS_SILENT = 32768,
+#define MS_SILENT MS_SILENT
+ MS_POSIXACL = 1 << 16, /* VFS does not apply the umask. */
+#define MS_POSIXACL MS_POSIXACL
+ MS_UNBINDABLE = 1 << 17, /* Change to unbindable. */
+#define MS_UNBINDABLE MS_UNBINDABLE
+ MS_PRIVATE = 1 << 18, /* Change to private. */
+#define MS_PRIVATE MS_PRIVATE
+ MS_SLAVE = 1 << 19, /* Change to slave. */
+#define MS_SLAVE MS_SLAVE
+ MS_SHARED = 1 << 20, /* Change to shared. */
+#define MS_SHARED MS_SHARED
+ MS_RELATIME = 1 << 21, /* Update atime relative to mtime/ctime. */
+#define MS_RELATIME MS_RELATIME
+ MS_KERNMOUNT = 1 << 22, /* This is a kern_mount call. */
+#define MS_KERNMOUNT MS_KERNMOUNT
+ MS_I_VERSION = 1 << 23, /* Update inode I_version field. */
+#define MS_I_VERSION MS_I_VERSION
+ MS_STRICTATIME = 1 << 24, /* Always perform atime updates. */
+#define MS_STRICTATIME MS_STRICTATIME
+ MS_ACTIVE = 1 << 30,
+#define MS_ACTIVE MS_ACTIVE
+ MS_NOUSER = 1 << 31
+#define MS_NOUSER MS_NOUSER
};
/* Flags that can be altered by MS_REMOUNT */
-#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME \
- |MS_NODIRATIME)
+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION)
/* Magic mount flag number. Has to be or-ed to the flag values. */
@@ -96,23 +118,32 @@ enum
/* Possible value for FLAGS parameter of `umount2'. */
enum
{
- MNT_FORCE = 1 /* Force unmounting. */
+ MNT_FORCE = 1, /* Force unmounting. */
#define MNT_FORCE MNT_FORCE
+ MNT_DETACH = 2, /* Just detach from the tree. */
+#define MNT_DETACH MNT_DETACH
+ MNT_EXPIRE = 4, /* Mark for expiry. */
+#define MNT_EXPIRE MNT_EXPIRE
+ UMOUNT_NOFOLLOW = 8 /* Don't follow symlink on umount. */
+#define UMOUNT_NOFOLLOW UMOUNT_NOFOLLOW
};
__BEGIN_DECLS
/* Mount a filesystem. */
-extern int mount (__const char *__special_file, __const char *__dir,
- __const char *__fstype, unsigned long int __rwflag,
- __const void *__data) __THROW;
+extern int mount (const char *__special_file, const char *__dir,
+ const char *__fstype, unsigned long int __rwflag,
+ const void *__data) __THROW;
/* Unmount a filesystem. */
-extern int umount (__const char *__special_file) __THROW;
+extern int umount (const char *__special_file) __THROW;
+#ifdef __UCLIBC_LINUX_SPECIFIC__
/* Unmount a filesystem. Force unmounting if FLAGS is set to MNT_FORCE. */
-extern int umount2 (__const char *__special_file, int __flags) __THROW;
+extern int umount2 (const char *__special_file, int __flags) __THROW;
+libc_hidden_proto(umount2)
+#endif
__END_DECLS
diff --git a/include/sys/msg.h b/include/sys/msg.h
index 1fd64b2ac..b27e972ae 100644
--- a/include/sys/msg.h
+++ b/include/sys/msg.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995,1996,1997,1999,2000,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1997,1999,2000,2003,2006,2007
+ 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
@@ -12,15 +13,17 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_MSG_H
#define _SYS_MSG_H
#include <features.h>
+#define __need_size_t
+#include <stddef.h>
+
/* Get common definition of System V style IPC. */
#include <sys/ipc.h>
@@ -66,14 +69,14 @@ extern int msgget (key_t __key, int __msgflg) __THROW;
This function is a cancellation point and therefore not marked with
__THROW. */
-extern int msgrcv (int __msqid, void *__msgp, size_t __msgsz,
- long int __msgtyp, int __msgflg);
+extern ssize_t msgrcv (int __msqid, void *__msgp, size_t __msgsz,
+ long int __msgtyp, int __msgflg);
/* Send message to message queue.
This function is a cancellation point and therefore not marked with
__THROW. */
-extern int msgsnd (int __msqid, __const void *__msgp, size_t __msgsz,
+extern int msgsnd (int __msqid, const void *__msgp, size_t __msgsz,
int __msgflg);
__END_DECLS
diff --git a/include/sys/mtio.h b/include/sys/mtio.h
index 51fa550cd..60f3e51e7 100644
--- a/include/sys/mtio.h
+++ b/include/sys/mtio.h
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/* Written by H. Bergman <hennus@cybercomm.nl>. */
diff --git a/include/sys/param.h b/include/sys/param.h
index 0b0424eb9..d329706c9 100644
--- a/include/sys/param.h
+++ b/include/sys/param.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,2000,2001,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1997,2000,2001,2003,2008 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
@@ -12,17 +12,26 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_PARAM_H
#define _SYS_PARAM_H 1
+#ifndef ARG_MAX
+# define __undef_ARG_MAX
+#endif
+
#include <limits.h>
#include <linux/limits.h>
#include <linux/param.h>
+/* The kernel headers defines ARG_MAX. The value is wrong, though. */
+#ifndef __undef_ARG_MAX
+# undef ARG_MAX
+# undef __undef_ARG_MAX
+#endif
+
/* BSD names for some <limits.h> values. */
#define NBBY CHAR_BIT
@@ -31,12 +40,12 @@
#endif
#define MAXSYMLINKS 20
#define CANBSIZ MAX_CANON
-#define NCARGS ARG_MAX
#define MAXPATHLEN PATH_MAX
-/* The following is not really correct but it is a value we used for a
+/* The following are not really correct but it is a value we used for a
long time and which seems to be usable. People should not use NOFILE
- anyway. */
+ and NCARGS anyway. */
#define NOFILE 256
+#define NCARGS 131072
#include <sys/types.h>
diff --git a/include/sys/personality.h b/include/sys/personality.h
index 154b1131a..ee1de6403 100644
--- a/include/sys/personality.h
+++ b/include/sys/personality.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/* Taken verbatim from Linux 2.4 (include/linux/personality.h). */
diff --git a/include/sys/poll.h b/include/sys/poll.h
index a298dac15..029a9badd 100644
--- a/include/sys/poll.h
+++ b/include/sys/poll.h
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_POLL_H
#define _SYS_POLL_H 1
@@ -30,8 +29,6 @@
/* Get the timespec definition. */
# define __need_timespec
# include <time.h>
-/* get NULL definition. */
-# include <stddef.h>
#endif
@@ -58,6 +55,7 @@ __BEGIN_DECLS
This function is a cancellation point and therefore not marked with
__THROW. */
extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout);
+libc_hidden_proto(poll)
#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__
/* Like poll, but before waiting the threads signal mask is replaced
@@ -67,8 +65,8 @@ extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout);
This function is a cancellation point and therefore not marked with
__THROW. */
extern int ppoll (struct pollfd *__fds, nfds_t __nfds,
- __const struct timespec *__timeout,
- __const __sigset_t *__ss);
+ const struct timespec *__timeout,
+ const __sigset_t *__ss);
#endif
__END_DECLS
diff --git a/include/sys/queue.h b/include/sys/queue.h
index d62afcc84..daf4553d3 100644
--- a/include/sys/queue.h
+++ b/include/sys/queue.h
@@ -1,4 +1,4 @@
-/*-
+/*
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -10,7 +10,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -27,38 +27,24 @@
* SUCH DAMAGE.
*
* @(#)queue.h 8.5 (Berkeley) 8/20/94
- * $FreeBSD: src/sys/sys/queue.h,v 1.68 2006/10/24 11:20:29 ru Exp $
*/
-#ifndef _SYS_QUEUE_H_
+#ifndef _SYS_QUEUE_H_
#define _SYS_QUEUE_H_
-#include <sys/cdefs.h>
-
/*
- * This file defines four types of data structures: singly-linked lists,
- * singly-linked tail queues, lists and tail queues.
- *
- * A singly-linked list is headed by a single forward pointer. The elements
- * are singly linked for minimum space and pointer manipulation overhead at
- * the expense of O(n) removal for arbitrary elements. New elements can be
- * added to the list after an existing element or at the head of the list.
- * Elements being removed from the head of the list should use the explicit
- * macro for this purpose for optimum efficiency. A singly-linked list may
- * only be traversed in the forward direction. Singly-linked lists are ideal
- * for applications with large datasets and few or no removals or for
- * implementing a LIFO queue.
+ * This file defines five types of data structures: singly-linked lists,
+ * lists, simple queues, tail queues, and circular queues.
*
- * A singly-linked tail queue is headed by a pair of pointers, one to the
- * head of the list and the other to the tail of the list. The elements are
- * singly linked for minimum space and pointer manipulation overhead at the
- * expense of O(n) removal for arbitrary elements. New elements can be added
- * to the list after an existing element, at the head of the list, or at the
- * end of the list. Elements being removed from the head of the tail queue
- * should use the explicit macro for this purpose for optimum efficiency.
- * A singly-linked tail queue may only be traversed in the forward direction.
- * Singly-linked tail queues are ideal for applications with large datasets
- * and few or no removals or for implementing a FIFO queue.
+ * A singly-linked list is headed by a single forward pointer. The
+ * elements are singly linked for minimum space and pointer manipulation
+ * overhead at the expense of O(n) removal for arbitrary elements. New
+ * elements can be added to the list after an existing element or at the
+ * head of the list. Elements being removed from the head of the list
+ * should use the explicit macro for this purpose for optimum
+ * efficiency. A singly-linked list may only be traversed in the forward
+ * direction. Singly-linked lists are ideal for applications with large
+ * datasets and few or no removals or for implementing a LIFO queue.
*
* A list is headed by a single forward pointer (or an array of forward
* pointers for a hash table header). The elements are doubly linked
@@ -67,6 +53,13 @@
* or after an existing element or at the head of the list. A list
* may only be traversed in the forward direction.
*
+ * A simple queue is headed by a pair of pointers, one the head of the
+ * list and the other to the tail of the list. The elements are singly
+ * linked to save space, so elements can only be removed from the
+ * head of the list. New elements can be added to the list after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A simple queue may only be traversed in the forward direction.
+ *
* A tail queue is headed by a pair of pointers, one to the head of the
* list and the other to the tail of the list. The elements are doubly
* linked so that an arbitrary element can be removed without a need to
@@ -74,67 +67,85 @@
* after an existing element, at the head of the list, or at the end of
* the list. A tail queue may be traversed in either direction.
*
- * For details on the use of these macros, see the queue(3) manual page.
- *
- *
- * SLIST LIST STAILQ TAILQ
- * _HEAD + + + +
- * _HEAD_INITIALIZER + + + +
- * _ENTRY + + + +
- * _INIT + + + +
- * _EMPTY + + + +
- * _FIRST + + + +
- * _NEXT + + + +
- * _PREV - - - +
- * _LAST - - + +
- * _FOREACH + + + +
- * _FOREACH_SAFE + + + +
- * _FOREACH_REVERSE - - - +
- * _FOREACH_REVERSE_SAFE - - - +
- * _INSERT_HEAD + + + +
- * _INSERT_BEFORE - + - +
- * _INSERT_AFTER + + + +
- * _INSERT_TAIL - - + +
- * _CONCAT - - + +
- * _REMOVE_HEAD + - + -
- * _REMOVE + + + +
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
*
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * List definitions.
+ */
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+}
+
+#define LIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+
+/*
+ * List functions.
+ */
+#define LIST_INIT(head) do { \
+ (head)->lh_first = NULL; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_AFTER(listelm, elm, field) do { \
+ if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
+ (listelm)->field.le_next->field.le_prev = \
+ &(elm)->field.le_next; \
+ (listelm)->field.le_next = (elm); \
+ (elm)->field.le_prev = &(listelm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.le_prev = (listelm)->field.le_prev; \
+ (elm)->field.le_next = (listelm); \
+ *(listelm)->field.le_prev = (elm); \
+ (listelm)->field.le_prev = &(elm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.le_next = (head)->lh_first) != NULL) \
+ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+ (head)->lh_first = (elm); \
+ (elm)->field.le_prev = &(head)->lh_first; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_REMOVE(elm, field) do { \
+ if ((elm)->field.le_next != NULL) \
+ (elm)->field.le_next->field.le_prev = \
+ (elm)->field.le_prev; \
+ *(elm)->field.le_prev = (elm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_FOREACH(var, head, field) \
+ for ((var) = ((head)->lh_first); \
+ (var); \
+ (var) = ((var)->field.le_next))
+
+/*
+ * List access methods.
*/
-#ifdef QUEUE_MACRO_DEBUG
-/* Store the last 2 places the queue element or head was altered */
-struct qm_trace {
- char * lastfile;
- int lastline;
- char * prevfile;
- int prevline;
-};
-
-#define TRACEBUF struct qm_trace trace;
-#define TRASHIT(x) do {(x) = (void *)-1;} while (0)
-
-#define QMD_TRACE_HEAD(head) do { \
- (head)->trace.prevline = (head)->trace.lastline; \
- (head)->trace.prevfile = (head)->trace.lastfile; \
- (head)->trace.lastline = __LINE__; \
- (head)->trace.lastfile = __FILE__; \
-} while (0)
-
-#define QMD_TRACE_ELEM(elem) do { \
- (elem)->trace.prevline = (elem)->trace.lastline; \
- (elem)->trace.prevfile = (elem)->trace.lastfile; \
- (elem)->trace.lastline = __LINE__; \
- (elem)->trace.lastfile = __FILE__; \
-} while (0)
-
-#else
-#define QMD_TRACE_ELEM(elem)
-#define QMD_TRACE_HEAD(head)
-#define TRACEBUF
-#define TRASHIT(x)
-#endif /* QUEUE_MACRO_DEBUG */
+#define LIST_EMPTY(head) ((head)->lh_first == NULL)
+#define LIST_FIRST(head) ((head)->lh_first)
+#define LIST_NEXT(elm, field) ((elm)->field.le_next)
+
/*
- * Singly-linked List declarations.
+ * Singly-linked List definitions.
*/
#define SLIST_HEAD(name, type) \
struct name { \
@@ -152,66 +163,55 @@ struct { \
/*
* Singly-linked List functions.
*/
-#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
-
-#define SLIST_FIRST(head) ((head)->slh_first)
-
-#define SLIST_FOREACH(var, head, field) \
- for ((var) = SLIST_FIRST((head)); \
- (var); \
- (var) = SLIST_NEXT((var), field))
-
-#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
- for ((var) = SLIST_FIRST((head)); \
- (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
- (var) = (tvar))
-
-#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \
- for ((varp) = &SLIST_FIRST((head)); \
- ((var) = *(varp)) != NULL; \
- (varp) = &SLIST_NEXT((var), field))
-
#define SLIST_INIT(head) do { \
- SLIST_FIRST((head)) = NULL; \
-} while (0)
+ (head)->slh_first = NULL; \
+} while (/*CONSTCOND*/0)
#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
- SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
- SLIST_NEXT((slistelm), field) = (elm); \
-} while (0)
+ (elm)->field.sle_next = (slistelm)->field.sle_next; \
+ (slistelm)->field.sle_next = (elm); \
+} while (/*CONSTCOND*/0)
#define SLIST_INSERT_HEAD(head, elm, field) do { \
- SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
- SLIST_FIRST((head)) = (elm); \
-} while (0)
+ (elm)->field.sle_next = (head)->slh_first; \
+ (head)->slh_first = (elm); \
+} while (/*CONSTCOND*/0)
-#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
+#define SLIST_REMOVE_HEAD(head, field) do { \
+ (head)->slh_first = (head)->slh_first->field.sle_next; \
+} while (/*CONSTCOND*/0)
#define SLIST_REMOVE(head, elm, type, field) do { \
- if (SLIST_FIRST((head)) == (elm)) { \
+ if ((head)->slh_first == (elm)) { \
SLIST_REMOVE_HEAD((head), field); \
} \
else { \
- struct type *curelm = SLIST_FIRST((head)); \
- while (SLIST_NEXT(curelm, field) != (elm)) \
- curelm = SLIST_NEXT(curelm, field); \
- SLIST_NEXT(curelm, field) = \
- SLIST_NEXT(SLIST_NEXT(curelm, field), field); \
+ struct type *curelm = (head)->slh_first; \
+ while(curelm->field.sle_next != (elm)) \
+ curelm = curelm->field.sle_next; \
+ curelm->field.sle_next = \
+ curelm->field.sle_next->field.sle_next; \
} \
- TRASHIT((elm)->field.sle_next); \
-} while (0)
+} while (/*CONSTCOND*/0)
+
+#define SLIST_FOREACH(var, head, field) \
+ for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
+
+/*
+ * Singly-linked List access methods.
+ */
+#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
+#define SLIST_FIRST(head) ((head)->slh_first)
+#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
-#define SLIST_REMOVE_HEAD(head, field) do { \
- SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
-} while (0)
/*
* Singly-linked Tail queue declarations.
*/
-#define STAILQ_HEAD(name, type) \
+#define STAILQ_HEAD(name, type) \
struct name { \
- struct type *stqh_first;/* first element */ \
- struct type **stqh_last;/* addr of last next element */ \
+ struct type *stqh_first; /* first element */ \
+ struct type **stqh_last; /* addr of last next element */ \
}
#define STAILQ_HEAD_INITIALIZER(head) \
@@ -225,394 +225,350 @@ struct { \
/*
* Singly-linked Tail queue functions.
*/
-#define STAILQ_CONCAT(head1, head2) do { \
- if (!STAILQ_EMPTY((head2))) { \
- *(head1)->stqh_last = (head2)->stqh_first; \
- (head1)->stqh_last = (head2)->stqh_last; \
- STAILQ_INIT((head2)); \
- } \
-} while (0)
-
-#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
-
-#define STAILQ_FIRST(head) ((head)->stqh_first)
-
-#define STAILQ_FOREACH(var, head, field) \
- for((var) = STAILQ_FIRST((head)); \
- (var); \
- (var) = STAILQ_NEXT((var), field))
-
-
-#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
- for ((var) = STAILQ_FIRST((head)); \
- (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
- (var) = (tvar))
-
#define STAILQ_INIT(head) do { \
- STAILQ_FIRST((head)) = NULL; \
- (head)->stqh_last = &STAILQ_FIRST((head)); \
-} while (0)
-
-#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \
- if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
- (head)->stqh_last = &STAILQ_NEXT((elm), field); \
- STAILQ_NEXT((tqelm), field) = (elm); \
-} while (0)
+ (head)->stqh_first = NULL; \
+ (head)->stqh_last = &(head)->stqh_first; \
+} while (/*CONSTCOND*/0)
#define STAILQ_INSERT_HEAD(head, elm, field) do { \
- if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
- (head)->stqh_last = &STAILQ_NEXT((elm), field); \
- STAILQ_FIRST((head)) = (elm); \
-} while (0)
+ if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+ (head)->stqh_first = (elm); \
+} while (/*CONSTCOND*/0)
#define STAILQ_INSERT_TAIL(head, elm, field) do { \
- STAILQ_NEXT((elm), field) = NULL; \
+ (elm)->field.stqe_next = NULL; \
*(head)->stqh_last = (elm); \
- (head)->stqh_last = &STAILQ_NEXT((elm), field); \
-} while (0)
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+} while (/*CONSTCOND*/0)
-#define STAILQ_LAST(head, type, field) \
- (STAILQ_EMPTY((head)) ? \
- NULL : \
- ((struct type *)(void *) \
- ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
+#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+ (listelm)->field.stqe_next = (elm); \
+} while (/*CONSTCOND*/0)
-#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
+#define STAILQ_REMOVE_HEAD(head, field) do { \
+ if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
+ (head)->stqh_last = &(head)->stqh_first; \
+} while (/*CONSTCOND*/0)
#define STAILQ_REMOVE(head, elm, type, field) do { \
- if (STAILQ_FIRST((head)) == (elm)) { \
+ if ((head)->stqh_first == (elm)) { \
STAILQ_REMOVE_HEAD((head), field); \
+ } else { \
+ struct type *curelm = (head)->stqh_first; \
+ while (curelm->field.stqe_next != (elm)) \
+ curelm = curelm->field.stqe_next; \
+ if ((curelm->field.stqe_next = \
+ curelm->field.stqe_next->field.stqe_next) == NULL) \
+ (head)->stqh_last = &(curelm)->field.stqe_next; \
} \
- else { \
- struct type *curelm = STAILQ_FIRST((head)); \
- while (STAILQ_NEXT(curelm, field) != (elm)) \
- curelm = STAILQ_NEXT(curelm, field); \
- if ((STAILQ_NEXT(curelm, field) = \
- STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\
- (head)->stqh_last = &STAILQ_NEXT((curelm), field);\
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->stqh_first); \
+ (var); \
+ (var) = ((var)->field.stqe_next))
+
+#define STAILQ_CONCAT(head1, head2) do { \
+ if (!STAILQ_EMPTY((head2))) { \
+ *(head1)->stqh_last = (head2)->stqh_first; \
+ (head1)->stqh_last = (head2)->stqh_last; \
+ STAILQ_INIT((head2)); \
} \
- TRASHIT((elm)->field.stqe_next); \
-} while (0)
+} while (/*CONSTCOND*/0)
+
+/*
+ * Singly-linked Tail queue access methods.
+ */
+#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
+#define STAILQ_FIRST(head) ((head)->stqh_first)
+#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
-#define STAILQ_REMOVE_HEAD(head, field) do { \
- if ((STAILQ_FIRST((head)) = \
- STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
- (head)->stqh_last = &STAILQ_FIRST((head)); \
-} while (0)
/*
- * List declarations.
+ * Simple queue definitions.
*/
-#define LIST_HEAD(name, type) \
+#define SIMPLEQ_HEAD(name, type) \
struct name { \
- struct type *lh_first; /* first element */ \
+ struct type *sqh_first; /* first element */ \
+ struct type **sqh_last; /* addr of last next element */ \
}
-#define LIST_HEAD_INITIALIZER(head) \
- { NULL }
+#define SIMPLEQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).sqh_first }
-#define LIST_ENTRY(type) \
+#define SIMPLEQ_ENTRY(type) \
struct { \
- struct type *le_next; /* next element */ \
- struct type **le_prev; /* address of previous next element */ \
+ struct type *sqe_next; /* next element */ \
}
/*
- * List functions.
+ * Simple queue functions.
*/
+#define SIMPLEQ_INIT(head) do { \
+ (head)->sqh_first = NULL; \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (head)->sqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.sqe_next = NULL; \
+ *(head)->sqh_last = (elm); \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (listelm)->field.sqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_REMOVE_HEAD(head, field) do { \
+ if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_REMOVE(head, elm, type, field) do { \
+ if ((head)->sqh_first == (elm)) { \
+ SIMPLEQ_REMOVE_HEAD((head), field); \
+ } else { \
+ struct type *curelm = (head)->sqh_first; \
+ while (curelm->field.sqe_next != (elm)) \
+ curelm = curelm->field.sqe_next; \
+ if ((curelm->field.sqe_next = \
+ curelm->field.sqe_next->field.sqe_next) == NULL) \
+ (head)->sqh_last = &(curelm)->field.sqe_next; \
+ } \
+} while (/*CONSTCOND*/0)
-#if (defined(_KERNEL) && defined(INVARIANTS))
-#define QMD_LIST_CHECK_HEAD(head, field) do { \
- if (LIST_FIRST((head)) != NULL && \
- LIST_FIRST((head))->field.le_prev != \
- &LIST_FIRST((head))) \
- panic("Bad list head %p first->prev != head", (head)); \
-} while (0)
-
-#define QMD_LIST_CHECK_NEXT(elm, field) do { \
- if (LIST_NEXT((elm), field) != NULL && \
- LIST_NEXT((elm), field)->field.le_prev != \
- &((elm)->field.le_next)) \
- panic("Bad link elm %p next->prev != elm", (elm)); \
-} while (0)
-
-#define QMD_LIST_CHECK_PREV(elm, field) do { \
- if (*(elm)->field.le_prev != (elm)) \
- panic("Bad link elm %p prev->next != elm", (elm)); \
-} while (0)
-#else
-#define QMD_LIST_CHECK_HEAD(head, field)
-#define QMD_LIST_CHECK_NEXT(elm, field)
-#define QMD_LIST_CHECK_PREV(elm, field)
-#endif /* (_KERNEL && INVARIANTS) */
-
-#define LIST_EMPTY(head) ((head)->lh_first == NULL)
-
-#define LIST_FIRST(head) ((head)->lh_first)
-
-#define LIST_FOREACH(var, head, field) \
- for ((var) = LIST_FIRST((head)); \
- (var); \
- (var) = LIST_NEXT((var), field))
-
-#define LIST_FOREACH_SAFE(var, head, field, tvar) \
- for ((var) = LIST_FIRST((head)); \
- (var) && ((tvar) = LIST_NEXT((var), field), 1); \
- (var) = (tvar))
-
-#define LIST_INIT(head) do { \
- LIST_FIRST((head)) = NULL; \
-} while (0)
-
-#define LIST_INSERT_AFTER(listelm, elm, field) do { \
- QMD_LIST_CHECK_NEXT(listelm, field); \
- if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
- LIST_NEXT((listelm), field)->field.le_prev = \
- &LIST_NEXT((elm), field); \
- LIST_NEXT((listelm), field) = (elm); \
- (elm)->field.le_prev = &LIST_NEXT((listelm), field); \
-} while (0)
-
-#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
- QMD_LIST_CHECK_PREV(listelm, field); \
- (elm)->field.le_prev = (listelm)->field.le_prev; \
- LIST_NEXT((elm), field) = (listelm); \
- *(listelm)->field.le_prev = (elm); \
- (listelm)->field.le_prev = &LIST_NEXT((elm), field); \
-} while (0)
-
-#define LIST_INSERT_HEAD(head, elm, field) do { \
- QMD_LIST_CHECK_HEAD((head), field); \
- if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
- LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
- LIST_FIRST((head)) = (elm); \
- (elm)->field.le_prev = &LIST_FIRST((head)); \
-} while (0)
+#define SIMPLEQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->sqh_first); \
+ (var); \
+ (var) = ((var)->field.sqe_next))
-#define LIST_NEXT(elm, field) ((elm)->field.le_next)
+/*
+ * Simple queue access methods.
+ */
+#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL)
+#define SIMPLEQ_FIRST(head) ((head)->sqh_first)
+#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
-#define LIST_REMOVE(elm, field) do { \
- QMD_LIST_CHECK_NEXT(elm, field); \
- QMD_LIST_CHECK_PREV(elm, field); \
- if (LIST_NEXT((elm), field) != NULL) \
- LIST_NEXT((elm), field)->field.le_prev = \
- (elm)->field.le_prev; \
- *(elm)->field.le_prev = LIST_NEXT((elm), field); \
- TRASHIT((elm)->field.le_next); \
- TRASHIT((elm)->field.le_prev); \
-} while (0)
/*
- * Tail queue declarations.
+ * Tail queue definitions.
*/
-#define TAILQ_HEAD(name, type) \
+#define _TAILQ_HEAD(name, type, qual) \
struct name { \
- struct type *tqh_first; /* first element */ \
- struct type **tqh_last; /* addr of last next element */ \
- TRACEBUF \
+ qual type *tqh_first; /* first element */ \
+ qual type *qual *tqh_last; /* addr of last next element */ \
}
+#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,)
#define TAILQ_HEAD_INITIALIZER(head) \
{ NULL, &(head).tqh_first }
-#define TAILQ_ENTRY(type) \
+#define _TAILQ_ENTRY(type, qual) \
struct { \
- struct type *tqe_next; /* next element */ \
- struct type **tqe_prev; /* address of previous next element */ \
- TRACEBUF \
+ qual type *tqe_next; /* next element */ \
+ qual type *qual *tqe_prev; /* address of previous next element */\
}
+#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,)
/*
* Tail queue functions.
*/
-#if (defined(_KERNEL) && defined(INVARIANTS))
-#define QMD_TAILQ_CHECK_HEAD(head, field) do { \
- if (!TAILQ_EMPTY(head) && \
- TAILQ_FIRST((head))->field.tqe_prev != \
- &TAILQ_FIRST((head))) \
- panic("Bad tailq head %p first->prev != head", (head)); \
-} while (0)
-
-#define QMD_TAILQ_CHECK_TAIL(head, field) do { \
- if (*(head)->tqh_last != NULL) \
- panic("Bad tailq NEXT(%p->tqh_last) != NULL", (head)); \
-} while (0)
-
-#define QMD_TAILQ_CHECK_NEXT(elm, field) do { \
- if (TAILQ_NEXT((elm), field) != NULL && \
- TAILQ_NEXT((elm), field)->field.tqe_prev != \
- &((elm)->field.tqe_next)) \
- panic("Bad link elm %p next->prev != elm", (elm)); \
-} while (0)
-
-#define QMD_TAILQ_CHECK_PREV(elm, field) do { \
- if (*(elm)->field.tqe_prev != (elm)) \
- panic("Bad link elm %p prev->next != elm", (elm)); \
-} while (0)
-#else
-#define QMD_TAILQ_CHECK_HEAD(head, field)
-#define QMD_TAILQ_CHECK_TAIL(head, headname)
-#define QMD_TAILQ_CHECK_NEXT(elm, field)
-#define QMD_TAILQ_CHECK_PREV(elm, field)
-#endif /* (_KERNEL && INVARIANTS) */
-
-#define TAILQ_CONCAT(head1, head2, field) do { \
- if (!TAILQ_EMPTY(head2)) { \
- *(head1)->tqh_last = (head2)->tqh_first; \
- (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
- (head1)->tqh_last = (head2)->tqh_last; \
- TAILQ_INIT((head2)); \
- QMD_TRACE_HEAD(head1); \
- QMD_TRACE_HEAD(head2); \
- } \
-} while (0)
-
-#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
-
-#define TAILQ_FIRST(head) ((head)->tqh_first)
-
-#define TAILQ_FOREACH(var, head, field) \
- for ((var) = TAILQ_FIRST((head)); \
- (var); \
- (var) = TAILQ_NEXT((var), field))
-
-#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
- for ((var) = TAILQ_FIRST((head)); \
- (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
- (var) = (tvar))
-
-#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
- for ((var) = TAILQ_LAST((head), headname); \
- (var); \
- (var) = TAILQ_PREV((var), headname, field))
-
-#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \
- for ((var) = TAILQ_LAST((head), headname); \
- (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
- (var) = (tvar))
-
#define TAILQ_INIT(head) do { \
- TAILQ_FIRST((head)) = NULL; \
- (head)->tqh_last = &TAILQ_FIRST((head)); \
- QMD_TRACE_HEAD(head); \
-} while (0)
-
-#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
- QMD_TAILQ_CHECK_NEXT(listelm, field); \
- if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
- TAILQ_NEXT((elm), field)->field.tqe_prev = \
- &TAILQ_NEXT((elm), field); \
- else { \
- (head)->tqh_last = &TAILQ_NEXT((elm), field); \
- QMD_TRACE_HEAD(head); \
- } \
- TAILQ_NEXT((listelm), field) = (elm); \
- (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \
- QMD_TRACE_ELEM(&(elm)->field); \
- QMD_TRACE_ELEM(&listelm->field); \
-} while (0)
-
-#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
- QMD_TAILQ_CHECK_PREV(listelm, field); \
- (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
- TAILQ_NEXT((elm), field) = (listelm); \
- *(listelm)->field.tqe_prev = (elm); \
- (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
- QMD_TRACE_ELEM(&(elm)->field); \
- QMD_TRACE_ELEM(&listelm->field); \
-} while (0)
+ (head)->tqh_first = NULL; \
+ (head)->tqh_last = &(head)->tqh_first; \
+} while (/*CONSTCOND*/0)
#define TAILQ_INSERT_HEAD(head, elm, field) do { \
- QMD_TAILQ_CHECK_HEAD(head, field); \
- if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
- TAILQ_FIRST((head))->field.tqe_prev = \
- &TAILQ_NEXT((elm), field); \
+ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
+ (head)->tqh_first->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
else \
- (head)->tqh_last = &TAILQ_NEXT((elm), field); \
- TAILQ_FIRST((head)) = (elm); \
- (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
- QMD_TRACE_HEAD(head); \
- QMD_TRACE_ELEM(&(elm)->field); \
-} while (0)
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (head)->tqh_first = (elm); \
+ (elm)->field.tqe_prev = &(head)->tqh_first; \
+} while (/*CONSTCOND*/0)
#define TAILQ_INSERT_TAIL(head, elm, field) do { \
- QMD_TAILQ_CHECK_TAIL(head, field); \
- TAILQ_NEXT((elm), field) = NULL; \
+ (elm)->field.tqe_next = NULL; \
(elm)->field.tqe_prev = (head)->tqh_last; \
*(head)->tqh_last = (elm); \
- (head)->tqh_last = &TAILQ_NEXT((elm), field); \
- QMD_TRACE_HEAD(head); \
- QMD_TRACE_ELEM(&(elm)->field); \
-} while (0)
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
-#define TAILQ_LAST(head, headname) \
- (*(((struct headname *)((head)->tqh_last))->tqh_last))
-
-#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+ (elm)->field.tqe_next->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (listelm)->field.tqe_next = (elm); \
+ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
-#define TAILQ_PREV(elm, headname, field) \
- (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
+ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
+ (elm)->field.tqe_next = (listelm); \
+ *(listelm)->field.tqe_prev = (elm); \
+ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
#define TAILQ_REMOVE(head, elm, field) do { \
- QMD_TAILQ_CHECK_NEXT(elm, field); \
- QMD_TAILQ_CHECK_PREV(elm, field); \
- if ((TAILQ_NEXT((elm), field)) != NULL) \
- TAILQ_NEXT((elm), field)->field.tqe_prev = \
+ if (((elm)->field.tqe_next) != NULL) \
+ (elm)->field.tqe_next->field.tqe_prev = \
(elm)->field.tqe_prev; \
- else { \
+ else \
(head)->tqh_last = (elm)->field.tqe_prev; \
- QMD_TRACE_HEAD(head); \
- } \
- *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
- TRASHIT((elm)->field.tqe_next); \
- TRASHIT((elm)->field.tqe_prev); \
- QMD_TRACE_ELEM(&(elm)->field); \
-} while (0)
+ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+#define TAILQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->tqh_first); \
+ (var); \
+ (var) = ((var)->field.tqe_next))
-#ifdef _KERNEL
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
+ for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
+ (var); \
+ (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
+
+#define TAILQ_CONCAT(head1, head2, field) do { \
+ if (!TAILQ_EMPTY(head2)) { \
+ *(head1)->tqh_last = (head2)->tqh_first; \
+ (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
+ (head1)->tqh_last = (head2)->tqh_last; \
+ TAILQ_INIT((head2)); \
+ } \
+} while (/*CONSTCOND*/0)
/*
- * XXX insque() and remque() are an old way of handling certain queues.
- * They bogusly assumes that all queue heads look alike.
+ * Tail queue access methods.
*/
+#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-struct quehead {
- struct quehead *qh_link;
- struct quehead *qh_rlink;
-};
-
-#ifdef __CC_SUPPORTS___INLINE
+#define TAILQ_LAST(head, headname) \
+ (*(((struct headname *)((head)->tqh_last))->tqh_last))
+#define TAILQ_PREV(elm, headname, field) \
+ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
-static __inline void
-insque(void *a, void *b)
-{
- struct quehead *element = (struct quehead *)a,
- *head = (struct quehead *)b;
- element->qh_link = head->qh_link;
- element->qh_rlink = head;
- head->qh_link = element;
- element->qh_link->qh_rlink = element;
+/*
+ * Circular queue definitions.
+ */
+#define CIRCLEQ_HEAD(name, type) \
+struct name { \
+ struct type *cqh_first; /* first element */ \
+ struct type *cqh_last; /* last element */ \
}
-static __inline void
-remque(void *a)
-{
- struct quehead *element = (struct quehead *)a;
+#define CIRCLEQ_HEAD_INITIALIZER(head) \
+ { (void *)&head, (void *)&head }
- element->qh_link->qh_rlink = element->qh_rlink;
- element->qh_rlink->qh_link = element->qh_link;
- element->qh_rlink = 0;
+#define CIRCLEQ_ENTRY(type) \
+struct { \
+ struct type *cqe_next; /* next element */ \
+ struct type *cqe_prev; /* previous element */ \
}
-#else /* !__CC_SUPPORTS___INLINE */
+/*
+ * Circular queue functions.
+ */
+#define CIRCLEQ_INIT(head) do { \
+ (head)->cqh_first = (void *)(head); \
+ (head)->cqh_last = (void *)(head); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
+ (elm)->field.cqe_prev = (listelm); \
+ if ((listelm)->field.cqe_next == (void *)(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
+ (listelm)->field.cqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
+ (elm)->field.cqe_next = (listelm); \
+ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
+ if ((listelm)->field.cqe_prev == (void *)(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
+ (listelm)->field.cqe_prev = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
+ (elm)->field.cqe_next = (head)->cqh_first; \
+ (elm)->field.cqe_prev = (void *)(head); \
+ if ((head)->cqh_last == (void *)(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (head)->cqh_first->field.cqe_prev = (elm); \
+ (head)->cqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.cqe_next = (void *)(head); \
+ (elm)->field.cqe_prev = (head)->cqh_last; \
+ if ((head)->cqh_first == (void *)(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (head)->cqh_last->field.cqe_next = (elm); \
+ (head)->cqh_last = (elm); \
+} while (/*CONSTCOND*/0)
-void insque(void *a, void *b);
-void remque(void *a);
+#define CIRCLEQ_REMOVE(head, elm, field) do { \
+ if ((elm)->field.cqe_next == (void *)(head)) \
+ (head)->cqh_last = (elm)->field.cqe_prev; \
+ else \
+ (elm)->field.cqe_next->field.cqe_prev = \
+ (elm)->field.cqe_prev; \
+ if ((elm)->field.cqe_prev == (void *)(head)) \
+ (head)->cqh_first = (elm)->field.cqe_next; \
+ else \
+ (elm)->field.cqe_prev->field.cqe_next = \
+ (elm)->field.cqe_next; \
+} while (/*CONSTCOND*/0)
-#endif /* __CC_SUPPORTS___INLINE */
+#define CIRCLEQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->cqh_first); \
+ (var) != (const void *)(head); \
+ (var) = ((var)->field.cqe_next))
-#endif /* _KERNEL */
+#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
+ for ((var) = ((head)->cqh_last); \
+ (var) != (const void *)(head); \
+ (var) = ((var)->field.cqe_prev))
-#endif /* !_SYS_QUEUE_H_ */
+/*
+ * Circular queue access methods.
+ */
+#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head))
+#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
+#define CIRCLEQ_LAST(head) ((head)->cqh_last)
+#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
+#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
+
+#define CIRCLEQ_LOOP_NEXT(head, elm, field) \
+ (((elm)->field.cqe_next == (void *)(head)) \
+ ? ((head)->cqh_first) \
+ : (elm->field.cqe_next))
+#define CIRCLEQ_LOOP_PREV(head, elm, field) \
+ (((elm)->field.cqe_prev == (void *)(head)) \
+ ? ((head)->cqh_last) \
+ : (elm->field.cqe_prev))
+
+#endif /* sys/queue.h */
diff --git a/include/sys/quota.h b/include/sys/quota.h
index a6afdbe44..088e6139e 100644
--- a/include/sys/quota.h
+++ b/include/sys/quota.h
@@ -30,8 +30,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * Version: $Id: quota.h,v 1.1 2002/01/03 04:00:09 andersen Exp $
*/
#ifndef _SYS_QUOTA_H
@@ -40,6 +38,19 @@
#include <features.h>
#include <sys/types.h>
+#ifdef __UCLIBC__
+# undef _LINUX_QUOTA_VERSION
+# define _LINUX_QUOTA_VERSION 1
+#endif
+
+/*
+ * Select between different incompatible quota versions.
+ * Default to the version used by Linux kernel version 2.4.22
+ * or later. */
+#ifndef _LINUX_QUOTA_VERSION
+# define _LINUX_QUOTA_VERSION 2
+#endif
+
/*
* Convert diskblocks to blocks and the other way around.
* currently only to fool the BSD source. :-)
@@ -94,21 +105,33 @@
#define SUBCMDSHIFT 8
#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
-#define Q_QUOTAON 0x0100 /* enable quotas */
-#define Q_QUOTAOFF 0x0200 /* disable quotas */
-#define Q_GETQUOTA 0x0300 /* get limits and usage */
-#define Q_SETQUOTA 0x0400 /* set limits and usage */
-#define Q_SETUSE 0x0500 /* set usage */
-#define Q_SYNC 0x0600 /* sync disk copy of a filesystems quotas */
-#define Q_SETQLIM 0x0700 /* set limits */
-#define Q_GETSTATS 0x0800 /* get collected stats */
-#define Q_RSQUASH 0x1000 /* set root_squash option */
+#if _LINUX_QUOTA_VERSION < 2
+# define Q_QUOTAON 0x0100 /* enable quotas */
+# define Q_QUOTAOFF 0x0200 /* disable quotas */
+# define Q_GETQUOTA 0x0300 /* get limits and usage */
+# define Q_SETQUOTA 0x0400 /* set limits and usage */
+# define Q_SETUSE 0x0500 /* set usage */
+# define Q_SYNC 0x0600 /* sync disk copy of a filesystems quotas */
+# define Q_SETQLIM 0x0700 /* set limits */
+# define Q_GETSTATS 0x0800 /* get collected stats */
+# define Q_RSQUASH 0x1000 /* set root_squash option */
+#else
+# define Q_SYNC 0x800001 /* sync disk copy of a filesystems quotas */
+# define Q_QUOTAON 0x800002 /* turn quotas on */
+# define Q_QUOTAOFF 0x800003 /* turn quotas off */
+# define Q_GETFMT 0x800004 /* get quota format used on given filesystem */
+# define Q_GETINFO 0x800005 /* get information about quota files */
+# define Q_SETINFO 0x800006 /* set information about quota files */
+# define Q_GETQUOTA 0x800007 /* get user quota structure */
+# define Q_SETQUOTA 0x800008 /* set user quota structure */
+#endif
/*
* The following structure defines the format of the disk quota file
* (as it appears on disk) - the file is an array of these structures
* indexed by user or group number.
*/
+#if _LINUX_QUOTA_VERSION < 2
struct dqblk
{
u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
@@ -120,13 +143,45 @@ struct dqblk
time_t dqb_btime; /* time limit for excessive disk use */
time_t dqb_itime; /* time limit for excessive files */
};
+#else
+
+/* Flags that indicate which fields in dqblk structure are valid. */
+#define QIF_BLIMITS 1
+#define QIF_SPACE 2
+#define QIF_ILIMITS 4
+#define QIF_INODES 8
+#define QIF_BTIME 16
+#define QIF_ITIME 32
+#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
+#define QIF_USAGE (QIF_SPACE | QIF_INODES)
+#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
+#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
+
+struct dqblk
+ {
+ u_int64_t dqb_bhardlimit; /* absolute limit on disk quota blocks alloc */
+ u_int64_t dqb_bsoftlimit; /* preferred limit on disk quota blocks */
+ u_int64_t dqb_curspace; /* current quota block count */
+ u_int64_t dqb_ihardlimit; /* maximum # allocated inodes */
+ u_int64_t dqb_isoftlimit; /* preferred inode limit */
+ u_int64_t dqb_curinodes; /* current # allocated inodes */
+ u_int64_t dqb_btime; /* time limit for excessive disk use */
+ u_int64_t dqb_itime; /* time limit for excessive files */
+ u_int32_t dqb_valid; /* bitmask of QIF_* constants */
+ };
+#endif
/*
* Shorthand notation.
*/
#define dq_bhardlimit dq_dqb.dqb_bhardlimit
#define dq_bsoftlimit dq_dqb.dqb_bsoftlimit
-#define dq_curblocks dq_dqb.dqb_curblocks
+#if _LINUX_QUOTA_VERSION < 2
+# define dq_curblocks dq_dqb.dqb_curblocks
+#else
+# define dq_curspace dq_dqb.dqb_curspace
+# define dq_valid dq_dqb.dqb_valid
+#endif
#define dq_ihardlimit dq_dqb.dqb_ihardlimit
#define dq_isoftlimit dq_dqb.dqb_isoftlimit
#define dq_curinodes dq_dqb.dqb_curinodes
@@ -135,6 +190,7 @@ struct dqblk
#define dqoff(UID) ((loff_t)((UID) * sizeof (struct dqblk)))
+#if _LINUX_QUOTA_VERSION < 2
struct dqstats
{
u_int32_t lookups;
@@ -147,6 +203,22 @@ struct dqstats
u_int32_t free_dquots;
u_int32_t syncs;
};
+#else
+
+/* Flags that indicate which fields in dqinfo structure are valid. */
+# define IIF_BGRACE 1
+# define IIF_IGRACE 2
+# define IIF_FLAGS 4
+# define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
+
+struct dqinfo
+ {
+ u_int64_t dqi_bgrace;
+ u_int64_t dqi_igrace;
+ u_int32_t dqi_flags;
+ u_int32_t dqi_valid;
+ };
+#endif
__BEGIN_DECLS
diff --git a/include/sys/reboot.h b/include/sys/reboot.h
index 2a719c7a3..bc685aebb 100644
--- a/include/sys/reboot.h
+++ b/include/sys/reboot.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/* This file should define RB_* macros to be used as flag
bits in the argument to the `reboot' system call. */
diff --git a/include/sys/resource.h b/include/sys/resource.h
index 391274137..17167ed99 100644
--- a/include/sys/resource.h
+++ b/include/sys/resource.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_RESOURCE_H
#define _SYS_RESOURCE_H 1
@@ -50,6 +49,7 @@ typedef int __priority_which_t;
#ifndef __USE_FILE_OFFSET64
extern int getrlimit (__rlimit_resource_t __resource,
struct rlimit *__rlimits) __THROW;
+libc_hidden_proto(getrlimit)
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (getrlimit, (__rlimit_resource_t __resource,
@@ -68,11 +68,12 @@ extern int getrlimit64 (__rlimit_resource_t __resource,
Return 0 if successful, -1 if not (and sets errno). */
#ifndef __USE_FILE_OFFSET64
extern int setrlimit (__rlimit_resource_t __resource,
- __const struct rlimit *__rlimits) __THROW;
+ const struct rlimit *__rlimits) __THROW;
+libc_hidden_proto(setrlimit)
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (setrlimit, (__rlimit_resource_t __resource,
- __const struct rlimit *__rlimits),
+ const struct rlimit *__rlimits),
setrlimit64);
# else
# define setrlimit setrlimit64
@@ -80,7 +81,7 @@ extern int __REDIRECT_NTH (setrlimit, (__rlimit_resource_t __resource,
#endif
#ifdef __USE_LARGEFILE64
extern int setrlimit64 (__rlimit_resource_t __resource,
- __const struct rlimit64 *__rlimits) __THROW;
+ const struct rlimit64 *__rlimits) __THROW;
#endif
/* Return resource usage information on process indicated by WHO
@@ -92,11 +93,13 @@ extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW;
(as specified by WHO) is used. A lower priority number means higher
priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */
extern int getpriority (__priority_which_t __which, id_t __who) __THROW;
+libc_hidden_proto(getpriority)
/* Set the priority of all processes specified by WHICH and WHO (see above)
to PRIO. Returns 0 on success, -1 on errors. */
extern int setpriority (__priority_which_t __which, id_t __who, int __prio)
__THROW;
+libc_hidden_proto(setpriority)
__END_DECLS
diff --git a/include/sys/select.h b/include/sys/select.h
index 2a408433e..0c2192dbb 100644
--- a/include/sys/select.h
+++ b/include/sys/select.h
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/* POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h> */
@@ -110,6 +109,10 @@ extern int select (int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds,
fd_set *__restrict __exceptfds,
struct timeval *__restrict __timeout);
+#ifdef _LIBC
+extern __typeof(select) __select_nocancel attribute_hidden;
+libc_hidden_proto(select)
+#endif
#ifdef __USE_XOPEN2K
/* Same as above only that the TIMEOUT value is given with higher
diff --git a/include/sys/sem.h b/include/sys/sem.h
index 24a57fc32..84168d834 100644
--- a/include/sys/sem.h
+++ b/include/sys/sem.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_SEM_H
#define _SYS_SEM_H 1
@@ -61,7 +60,7 @@ extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW;
#ifdef __USE_GNU
/* Operate on semaphore with timeout. */
extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops,
- __const struct timespec *__timeout) __THROW;
+ const struct timespec *__timeout) __THROW;
#endif
__END_DECLS
diff --git a/include/sys/sendfile.h b/include/sys/sendfile.h
index 4c1367b6b..dae074c05 100644
--- a/include/sys/sendfile.h
+++ b/include/sys/sendfile.h
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_SENDFILE_H
#define _SYS_SENDFILE_H 1
@@ -45,6 +44,7 @@ extern ssize_t __REDIRECT_NTH (sendfile,
#ifdef __USE_LARGEFILE64
extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
size_t __count) __THROW;
+libc_hidden_proto(sendfile64)
#endif
__END_DECLS
diff --git a/include/sys/shm.h b/include/sys/shm.h
index 8ec30b486..8f04adeb4 100644
--- a/include/sys/shm.h
+++ b/include/sys/shm.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999, 2000, 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
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_SHM_H
#define _SYS_SHM_H 1
@@ -41,6 +40,7 @@ typedef __pid_t pid_t;
# endif
#endif /* X/Open */
+
__BEGIN_DECLS
/* The following System V style IPC functions implement a shared memory
@@ -53,11 +53,11 @@ extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW;
extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW;
/* Attach shared memory segment. */
-extern void *shmat (int __shmid, __const void *__shmaddr, int __shmflg)
+extern void *shmat (int __shmid, const void *__shmaddr, int __shmflg)
__THROW;
/* Detach shared memory segment. */
-extern int shmdt (__const void *__shmaddr) __THROW;
+extern int shmdt (const void *__shmaddr) __THROW;
__END_DECLS
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 4ae1ea980..8642312aa 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -1,5 +1,6 @@
/* Declarations of socket constants, types, and functions.
- Copyright (C) 1991,92,1994-2001,2003 Free Software Foundation, Inc.
+ Copyright (C) 1991,92,1994-2001,2003,2005,2007,2008
+ 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
@@ -13,9 +14,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_SOCKET_H
#define _SYS_SOCKET_H 1
@@ -27,6 +27,10 @@ __BEGIN_DECLS
#include <sys/uio.h>
#define __need_size_t
#include <stddef.h>
+#ifdef __USE_GNU
+/* Get the __sigset_t definition. */
+# include <bits/sigset.h>
+#endif
/* This operating system-specific header file defines the SOCK_*, PF_*,
@@ -64,7 +68,7 @@ enum
old-style declaration, too. */
#if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU
# define __SOCKADDR_ARG struct sockaddr *__restrict
-# define __CONST_SOCKADDR_ARG __const struct sockaddr *
+# define __CONST_SOCKADDR_ARG const struct sockaddr *
#else
/* Add more `struct sockaddr_AF' types here as necessary.
These are all the ones I found on NetBSD and Linux. */
@@ -87,7 +91,7 @@ enum
typedef union { __SOCKADDR_ALLTYPES
} __SOCKADDR_ARG __attribute__ ((__transparent_union__));
# undef __SOCKADDR_ONETYPE
-# define __SOCKADDR_ONETYPE(type) __const struct type *__restrict __##type##__;
+# define __SOCKADDR_ONETYPE(type) const struct type *__restrict __##type##__;
typedef union { __SOCKADDR_ALLTYPES
} __CONST_SOCKADDR_ARG __attribute__ ((__transparent_union__));
# undef __SOCKADDR_ONETYPE
@@ -98,6 +102,7 @@ typedef union { __SOCKADDR_ALLTYPES
protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically.
Returns a file descriptor for the new socket, or -1 for errors. */
extern int socket (int __domain, int __type, int __protocol) __THROW;
+libc_hidden_proto(socket)
/* Create two new sockets, of type TYPE in domain DOMAIN and using
protocol PROTOCOL, which are connected to each other, and put file
@@ -109,10 +114,12 @@ extern int socketpair (int __domain, int __type, int __protocol,
/* Give the socket FD the local address ADDR (which is LEN bytes long). */
extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len)
__THROW;
+libc_hidden_proto(bind)
/* Put the local address of FD into *ADDR and its length in *LEN. */
extern int getsockname (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __len) __THROW;
+libc_hidden_proto(getsockname)
/* Open a connection on socket FD to peer at ADDR (which LEN bytes long).
For connectionless socket types, just set the default address to send to
@@ -122,6 +129,7 @@ extern int getsockname (int __fd, __SOCKADDR_ARG __addr,
This function is a cancellation point and therefore not marked with
__THROW. */
extern int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
+libc_hidden_proto(connect)
/* Put the address of the peer connected to socket FD into *ADDR
(which is *LEN bytes long), and its actual length into *LEN. */
@@ -133,7 +141,8 @@ extern int getpeername (int __fd, __SOCKADDR_ARG __addr,
This function is a cancellation point and therefore not marked with
__THROW. */
-extern ssize_t send (int __fd, __const void *__buf, size_t __n, int __flags);
+extern ssize_t send (int __fd, const void *__buf, size_t __n, int __flags);
+libc_hidden_proto(send)
/* Read N bytes into BUF from socket FD.
Returns the number read or -1 for errors.
@@ -141,15 +150,20 @@ extern ssize_t send (int __fd, __const void *__buf, size_t __n, int __flags);
This function is a cancellation point and therefore not marked with
__THROW. */
extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags);
+libc_hidden_proto(recv)
/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
ADDR_LEN bytes long). Returns the number sent, or -1 for errors.
This function is a cancellation point and therefore not marked with
__THROW. */
-extern ssize_t sendto (int __fd, __const void *__buf, size_t __n,
+extern ssize_t sendto (int __fd, const void *__buf, size_t __n,
int __flags, __CONST_SOCKADDR_ARG __addr,
socklen_t __addr_len);
+#ifdef _LIBC
+extern __typeof(sendto) __sendto_nocancel attribute_hidden;
+libc_hidden_proto(sendto)
+#endif
/* Read N bytes into BUF through socket FD.
If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of
@@ -161,6 +175,10 @@ extern ssize_t sendto (int __fd, __const void *__buf, size_t __n,
extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
int __flags, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len);
+#ifdef _LIBC
+extern __typeof(recvfrom) __recvfrom_nocancel attribute_hidden;
+libc_hidden_proto(recvfrom)
+#endif
/* Send a message described MESSAGE on socket FD.
@@ -168,8 +186,9 @@ extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
This function is a cancellation point and therefore not marked with
__THROW. */
-extern ssize_t sendmsg (int __fd, __const struct msghdr *__message,
+extern ssize_t sendmsg (int __fd, const struct msghdr *__message,
int __flags);
+libc_hidden_proto(sendmsg)
/* Receive a message as described by MESSAGE from socket FD.
Returns the number of bytes read or -1 for errors.
@@ -177,6 +196,7 @@ extern ssize_t sendmsg (int __fd, __const struct msghdr *__message,
This function is a cancellation point and therefore not marked with
__THROW. */
extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
+libc_hidden_proto(recvmsg)
/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL
@@ -190,13 +210,15 @@ extern int getsockopt (int __fd, int __level, int __optname,
to *OPTVAL (which is OPTLEN bytes long).
Returns 0 on success, -1 for errors. */
extern int setsockopt (int __fd, int __level, int __optname,
- __const void *__optval, socklen_t __optlen) __THROW;
+ const void *__optval, socklen_t __optlen) __THROW;
+libc_hidden_proto(setsockopt)
/* Prepare to accept connections on socket FD.
N connection requests will be queued before further requests are refused.
Returns 0 on success, -1 for errors. */
extern int listen (int __fd, int __n) __THROW;
+libc_hidden_proto(listen)
/* Await a connection on socket FD.
When a connection arrives, open a new socket to communicate with it,
@@ -208,6 +230,16 @@ extern int listen (int __fd, int __n) __THROW;
__THROW. */
extern int accept (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len);
+libc_hidden_proto(accept)
+
+#if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU
+/* Similar to 'accept' but takes an additional parameter to specify flags.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int accept4 (int __fd, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __addr_len, int __flags);
+#endif
/* Shut down all or part of the connection open on socket FD.
HOW determines what to shut down:
@@ -218,7 +250,7 @@ extern int accept (int __fd, __SOCKADDR_ARG __addr,
extern int shutdown (int __fd, int __how) __THROW;
-#ifdef __USE_XOPEN2K
+#if 0 /*def __USE_XOPEN2K*/
/* Determine wheter socket is at a out-of-band mark. */
extern int sockatmark (int __fd) __THROW;
#endif
@@ -233,4 +265,8 @@ extern int isfdtype (int __fd, int __fdtype) __THROW;
__END_DECLS
+#ifdef _LIBC
+extern int __socketcall(int, unsigned long *) attribute_hidden;
+#endif
+
#endif /* sys/socket.h */
diff --git a/include/sys/stat.h b/include/sys/stat.h
index 508239050..495a68cb1 100644
--- a/include/sys/stat.h
+++ b/include/sys/stat.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,1992,1995-2004,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995-2004, 2005, 2006, 2007, 2009
+ 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
@@ -12,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/*
* POSIX Standard: 5.6 File Characteristics <sys/stat.h>
@@ -27,11 +27,12 @@
#include <bits/types.h> /* For __mode_t and __dev_t. */
-#if defined __USE_XOPEN || defined __USE_MISC
+#if defined __USE_XOPEN || defined __USE_XOPEN2K || defined __USE_MISC \
+ || defined __USE_ATFILE
# if defined __USE_XOPEN || defined __USE_XOPEN2K
# define __need_time_t
# endif
-# ifdef __USE_MISC
+# if defined __USE_MISC || defined __USE_ATFILE
# define __need_timespec
# endif
# include <time.h> /* For time_t resp. timespec. */
@@ -204,15 +205,17 @@ __BEGIN_DECLS
#ifndef __USE_FILE_OFFSET64
/* Get file attributes for FILE and put them in BUF. */
-extern int stat (__const char *__restrict __file,
+extern int stat (const char *__restrict __file,
struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
+libc_hidden_proto(stat)
/* Get file attributes for the file, device, pipe, or socket
that file descriptor FD is open on and put them in BUF. */
extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2));
+libc_hidden_proto(fstat)
#else
# ifdef __REDIRECT_NTH
-extern int __REDIRECT_NTH (stat, (__const char *__restrict __file,
+extern int __REDIRECT_NTH (stat, (const char *__restrict __file,
struct stat *__restrict __buf), stat64)
__nonnull ((1, 2));
extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
@@ -223,9 +226,11 @@ extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64)
# endif
#endif
#ifdef __USE_LARGEFILE64
-extern int stat64 (__const char *__restrict __file,
+extern int stat64 (const char *__restrict __file,
struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2));
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
+libc_hidden_proto(stat64)
+libc_hidden_proto(fstat64)
#endif
#ifdef __USE_ATFILE
@@ -233,12 +238,13 @@ extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2));
Relative path names are interpreted relative to FD unless FD is
AT_FDCWD. */
# ifndef __USE_FILE_OFFSET64
-extern int fstatat (int __fd, __const char *__restrict __file,
+extern int fstatat (int __fd, const char *__restrict __file,
struct stat *__restrict __buf, int __flag)
__THROW __nonnull ((2, 3));
+libc_hidden_proto(fstatat)
# else
# ifdef __REDIRECT_NTH
-extern int __REDIRECT_NTH (fstatat, (int __fd, __const char *__restrict __file,
+extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file,
struct stat *__restrict __buf,
int __flag),
fstatat64) __nonnull ((2, 3));
@@ -247,21 +253,25 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, __const char *__restrict __file,
# endif
# endif
-extern int fstatat64 (int __fd, __const char *__restrict __file,
+# ifdef __USE_LARGEFILE64
+extern int fstatat64 (int __fd, const char *__restrict __file,
struct stat64 *__restrict __buf, int __flag)
__THROW __nonnull ((2, 3));
+libc_hidden_proto(fstatat64)
+# endif
#endif
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
# ifndef __USE_FILE_OFFSET64
/* Get file attributes about FILE and put them in BUF.
If FILE is a symbolic link, do not follow it. */
-extern int lstat (__const char *__restrict __file,
+extern int lstat (const char *__restrict __file,
struct stat *__restrict __buf) __THROW __nonnull ((1, 2));
+libc_hidden_proto(lstat)
# else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (lstat,
- (__const char *__restrict __file,
+ (const char *__restrict __file,
struct stat *__restrict __buf), lstat64)
__nonnull ((1, 2));
# else
@@ -269,22 +279,24 @@ extern int __REDIRECT_NTH (lstat,
# endif
# endif
# ifdef __USE_LARGEFILE64
-extern int lstat64 (__const char *__restrict __file,
+extern int lstat64 (const char *__restrict __file,
struct stat64 *__restrict __buf)
__THROW __nonnull ((1, 2));
+libc_hidden_proto(lstat64)
# endif
#endif
/* Set file access permissions for FILE to MODE.
If FILE is a symbolic link, this affects its target instead. */
-extern int chmod (__const char *__file, __mode_t __mode)
+extern int chmod (const char *__file, __mode_t __mode)
__THROW __nonnull ((1));
+libc_hidden_proto(chmod)
#if 0 /*def __USE_BSD*/
/* Set file access permissions for FILE to MODE.
If FILE is a symbolic link, this affects the link itself
rather than its target. */
-extern int lchmod (__const char *__file, __mode_t __mode)
+extern int lchmod (const char *__file, __mode_t __mode)
__THROW __nonnull ((1));
#endif
@@ -296,8 +308,10 @@ extern int fchmod (int __fd, __mode_t __mode) __THROW;
#ifdef __USE_ATFILE
/* Set file access permissions of FILE relative to
the directory FD is open on. */
-extern int fchmodat (int __fd, __const char *__file, __mode_t mode, int __flag)
+extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
+ int __flag)
__THROW __nonnull ((2)) __wur;
+libc_hidden_proto(fchmodat)
#endif /* Use ATFILE. */
@@ -313,46 +327,65 @@ extern __mode_t getumask (void) __THROW;
#endif
/* Create a new directory named PATH, with permission bits MODE. */
-extern int mkdir (__const char *__path, __mode_t __mode)
+extern int mkdir (const char *__path, __mode_t __mode)
__THROW __nonnull ((1));
+libc_hidden_proto(mkdir)
#ifdef __USE_ATFILE
/* Like mkdir, create a new directory with permission bits MODE. But
interpret relative PATH names relative to the directory associated
with FD. */
-extern int mkdirat (int __fd, __const char *__path, __mode_t __mode)
+extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
__THROW __nonnull ((2));
+libc_hidden_proto(mkdirat)
#endif
/* Create a device file named PATH, with permission and special bits MODE
and device number DEV (which can be constructed from major and minor
device numbers with the `makedev' macro above). */
#if defined __USE_MISC || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
+extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
__THROW __nonnull ((1));
-#endif
+libc_hidden_proto(mknod)
-#ifdef __USE_ATFILE
+# ifdef __USE_ATFILE
/* Like mknod, create a new device file with permission bits MODE and
device number DEV. But interpret relative PATH names relative to
the directory associated with FD. */
-extern int mknodat (int __fd, __const char *__path, __mode_t __mode,
+extern int mknodat (int __fd, const char *__path, __mode_t __mode,
__dev_t __dev) __THROW __nonnull ((2));
+libc_hidden_proto(mknodat)
+# endif
#endif
/* Create a new FIFO named PATH, with permission bits MODE. */
-extern int mkfifo (__const char *__path, __mode_t __mode)
+extern int mkfifo (const char *__path, __mode_t __mode)
__THROW __nonnull ((1));
#ifdef __USE_ATFILE
/* Like mkfifo, create a new FIFO with permission bits MODE. But
interpret relative PATH names relative to the directory associated
with FD. */
-extern int mkfifoat (int __fd, __const char *__path, __mode_t __mode)
+extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
__THROW __nonnull ((2));
#endif
+
+#ifdef __USE_ATFILE
+/* Set file access and modification times relative to directory file
+ descriptor. */
+extern int utimensat (int __fd, const char *__path,
+ const struct timespec __times[2],
+ int __flags)
+ __THROW __nonnull ((2));
+libc_hidden_proto(utimensat)
+#endif
+#ifdef __USE_XOPEN2K8
+/* Set file access and modification times of the file associated with FD. */
+extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
+#endif
+
/* on uClibc we have unversioned struct stat and mknod.
* bits/stat.h is filled with wrong info, so we undo it here. */
#undef _STAT_VER
diff --git a/include/sys/statfs.h b/include/sys/statfs.h
index f4177d4c9..ab74b0bbd 100644
--- a/include/sys/statfs.h
+++ b/include/sys/statfs.h
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_STATFS_H
#define _SYS_STATFS_H 1
@@ -29,23 +28,24 @@ __BEGIN_DECLS
/* Return information about the filesystem on which FILE resides. */
#ifndef __USE_FILE_OFFSET64
-extern int statfs (__const char *__file, struct statfs *__buf)
+extern int statfs (const char *__file, struct statfs *__buf)
__THROW __nonnull ((1, 2));
+libc_hidden_proto(statfs)
#else
# ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (statfs,
- (__const char *__file, struct statfs *__buf),
+ (const char *__file, struct statfs *__buf),
statfs64) __nonnull ((1, 2));
# else
# define statfs statfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
-extern int statfs64 (__const char *__file, struct statfs64 *__buf)
+extern int statfs64 (const char *__file, struct statfs64 *__buf)
__THROW __nonnull ((1, 2));
+libc_hidden_proto(statfs64)
#endif
-#if defined __UCLIBC_LINUX_SPECIFIC__
/* Return information about the filesystem containing the file FILDES
refers to. */
#ifndef __USE_FILE_OFFSET64
@@ -62,8 +62,8 @@ extern int __REDIRECT_NTH (fstatfs, (int __fildes, struct statfs *__buf),
#ifdef __USE_LARGEFILE64
extern int fstatfs64 (int __fildes, struct statfs64 *__buf)
__THROW __nonnull ((2));
+libc_hidden_proto(fstatfs64)
#endif
-#endif /* __UCLIBC_LINUX_SPECIFIC__ */
__END_DECLS
diff --git a/include/sys/statvfs.h b/include/sys/statvfs.h
index 685dd2619..e5e0c2362 100644
--- a/include/sys/statvfs.h
+++ b/include/sys/statvfs.h
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_STATVFS_H
#define _SYS_STATVFS_H 1
@@ -49,13 +48,14 @@ __BEGIN_DECLS
/* Return information about the filesystem on which FILE resides. */
#ifndef __USE_FILE_OFFSET64
-extern int statvfs (__const char *__restrict __file,
+extern int statvfs (const char *__restrict __file,
struct statvfs *__restrict __buf)
__THROW __nonnull ((1, 2));
+libc_hidden_proto(statvfs)
#else
-# ifdef __REDIRECT
-extern int __REDIRECT (statvfs,
- (__const char *__restrict __file,
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (statvfs,
+ (const char *__restrict __file,
struct statvfs *__restrict __buf), statvfs64)
__nonnull ((1, 2));
# else
@@ -63,7 +63,7 @@ extern int __REDIRECT (statvfs,
# endif
#endif
#ifdef __USE_LARGEFILE64
-extern int statvfs64 (__const char *__restrict __file,
+extern int statvfs64 (const char *__restrict __file,
struct statvfs64 *__restrict __buf)
__THROW __nonnull ((1, 2));
#endif
@@ -73,9 +73,10 @@ extern int statvfs64 (__const char *__restrict __file,
#ifndef __USE_FILE_OFFSET64
extern int fstatvfs (int __fildes, struct statvfs *__buf)
__THROW __nonnull ((2));
+libc_hidden_proto(fstatvfs)
#else
-# ifdef __REDIRECT
-extern int __REDIRECT (fstatvfs, (int __fildes, struct statvfs *__buf),
+# ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (fstatvfs, (int __fildes, struct statvfs *__buf),
fstatvfs64) __nonnull ((2));
# else
# define fstatvfs fstatvfs64
diff --git a/include/sys/swap.h b/include/sys/swap.h
index b6e7bef5d..29faba616 100644
--- a/include/sys/swap.h
+++ b/include/sys/swap.h
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_SWAP_H
@@ -33,10 +32,10 @@ __BEGIN_DECLS
/* Make the block special device PATH available to the system for swapping.
This call is restricted to the super-user. */
-extern int swapon (__const char *__path, int __flags) __THROW;
+extern int swapon (const char *__path, int __flags) __THROW;
/* Stop using block special device PATH for swapping. */
-extern int swapoff (__const char *__path) __THROW;
+extern int swapoff (const char *__path) __THROW;
__END_DECLS
diff --git a/include/sys/syscall.h b/include/sys/syscall.h
index 4c8ede843..ec8a75cf1 100644
--- a/include/sys/syscall.h
+++ b/include/sys/syscall.h
@@ -12,26 +12,26 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYSCALL_H
#define _SYSCALL_H 1
+/* User application code should use syscall(). */
+
+#include <features.h>
+#include <bits/sysnum.h>
+#ifdef _LIBC
/* The _syscall#() macros are for uClibc internal use only.
- * User application code should use syscall() instead.
*
* The kernel provided _syscall[0-6] macros from asm/unistd.h are not suitable
* for use in uClibc as they lack PIC support etc, so for uClibc we use our own
* local _syscall# macros to be certain all such variations are handled
* properly.
*/
-
-#include <features.h>
-#include <bits/sysnum.h>
-#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
# include <bits/syscalls.h>
+# include <bits/syscalls-common.h>
#endif
#endif
diff --git a/include/sys/sysctl.h b/include/sys/sysctl.h
index 110efaa76..2c2d68819 100644
--- a/include/sys/sysctl.h
+++ b/include/sys/sysctl.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_SYSCTL_H
#define _SYS_SYSCTL_H 1
diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h
index 9fd4fa829..00e363371 100644
--- a/include/sys/sysinfo.h
+++ b/include/sys/sysinfo.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_SYSINFO_H
#define _SYS_SYSINFO_H 1
@@ -24,6 +23,8 @@
#ifndef _LINUX_KERNEL_H
/* Include our own copy of struct sysinfo to avoid binary compatability
* problems with Linux 2.4, which changed things. Grumble, grumble. */
+#define _LINUX_SYSINFO_H
+
#define SI_LOAD_SHIFT 16
struct sysinfo {
long uptime; /* Seconds since boot */
@@ -48,19 +49,20 @@ __BEGIN_DECLS
/* Returns information on overall system statistics. */
extern int sysinfo (struct sysinfo *__info) __THROW;
-
/* Return number of configured processors. */
-extern int get_nprocs_conf (void) __THROW;
+#define get_nprocs_conf() (sysconf(_SC_NPROCESSORS_CONF))
/* Return number of available processors. */
-extern int get_nprocs (void) __THROW;
+#define get_nprocs() (sysconf(_SC_NPROCESSORS_ONLN))
+#if 0
/* Return number of physical pages of memory in the system. */
extern long int get_phys_pages (void) __THROW;
/* Return number of available physical pages of memory in the system. */
extern long int get_avphys_pages (void) __THROW;
+#endif
__END_DECLS
diff --git a/include/sys/syslog.h b/include/sys/syslog.h
index 3f5e6b297..8808d217c 100644
--- a/include/sys/syslog.h
+++ b/include/sys/syslog.h
@@ -184,7 +184,7 @@ extern void closelog (void);
This function is a possible cancellation point and therefore not
marked with __THROW. */
-extern void openlog (__const char *__ident, int __option, int __facility);
+extern void openlog (const char *__ident, int __option, int __facility);
/* Set the log mask level. */
extern int setlogmask (int __mask) __THROW;
@@ -193,8 +193,9 @@ extern int setlogmask (int __mask) __THROW;
This function is a possible cancellation point and therefore not
marked with __THROW. */
-extern void syslog (int __pri, __const char *__fmt, ...)
+extern void syslog (int __pri, const char *__fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
+libc_hidden_proto(syslog)
#ifdef __USE_BSD
/* Generate a log message using FMT and using arguments pointed to by AP.
@@ -203,7 +204,7 @@ extern void syslog (int __pri, __const char *__fmt, ...)
cancellation point. But due to similarity with an POSIX interface
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
-extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
+extern void vsyslog (int __pri, const char *__fmt, __gnuc_va_list __ap)
__attribute__ ((__format__ (__printf__, 2, 0)));
#endif
diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h
index c5efca4f9..3addb7500 100644
--- a/include/sys/sysmacros.h
+++ b/include/sys/sysmacros.h
@@ -13,44 +13,47 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_SYSMACROS_H
#define _SYS_SYSMACROS_H 1
#include <features.h>
+__BEGIN_DECLS
+
/* If the compiler does not know long long it is out of luck. We are
not going to hack weird hacks to support the dev_t representation
they need. */
-#if 1 /*def __GLIBC_HAVE_LONG_LONG uClibc note: always enable */
+
__extension__
-static __inline unsigned int gnu_dev_major (unsigned long long int __dev)
- __THROW;
+extern unsigned int gnu_dev_major (unsigned long long int __dev)
+ __THROW __attribute__ ((__const__));
+libc_hidden_proto(gnu_dev_major)
__extension__
-static __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
- __THROW;
+extern unsigned int gnu_dev_minor (unsigned long long int __dev)
+ __THROW __attribute__ ((__const__));
+libc_hidden_proto(gnu_dev_minor)
__extension__
-static __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
+extern unsigned long long int gnu_dev_makedev (unsigned int __major,
unsigned int __minor)
- __THROW;
+ __THROW __attribute__ ((__const__));
-# if defined __GNUC__ && __GNUC__ >= 2
-__extension__ static __inline unsigned int
+# ifdef __USE_EXTERN_INLINES
+__extension__ __extern_inline __attribute__ ((__const__)) unsigned int
__NTH (gnu_dev_major (unsigned long long int __dev))
{
return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
}
-__extension__ static __inline unsigned int
+__extension__ __extern_inline __attribute__ ((__const__)) unsigned int
__NTH (gnu_dev_minor (unsigned long long int __dev))
{
return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
}
-__extension__ static __inline unsigned long long int
+__extension__ __extern_inline __attribute__ ((__const__)) unsigned long long int
__NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor))
{
return ((__minor & 0xff) | ((__major & 0xfff) << 8)
@@ -58,12 +61,11 @@ __NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor))
| (((unsigned long long int) (__major & ~0xfff)) << 32));
}
# endif
-
+__END_DECLS
/* Access the functions with their traditional names. */
# define major(dev) gnu_dev_major (dev)
# define minor(dev) gnu_dev_minor (dev)
# define makedev(maj, min) gnu_dev_makedev (maj, min)
-#endif
#endif /* sys/sysmacros.h */
diff --git a/include/sys/time.h b/include/sys/time.h
index 66fb9e021..3b7a106be 100644
--- a/include/sys/time.h
+++ b/include/sys/time.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991-1994,1996-2002,2003,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1994,1996-2003,2005,2006,2009
+ 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
@@ -12,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_TIME_H
#define _SYS_TIME_H 1
@@ -71,19 +71,21 @@ typedef void *__restrict __timezone_ptr_t;
Use the functions and variables declared in <time.h> instead. */
extern int gettimeofday (struct timeval *__restrict __tv,
__timezone_ptr_t __tz) __THROW __nonnull ((1));
+libc_hidden_proto(gettimeofday)
#ifdef __USE_BSD
/* Set the current time of day and timezone information.
This call is restricted to the super-user. */
-extern int settimeofday (__const struct timeval *__tv,
- __const struct timezone *__tz)
+extern int settimeofday (const struct timeval *__tv,
+ const struct timezone *__tz)
__THROW __nonnull ((1));
+libc_hidden_proto(settimeofday)
/* Adjust the current time of day by the amount in DELTA.
If OLDDELTA is not NULL, it is filled in with the amount
of time adjustment remaining to be done from the last `adjtime' call.
This call is restricted to the super-user. */
-extern int adjtime (__const struct timeval *__delta,
+extern int adjtime (const struct timeval *__delta,
struct timeval *__olddelta) __THROW;
#endif
@@ -130,30 +132,34 @@ extern int getitimer (__itimer_which_t __which,
set *OLD to the old value of timer WHICH.
Returns 0 on success, -1 on errors. */
extern int setitimer (__itimer_which_t __which,
- __const struct itimerval *__restrict __new,
+ const struct itimerval *__restrict __new,
struct itimerval *__restrict __old) __THROW;
+libc_hidden_proto(setitimer)
/* Change the access time of FILE to TVP[0] and the modification time of
FILE to TVP[1]. If TVP is a null pointer, use the current time instead.
Returns 0 on success, -1 on errors. */
-extern int utimes (__const char *__file, __const struct timeval __tvp[2])
+extern int utimes (const char *__file, const struct timeval __tvp[2])
__THROW __nonnull ((1));
+libc_hidden_proto(utimes)
-#if 0 /*def __USE_BSD*/
+#ifdef __USE_BSD
/* Same as `utimes', but does not follow symbolic links. */
-extern int lutimes (__const char *__file, __const struct timeval __tvp[2])
+extern int lutimes (const char *__file, const struct timeval __tvp[2])
__THROW __nonnull ((1));
+#if 0
/* Same as `utimes', but takes an open file descriptor instead of a name. */
-extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW;
+extern int futimes (int __fd, const struct timeval __tvp[2]) __THROW;
+#endif
#endif
-#if 0 /*def __USE_GNU*/
+#ifdef __USE_GNU
/* Change the access time of FILE relative to FD to TVP[0] and the
modification time of FILE to TVP[1]. If TVP is a null pointer, use
the current time instead. Returns 0 on success, -1 on errors. */
-extern int futimesat (int __fd, __const char *__file,
- __const struct timeval __tvp[2]) __THROW;
+extern int futimesat (int __fd, const char *__file,
+ const struct timeval __tvp[2]) __THROW;
#endif
diff --git a/include/sys/timeb.h b/include/sys/timeb.h
index dbdbf45a8..d34e4c10e 100644
--- a/include/sys/timeb.h
+++ b/include/sys/timeb.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_TIMEB_H
#define _SYS_TIMEB_H 1
diff --git a/include/sys/times.h b/include/sys/times.h
index 6022f2f84..3936762bd 100644
--- a/include/sys/times.h
+++ b/include/sys/times.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/*
* POSIX Standard: 4.5.2 Process Times <sys/times.h>
@@ -47,6 +46,7 @@ struct tms
Return the elapsed real time, or (clock_t) -1 for errors.
All times are in CLK_TCKths of a second. */
extern clock_t times (struct tms *__buffer) __THROW;
+libc_hidden_proto(times)
__END_DECLS
diff --git a/include/sys/timex.h b/include/sys/timex.h
index d2020a6d2..4cb81d208 100644
--- a/include/sys/timex.h
+++ b/include/sys/timex.h
@@ -12,15 +12,15 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_TIMEX_H
#define _SYS_TIMEX_H 1
#include <features.h>
#include <sys/time.h>
+#include <time.h>
/* These definitions from linux/timex.h as of 2.2.0. */
@@ -67,8 +67,12 @@ struct timex
#define ADJ_ESTERROR 0x0008 /* estimated time error */
#define ADJ_STATUS 0x0010 /* clock status */
#define ADJ_TIMECONST 0x0020 /* pll time constant */
-#define ADJ_TICK 0x4000 /* tick value */
-#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
+#define ADJ_TAI 0x0080 /* set TAI offset */
+#define ADJ_MICRO 0x1000 /* select microsecond resolution */
+#define ADJ_NANO 0x2000 /* select nanosecond resolution */
+#define ADJ_TICK 0x4000 /* tick value */
+#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
+#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */
/* xntp 3.4 compatibility names */
#define MOD_OFFSET ADJ_OFFSET
@@ -118,12 +122,15 @@ __BEGIN_DECLS
extern int __adjtimex (struct timex *__ntx) __THROW;
extern int adjtimex (struct timex *__ntx) __THROW;
+libc_hidden_proto(adjtimex)
#if defined __UCLIBC_NTP_LEGACY__
extern int ntp_gettime (struct ntptimeval *__ntv) __THROW;
extern int ntp_adjtime (struct timex *__tntx) __THROW;
#endif
-
+#if defined __UCLIBC_HAS_REALTIME__
+extern int clock_adjtime (clockid_t __clock_id, struct timex *__ntx) __THROW;
+#endif
__END_DECLS
#endif /* sys/timex.h */
diff --git a/include/sys/ttydefaults.h b/include/sys/ttydefaults.h
index 9be168b83..bb605a458 100644
--- a/include/sys/ttydefaults.h
+++ b/include/sys/ttydefaults.h
@@ -75,9 +75,9 @@
#define CSTART CTRL('q')
#define CSTOP CTRL('s')
#define CLNEXT CTRL('v')
-#define CDISCARD CTRL('o')
-#define CWERASE CTRL('w')
-#define CREPRINT CTRL('r')
+#define CDISCARD CTRL('o')
+#define CWERASE CTRL('w')
+#define CREPRINT CTRL('r')
#define CEOT CEOF
/* compat */
#define CBRK CEOL
diff --git a/include/sys/types.h b/include/sys/types.h
index 8c0b5dce3..2b45d0300 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -1,5 +1,5 @@
/* Copyright (C) 1991,1992,1994,1995,1996,1997,1998,1999,2000,2001,2002
- Free Software Foundation, Inc.
+ 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
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/*
* POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
@@ -165,7 +164,7 @@ typedef short int int16_t;
typedef int int32_t;
# if __WORDSIZE == 64
typedef long int int64_t;
-# elif defined __GNUC__ || defined __ICC
+# elif defined __GNUC__ || defined __ICC || defined __TenDRA__
__extension__ typedef long long int int64_t;
# endif
# endif
@@ -176,7 +175,7 @@ typedef unsigned short int u_int16_t;
typedef unsigned int u_int32_t;
# if __WORDSIZE == 64
typedef unsigned long int u_int64_t;
-# elif defined __GNUC__ || defined __ICC
+# elif defined __GNUC__ || defined __ICC || defined __TenDRA__
__extension__ typedef unsigned long long int u_int64_t;
# endif
diff --git a/include/sys/uio.h b/include/sys/uio.h
index 1b203f71c..efc681e7b 100644
--- a/include/sys/uio.h
+++ b/include/sys/uio.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_UIO_H
#define _SYS_UIO_H 1
@@ -37,7 +36,7 @@ __BEGIN_DECLS
This function is a cancellation point and therefore not marked with
__THROW. */
-extern ssize_t readv (int __fd, __const struct iovec *__iovec, int __count);
+extern ssize_t readv (int __fd, const struct iovec *__iovec, int __count);
/* Write data pointed by the buffers described by IOVEC, which
is a vector of COUNT `struct iovec's, to file descriptor FD.
@@ -47,7 +46,7 @@ extern ssize_t readv (int __fd, __const struct iovec *__iovec, int __count);
This function is a cancellation point and therefore not marked with
__THROW. */
-extern ssize_t writev (int __fd, __const struct iovec *__iovec, int __count);
+extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count);
__END_DECLS
diff --git a/include/sys/un.h b/include/sys/un.h
index 1fa10e4fe..e49d552bd 100644
--- a/include/sys/un.h
+++ b/include/sys/un.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_UN_H
#define _SYS_UN_H 1
diff --git a/include/sys/ustat.h b/include/sys/ustat.h
index 7a9cdac0d..11f51b20a 100644
--- a/include/sys/ustat.h
+++ b/include/sys/ustat.h
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/*
* This interface is obsolete. Use <sys/statfs.h> instead.
diff --git a/include/sys/utsname.h b/include/sys/utsname.h
index ca195cb4d..04ff55be7 100644
--- a/include/sys/utsname.h
+++ b/include/sys/utsname.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 94, 96, 97, 99 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,94,96,97,99,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
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/*
* POSIX Standard: 4.4 System Identification <sys/utsname.h>
@@ -29,26 +28,38 @@ __BEGIN_DECLS
#include <bits/utsname.h>
+#ifndef _UTSNAME_SYSNAME_LENGTH
+# define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH
+#endif
#ifndef _UTSNAME_NODENAME_LENGTH
# define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
#endif
+#ifndef _UTSNAME_RELEASE_LENGTH
+# define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH
+#endif
+#ifndef _UTSNAME_VERSION_LENGTH
+# define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH
+#endif
+#ifndef _UTSNAME_MACHINE_LENGTH
+# define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
+#endif
/* Structure describing the system and machine. */
struct utsname
{
/* Name of the implementation of the operating system. */
- char sysname[_UTSNAME_LENGTH];
+ char sysname[_UTSNAME_SYSNAME_LENGTH];
/* Name of this node on the network. */
char nodename[_UTSNAME_NODENAME_LENGTH];
/* Current release level of this implementation. */
- char release[_UTSNAME_LENGTH];
+ char release[_UTSNAME_RELEASE_LENGTH];
/* Current version level of this release. */
- char version[_UTSNAME_LENGTH];
+ char version[_UTSNAME_VERSION_LENGTH];
/* Name of the hardware type the system is running on. */
- char machine[_UTSNAME_LENGTH];
+ char machine[_UTSNAME_MACHINE_LENGTH];
#if _UTSNAME_DOMAIN_LENGTH - 0
/* Name of the domain of this node on the network. */
@@ -61,12 +72,14 @@ struct utsname
};
#ifdef __USE_SVID
+/* Note that SVID assumes all members have the same size. */
# define SYS_NMLN _UTSNAME_LENGTH
#endif
/* Put information about the system in NAME. */
extern int uname (struct utsname *__name) __THROW;
+libc_hidden_proto(uname)
__END_DECLS
diff --git a/include/sys/wait.h b/include/sys/wait.h
index 81a54fc3d..f7a420b93 100644
--- a/include/sys/wait.h
+++ b/include/sys/wait.h
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005
- Free Software Foundation, Inc.
+/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005,2007,2009
+ 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
@@ -13,9 +13,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/*
* POSIX Standard: 3.2.1 Wait for Process Termination <sys/wait.h>
@@ -29,10 +28,9 @@
__BEGIN_DECLS
#include <signal.h>
-#include <sys/resource.h>
/* These macros could also be defined in <stdlib.h>. */
-#if !defined _STDLIB_H || !defined __USE_XOPEN
+#if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8)
/* This will define the `W*' macros for the flag
bits to `waitpid', `wait3', and `wait4'. */
# include <bits/waitflags.h>
@@ -47,11 +45,11 @@ __BEGIN_DECLS
(__extension__ (((union { __typeof(status) __in; int __i; }) \
{ .__in = (status) }).__i))
# else
-# define __WAIT_INT(status) (*(__const int *) &(status))
+# define __WAIT_INT(status) (*(const int *) &(status))
# endif
/* This is the type of the argument to `wait'. The funky union
- causes redeclarations with ether `int *' or `union wait *' to be
+ causes redeclarations with either `int *' or `union wait *' to be
allowed without complaint. __WAIT_STATUS_DEFN is the type used in
the actual function definitions. */
@@ -79,26 +77,26 @@ typedef union
/* This will define all the `__W*' macros. */
# include <bits/waitstatus.h>
-# define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status))
-# define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status))
-# define WSTOPSIG(status) __WSTOPSIG(__WAIT_INT(status))
-# define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status))
-# define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status))
-# define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status))
-# if 0 /*def __WIFCONTINUED*/
-# define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status))
+# define WEXITSTATUS(status) __WEXITSTATUS (__WAIT_INT (status))
+# define WTERMSIG(status) __WTERMSIG (__WAIT_INT (status))
+# define WSTOPSIG(status) __WSTOPSIG (__WAIT_INT (status))
+# define WIFEXITED(status) __WIFEXITED (__WAIT_INT (status))
+# define WIFSIGNALED(status) __WIFSIGNALED (__WAIT_INT (status))
+# define WIFSTOPPED(status) __WIFSTOPPED (__WAIT_INT (status))
+# ifdef __WIFCONTINUED
+# define WIFCONTINUED(status) __WIFCONTINUED (__WAIT_INT (status))
# endif
#endif /* <stdlib.h> not included. */
#ifdef __USE_BSD
# define WCOREFLAG __WCOREFLAG
-# define WCOREDUMP(status) __WCOREDUMP(__WAIT_INT(status))
-# define W_EXITCODE(ret, sig) __W_EXITCODE(ret, sig)
-# define W_STOPCODE(sig) __W_STOPCODE(sig)
+# define WCOREDUMP(status) __WCOREDUMP (__WAIT_INT (status))
+# define W_EXITCODE(ret, sig) __W_EXITCODE (ret, sig)
+# define W_STOPCODE(sig) __W_STOPCODE (sig)
#endif
/* The following values are used by the `waitid' function. */
-#if defined __USE_SVID || defined __USE_XOPEN
+#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
typedef enum
{
P_ALL, /* Wait for any child. */
@@ -137,10 +135,20 @@ extern __pid_t wait (__WAIT_STATUS __stat_loc);
This function is a cancellation point and therefore not marked with
__THROW. */
extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
+#ifdef _LIBC
+extern __typeof(waitpid) __waitpid_nocancel attribute_hidden;
+libc_hidden_proto(waitpid)
+#endif
-#if defined __USE_SVID || defined __USE_XOPEN
+#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
+# ifndef __id_t_defined
+# include <bits/types.h>
+ typedef __id_t id_t;
+# define __id_t_defined
+# endif
# define __need_siginfo_t
# include <bits/siginfo.h>
+
/* Wait for a childing matching IDTYPE and ID to change the status and
place appropriate information in *INFOP.
If IDTYPE is P_PID, match any process whose process ID is ID.
@@ -157,29 +165,26 @@ extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
#endif
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-/* This being here makes the prototypes valid whether or not
- we have already included <sys/resource.h> to define `struct rusage'. */
struct rusage;
-
/* Wait for a child to exit. When one does, put its status in *STAT_LOC and
return its process ID. For errors return (pid_t) -1. If USAGE is not
nil, store information about the child's resource usage there. If the
WUNTRACED bit is set in OPTIONS, return status for stopped children;
otherwise don't. */
extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
- struct rusage * __usage) __THROW;
+ struct rusage * __usage) __THROWNL;
#endif
#ifdef __USE_BSD
-/* This being here makes the prototypes valid whether or not
- we have already included <sys/resource.h> to define `struct rusage'. */
-struct rusage;
-
/* PID is like waitpid. Other args are like wait3. */
extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
- struct rusage *__usage) __THROW;
+ struct rusage *__usage) __THROWNL;
#endif /* Use BSD. */
+#ifdef _LIBC
+extern __pid_t __wait4_nocancel(__pid_t, __WAIT_STATUS, int, struct rusage *) attribute_hidden;
+#endif
+
__END_DECLS
diff --git a/include/sys/xattr.h b/include/sys/xattr.h
index 2737f90bd..f39642dcc 100644
--- a/include/sys/xattr.h
+++ b/include/sys/xattr.h
@@ -12,9 +12,8 @@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#ifndef _SYS_XATTR_H
#define _SYS_XATTR_H 1
@@ -37,48 +36,48 @@ enum
/* Set the attribute NAME of the file pointed to by PATH to VALUE (which
is SIZE bytes long). Return 0 on success, -1 for errors. */
-extern int setxattr (__const char *__path, __const char *__name,
- __const void *__value, size_t __size, int __flags)
+extern int setxattr (const char *__path, const char *__name,
+ const void *__value, size_t __size, int __flags)
__THROW;
/* Set the attribute NAME of the file pointed to by PATH to VALUE (which is
SIZE bytes long), not following symlinks for the last pathname component.
Return 0 on success, -1 for errors. */
-extern int lsetxattr (__const char *__path, __const char *__name,
- __const void *__value, size_t __size, int __flags)
+extern int lsetxattr (const char *__path, const char *__name,
+ const void *__value, size_t __size, int __flags)
__THROW;
/* Set the attribute NAME of the file descriptor FD to VALUE (which is SIZE
bytes long). Return 0 on success, -1 for errors. */
-extern int fsetxattr (int __fd, __const char *__name, __const void *__value,
+extern int fsetxattr (int __fd, const char *__name, const void *__value,
size_t __size, int __flags) __THROW;
/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
SIZE bytes long). Return 0 on success, -1 for errors. */
-extern ssize_t getxattr (__const char *__path, __const char *__name,
+extern ssize_t getxattr (const char *__path, const char *__name,
void *__value, size_t __size) __THROW;
/* Get the attribute NAME of the file pointed to by PATH to VALUE (which is
SIZE bytes long), not following symlinks for the last pathname component.
Return 0 on success, -1 for errors. */
-extern ssize_t lgetxattr (__const char *__path, __const char *__name,
+extern ssize_t lgetxattr (const char *__path, const char *__name,
void *__value, size_t __size) __THROW;
/* Get the attribute NAME of the file descriptor FD to VALUE (which is SIZE
bytes long). Return 0 on success, -1 for errors. */
-extern ssize_t fgetxattr (int __fd, __const char *__name, void *__value,
+extern ssize_t fgetxattr (int __fd, const char *__name, void *__value,
size_t __size) __THROW;
/* List attributes of the file pointed to by PATH into the user-supplied
buffer LIST (which is SIZE bytes big). Return 0 on success, -1 for
errors. */
-extern ssize_t listxattr (__const char *__path, char *__list, size_t __size)
+extern ssize_t listxattr (const char *__path, char *__list, size_t __size)
__THROW;
/* List attributes of the file pointed to by PATH into the user-supplied
buffer LIST (which is SIZE bytes big), not following symlinks for the
last pathname component. Return 0 on success, -1 for errors. */
-extern ssize_t llistxattr (__const char *__path, char *__list, size_t __size)
+extern ssize_t llistxattr (const char *__path, char *__list, size_t __size)
__THROW;
/* List attributes of the file descriptor FD into the user-supplied buffer
@@ -88,16 +87,16 @@ extern ssize_t flistxattr (int __fd, char *__list, size_t __size)
/* Remove the attribute NAME from the file pointed to by PATH. Return 0
on success, -1 for errors. */
-extern int removexattr (__const char *__path, __const char *__name) __THROW;
+extern int removexattr (const char *__path, const char *__name) __THROW;
/* Remove the attribute NAME from the file pointed to by PATH, not
following symlinks for the last pathname component. Return 0 on
success, -1 for errors. */
-extern int lremovexattr (__const char *__path, __const char *__name) __THROW;
+extern int lremovexattr (const char *__path, const char *__name) __THROW;
/* Remove the attribute NAME from the file descriptor FD. Return 0 on
success, -1 for errors. */
-extern int fremovexattr (int __fd, __const char *__name) __THROW;
+extern int fremovexattr (int __fd, const char *__name) __THROW;
__END_DECLS