diff options
Diffstat (limited to 'sysdeps')
32 files changed, 389 insertions, 58 deletions
diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h index 6747bc276e..775c921eeb 100644 --- a/sysdeps/mach/hurd/bits/posix_opt.h +++ b/sysdeps/mach/hurd/bits/posix_opt.h @@ -1,5 +1,5 @@ /* Define POSIX options for GNU/Hurd. - Copyright (C) 1998,2000,2001,2002,2006 Free Software Foundation, Inc. + Copyright (C) 1998,2000,2001,2002,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 @@ -35,19 +35,19 @@ #undef _POSIX_SYNCHRONIZED_IO /* The fsync function is present. */ -#define _POSIX_FSYNC 200112L +#define _POSIX_FSYNC 200809L /* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L +#define _POSIX_MAPPED_FILES 200809L /* Locking of all memory could be supported in future. */ #define _POSIX_MEMLOCK 0 /* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L +#define _POSIX_MEMLOCK_RANGE 200809L /* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L +#define _POSIX_MEMORY_PROTECTION 200809L /* Elements of the `c_cc' member of `struct termios' structure can be disabled by using the value _POSIX_VDISABLE. */ @@ -66,7 +66,7 @@ /* We have the reentrant functions described in POSIX. */ #define _POSIX_REENTRANT_FUNCTIONS 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L +#define _POSIX_THREAD_SAFE_FUNCTIONS 200809L /* These are all things that won't be supported when _POSIX_THREADS is not. */ #define _POSIX_THREAD_PRIORITY_SCHEDULING -1 @@ -112,7 +112,7 @@ #define _POSIX_TIMEOUTS -1 /* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L +#define _POSIX_SPAWN 200809L /* We do not have POSIX timers, but could in future without ABI change. */ #define _POSIX_TIMERS 0 @@ -130,19 +130,19 @@ #define _POSIX_MONOTONIC_CLOCK 0 /* The clock selection interfaces are available. */ -#define _POSIX_CLOCK_SELECTION 200112L +#define _POSIX_CLOCK_SELECTION 200809L /* Advisory information interfaces could be available in future. */ #define _POSIX_ADVISORY_INFO 0 /* IPv6 support is available. */ -#define _POSIX_IPV6 200112L +#define _POSIX_IPV6 200809L /* Raw socket support is available. */ -#define _POSIX_RAW_SOCKETS 200112L +#define _POSIX_RAW_SOCKETS 200809L /* We have at least one terminal. */ -#define _POSIX2_CHAR_TERM 200112L +#define _POSIX2_CHAR_TERM 200809L /* Neither process nor thread sporadic server interfaces is available. */ #define _POSIX_SPORADIC_SERVER -1 diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c index f1d1ee4417..e734fdd9bd 100644 --- a/sysdeps/posix/sysconf.c +++ b/sysdeps/posix/sysconf.c @@ -1205,6 +1205,16 @@ __sysconf (name) return -1; #endif + case _SC_TRACE_EVENT_NAME_MAX: + case _SC_TRACE_NAME_MAX: + case _SC_TRACE_SYS_MAX: + case _SC_TRACE_USER_EVENT_MAX: + /* No support for tracing. */ + + case _SC_XOPEN_STREAMS: + /* No support for STREAMS. */ + return -1; + case _SC_LEVEL1_ICACHE_SIZE: case _SC_LEVEL1_ICACHE_ASSOC: case _SC_LEVEL1_ICACHE_LINESIZE: diff --git a/sysdeps/powerpc/powerpc32/power7/Implies b/sysdeps/powerpc/powerpc32/power7/Implies new file mode 100644 index 0000000000..03899d8a3c --- /dev/null +++ b/sysdeps/powerpc/powerpc32/power7/Implies @@ -0,0 +1 @@ +powerpc/powerpc32/power5 diff --git a/sysdeps/powerpc/powerpc64/power7/Implies b/sysdeps/powerpc/powerpc64/power7/Implies new file mode 100644 index 0000000000..13b03309fb --- /dev/null +++ b/sysdeps/powerpc/powerpc64/power7/Implies @@ -0,0 +1 @@ +powerpc/powerpc64/power5 diff --git a/sysdeps/powerpc/powerpc64/power7/fpu/Implies b/sysdeps/powerpc/powerpc64/power7/fpu/Implies new file mode 100644 index 0000000000..13b03309fb --- /dev/null +++ b/sysdeps/powerpc/powerpc64/power7/fpu/Implies @@ -0,0 +1 @@ +powerpc/powerpc64/power5 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index c93538c1ea..170c042dd1 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -139,7 +139,7 @@ endif ifeq ($(subdir),io) sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \ - sync_file_range open_2 open64_2 + sync_file_range open_2 open64_2 fallocate fallocate64 endif ifeq ($(subdir),elf) diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 76ecae0013..b348570bda 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -138,6 +138,9 @@ libc { GLIBC_2.9 { epoll_create1; inotify_init1; } + GLIBC_2.10 { + fallocate; fallocate64; + } GLIBC_PRIVATE { # functions used in other libraries __syscall_rt_sigqueueinfo; diff --git a/sysdeps/unix/sysv/linux/bits/posix_opt.h b/sysdeps/unix/sysv/linux/bits/posix_opt.h index 37612e0bd5..69198a6650 100644 --- a/sysdeps/unix/sysv/linux/bits/posix_opt.h +++ b/sysdeps/unix/sysv/linux/bits/posix_opt.h @@ -1,5 +1,5 @@ /* Define POSIX options for Linux. - Copyright (C) 1996,1997,1999,2000,2002,2003,2008 + Copyright (C) 1996,1997,1999,2000,2002,2003,2008,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -32,25 +32,25 @@ #define _POSIX_SAVED_IDS 1 /* Priority scheduling is supported. */ -#define _POSIX_PRIORITY_SCHEDULING 200112L +#define _POSIX_PRIORITY_SCHEDULING 200809L /* Synchronizing file data is supported. */ -#define _POSIX_SYNCHRONIZED_IO 200112L +#define _POSIX_SYNCHRONIZED_IO 200809L /* The fsync function is present. */ -#define _POSIX_FSYNC 200112L +#define _POSIX_FSYNC 200809L /* Mapping of files to memory is supported. */ -#define _POSIX_MAPPED_FILES 200112L +#define _POSIX_MAPPED_FILES 200809L /* Locking of all memory is supported. */ -#define _POSIX_MEMLOCK 200112L +#define _POSIX_MEMLOCK 200809L /* Locking of ranges of memory is supported. */ -#define _POSIX_MEMLOCK_RANGE 200112L +#define _POSIX_MEMLOCK_RANGE 200809L /* Setting of memory protections is supported. */ -#define _POSIX_MEMORY_PROTECTION 200112L +#define _POSIX_MEMORY_PROTECTION 200809L /* Some filesystems allow all users to change file ownership. */ #define _POSIX_CHOWN_RESTRICTED 0 @@ -69,7 +69,7 @@ #define _XOPEN_SHM 1 /* Real-time signals are supported. */ -#define _POSIX_REALTIME_SIGNALS 200112L +#define _POSIX_REALTIME_SIGNALS 200809L /* The LFS interface is available, except for the asynchronous I/O. */ #define _LFS_LARGEFILE 1 @@ -77,10 +77,10 @@ #define _LFS64_STDIO 1 /* POSIX timers are available. */ -#define _POSIX_TIMERS 200112L +#define _POSIX_TIMERS 200809L /* POSIX shared memory objects are implemented. */ -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L +#define _POSIX_SHARED_MEMORY_OBJECTS 200809L /* GNU libc provides regular expression handling. */ #define _POSIX_REGEXP 1 @@ -89,7 +89,7 @@ #define _POSIX_SHELL 1 /* The `spawn' function family is supported. */ -#define _POSIX_SPAWN 200112L +#define _POSIX_SPAWN 200809L /* The monotonic clock might be available. */ #define _POSIX_MONOTONIC_CLOCK 0 diff --git a/sysdeps/unix/sysv/linux/bits/stat.h b/sysdeps/unix/sysv/linux/bits/stat.h index cc665f377e..e6a5b6afbf 100644 --- a/sysdeps/unix/sysv/linux/bits/stat.h +++ b/sysdeps/unix/sysv/linux/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995-2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995-2001, 2002, 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 @@ -162,8 +162,7 @@ struct stat64 #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ -#if defined __USE_ATFILE || defined __USE_GNU -/* XXX This will change to the macro for the next 2008 POSIX revision. */ +#ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif diff --git a/sysdeps/unix/sysv/linux/fallocate.c b/sysdeps/unix/sysv/linux/fallocate.c new file mode 100644 index 0000000000..a45b0f831d --- /dev/null +++ b/sysdeps/unix/sysv/linux/fallocate.c @@ -0,0 +1,31 @@ +/* Copyright (C) 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <errno.h> +#include <fcntl.h> +#include <sysdep.h> + + +/* Reserve storage for the data of the file associated with FD. */ +int +fallocate (int fd, int mode, __off_t offset, __off_t len) +{ + return INLINE_SYSCALL (fallocate, 6, fd, mode, + __LONG_LONG_PAIR (offset >> 31, offset), + __LONG_LONG_PAIR (len >> 31, len)); +} diff --git a/sysdeps/unix/sysv/linux/fallocate64.c b/sysdeps/unix/sysv/linux/fallocate64.c new file mode 100644 index 0000000000..601a70ba1f --- /dev/null +++ b/sysdeps/unix/sysv/linux/fallocate64.c @@ -0,0 +1,33 @@ +/* Copyright (C) 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <errno.h> +#include <fcntl.h> +#include <sysdep.h> + + +/* Reserve storage for the data of the file associated with FD. */ +int +__fallocate64_l64 (int fd, int mode, __off64_t offset, __off64_t len) +{ + return INLINE_SYSCALL (fallocate, 6, fd, mode, + __LONG_LONG_PAIR ((long int) (offset >> 32), + (long int) offset), + __LONG_LONG_PAIR ((long int) (len >> 32), + (long int) len)); +} diff --git a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h index fdf0df3cd8..35ef665998 100644 --- a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h @@ -235,6 +235,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, extern ssize_t tee (int __fdin, int __fdout, size_t __len, unsigned int __flags); +/* Reserve storage for the data of the file associated with FD. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset, + __off_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + #endif __END_DECLS diff --git a/sysdeps/unix/sysv/linux/i386/fallocate.c b/sysdeps/unix/sysv/linux/i386/fallocate.c new file mode 100644 index 0000000000..7a943e44c0 --- /dev/null +++ b/sysdeps/unix/sysv/linux/i386/fallocate.c @@ -0,0 +1,32 @@ +/* Copyright (C) 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <fcntl.h> +#include <sysdep.h> + + +extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len) + attribute_hidden; + + +/* Reserve storage for the data of the file associated with FD. */ +int +fallocate (int fd, int mode, __off_t offset, __off_t len) +{ + return __call_fallocate (fd, mode, offset, len); +} diff --git a/sysdeps/unix/sysv/linux/i386/fallocate64.c b/sysdeps/unix/sysv/linux/i386/fallocate64.c new file mode 100644 index 0000000000..b744710a96 --- /dev/null +++ b/sysdeps/unix/sysv/linux/i386/fallocate64.c @@ -0,0 +1,32 @@ +/* Copyright (C) 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <fcntl.h> +#include <sysdep.h> + + +extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len) + attribute_hidden; + + +/* Reserve storage for the data of the file associated with FD. */ +int +__fallocate64_l64 (int fd, int mode, __off64_t offset, __off64_t len) +{ + return __call_fallocate (fd, mode, offset, len); +} diff --git a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h index c5d5c150d3..6abc5ced65 100644 --- a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h @@ -229,6 +229,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, extern ssize_t tee (int __fdin, int __fdout, size_t __len, unsigned int __flags); +/* Reserve storage for the data of the file associated with FD. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset, + __off_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + #endif __END_DECLS diff --git a/sysdeps/unix/sysv/linux/ia64/bits/stat.h b/sysdeps/unix/sysv/linux/ia64/bits/stat.h index 1988c492b0..75a3318286 100644 --- a/sysdeps/unix/sysv/linux/ia64/bits/stat.h +++ b/sysdeps/unix/sysv/linux/ia64/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001, 2002, 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 @@ -139,8 +139,7 @@ struct stat64 #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ -#if defined __USE_ATFILE || defined __USE_GNU -/* XXX This will change to the macro for the next 2008 POSIX revision. */ +#ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h index 556e83da20..90b669ab60 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h @@ -235,6 +235,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, extern ssize_t tee (int __fdin, int __fdout, size_t __len, unsigned int __flags); +/* Reserve storage for the data of the file associated with FD. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset, + __off_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + #endif __END_DECLS diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h index 53457ef1fa..b6c82c55bb 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -266,8 +266,7 @@ struct stat64 #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ -#if defined __USE_ATFILE || defined __USE_GNU -/* XXX This will change to the macro for the next 2008 POSIX revision. */ +#ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/power7/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/power7/fpu/Implies new file mode 100644 index 0000000000..d379a2dd12 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/power7/fpu/Implies @@ -0,0 +1,3 @@ +# Make sure this comes before the powerpc/powerpc32/fpu that's +# listed in unix/sysv/linux/powerpc/powerpc32/fpu/Implies. +powerpc/powerpc32/power5/fpu diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/power7/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/power7/fpu/Implies new file mode 100644 index 0000000000..c46b3d42af --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/power7/fpu/Implies @@ -0,0 +1,3 @@ +# Make sure this comes before the powerpc/powerpc64/fpu that's +# listed in unix/sysv/linux/powerpc/powerpc64/fpu/Implies. +powerpc/powerpc64/power5/fpu diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h index e0cc664789..ff5941df65 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h @@ -255,6 +255,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, extern ssize_t tee (int __fdin, int __fdout, size_t __len, unsigned int __flags); +/* Reserve storage for the data of the file associated with FD. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset, + __off_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + #endif __END_DECLS diff --git a/sysdeps/unix/sysv/linux/s390/bits/stat.h b/sysdeps/unix/sysv/linux/s390/bits/stat.h index 00fcf078ba..c062498556 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/stat.h +++ b/sysdeps/unix/sysv/linux/s390/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2002, 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 @@ -255,8 +255,7 @@ struct stat64 #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ -#if defined __USE_ATFILE || defined __USE_GNU -/* XXX This will change to the macro for the next 2008 POSIX revision. */ +#ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif diff --git a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h index fdf0df3cd8..35ef665998 100644 --- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h @@ -235,6 +235,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, extern ssize_t tee (int __fdin, int __fdout, size_t __len, unsigned int __flags); +/* Reserve storage for the data of the file associated with FD. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset, + __off_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + #endif __END_DECLS diff --git a/sysdeps/unix/sysv/linux/sh/sys/procfs.h b/sysdeps/unix/sysv/linux/sh/sys/procfs.h index 8651ccb346..62613078db 100644 --- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h +++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1996, 1997, 1999, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1999, 2004, 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 @@ -24,12 +25,9 @@ used on Linux. */ #include <features.h> -#include <signal.h> #include <sys/time.h> #include <sys/types.h> -#include <sys/ucontext.h> #include <sys/user.h> -#include <asm/elf.h> __BEGIN_DECLS diff --git a/sysdeps/unix/sysv/linux/sh/sys/user.h b/sysdeps/unix/sysv/linux/sh/sys/user.h index 7f31bb62dd..e238e88138 100644 --- a/sysdeps/unix/sysv/linux/sh/sys/user.h +++ b/sysdeps/unix/sysv/linux/sh/sys/user.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2000, 2003, 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 @@ -19,10 +20,49 @@ #ifndef _SYS_USER_H #define _SYS_USER_H 1 -#include <features.h> +#include <asm/ptrace.h> -#include <asm/user.h> +/* asm/ptrace.h polutes the namespace. */ +#undef PTRACE_GETREGS +#undef PTRACE_SETREGS +#undef PTRACE_GETFPREGS +#undef PTRACE_SETFPREGS +#undef PTRACE_GETFDPIC +#undef PTRACE_GETFDPIC_EXEC +#undef PTRACE_GETFDPIC_INTERP +#undef PTRACE_GETDSPREGS +#undef PTRACE_SETDSPREGS -#undef start_thread +typedef unsigned long elf_greg_t; + +#define ELF_NGREG (sizeof (struct pt_regs) / sizeof (elf_greg_t)) +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +struct user_fpu_struct + { + unsigned long fp_regs[16]; + unsigned long xfp_regs[16]; + unsigned long fpscr; + unsigned long fpul; + }; +typedef struct user_fpu_struct elf_fpregset_t; + +struct user + { + struct pt_regs regs; + struct user_fpu_struct fpu; + int u_fpvalid; + size_t u_tsize; + size_t u_dsize; + size_t u_ssize; + unsigned long start_code; + unsigned long start_data; + unsigned long start_stack; + long int signal; + unsigned long u_ar0; + struct user_fpu_struct *u_fpstate; + unsigned long magic; + char u_comm[32]; + }; #endif /* sys/user.h */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h index c5c035c620..d59744a55e 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h @@ -254,6 +254,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, extern ssize_t tee (int __fdin, int __fdout, size_t __len, unsigned int __flags); +/* Reserve storage for the data of the file associated with FD. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset, + __off_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif + #endif __END_DECLS diff --git a/sysdeps/unix/sysv/linux/sparc/bits/stat.h b/sysdeps/unix/sysv/linux/sparc/bits/stat.h index 17c912a70f..7426e16806 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/stat.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/stat.h @@ -1,5 +1,4 @@ -/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2006 - Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995-2002, 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 @@ -164,8 +163,7 @@ struct stat64 #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ -#if defined __USE_ATFILE || defined __USE_GNU -/* XXX This will change to the macro for the next 2008 POSIX revision. */ +#ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif diff --git a/sysdeps/unix/sysv/linux/sysconf.c b/sysdeps/unix/sysv/linux/sysconf.c index f4e36e0c6f..50c5528dd8 100644 --- a/sysdeps/unix/sysv/linux/sysconf.c +++ b/sysdeps/unix/sysv/linux/sysconf.c @@ -1,5 +1,5 @@ /* Get file-specific information about a file. Linux version. - Copyright (C) 2003, 2004, 2006, 2008 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2006, 2008, 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 @@ -43,6 +43,7 @@ __sysconf (int name) switch (name) { + struct rlimit rlimit; #ifdef __NR_clock_getres case _SC_MONOTONIC_CLOCK: /* Check using the clock_getres system call. */ @@ -84,12 +85,9 @@ __sysconf (int name) size. */ if (GLRO(dl_discover_osversion) () >= 0x020617) #endif - { - /* Use getrlimit to get the stack limit. */ - struct rlimit rlimit; - if (__getrlimit (RLIMIT_STACK, &rlimit) == 0) - return MAX (legacy_ARG_MAX, rlimit.rlim_cur / 4); - } + /* Use getrlimit to get the stack limit. */ + if (__getrlimit (RLIMIT_STACK, &rlimit) == 0) + return MAX (legacy_ARG_MAX, rlimit.rlim_cur / 4); return legacy_ARG_MAX; @@ -100,6 +98,9 @@ __sysconf (int name) break; case _SC_SIGQUEUE_MAX: + if (__getrlimit (RLIMIT_SIGPENDING, &rlimit) == 0) + return rlimit.rlim_cur; + /* The /proc/sys/kernel/rtsig-max file contains the answer. */ procfname = "/proc/sys/kernel/rtsig-max"; break; diff --git a/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c b/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c new file mode 100644 index 0000000000..0eabab9781 --- /dev/null +++ b/sysdeps/unix/sysv/linux/wordsize-64/fallocate.c @@ -0,0 +1,30 @@ +/* Copyright (C) 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <errno.h> +#include <fcntl.h> +#include <sysdep.h> + + +/* Reserve storage for the data of the file associated with FD. */ +int +fallocate (int fd, int mode, __off_t offset, __off_t len) +{ + return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len); +} +strong_alias (fallocate, fallocate64) diff --git a/sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c b/sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c new file mode 100644 index 0000000000..df33112d6b --- /dev/null +++ b/sysdeps/unix/sysv/linux/wordsize-64/fallocate64.c @@ -0,0 +1 @@ +/* fallocate64 is in posix_fallocate.c */ diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h index cf96ac7599..bc0f4d687b 100644 --- a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h @@ -249,6 +249,22 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, extern ssize_t tee (int __fdin, int __fdout, size_t __len, unsigned int __flags); +/* Reserve storage for the data of the file associated with FD. */ +# ifndef __USE_FILE_OFFSET64 +extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); +# else +# ifdef __REDIRECT +extern int __REDIRECT (fallocate, (int __fd, int __mode, __off_t __offset, + __off_t __len), + fallocate64); +# else +# define fallocate fallocate64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int fallocate64 (int __fd, int __mode, __off64_t __offset, + __off64_t __len); +# endif #endif __END_DECLS diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h index 286c1a2a02..51367b2fc1 100644 --- a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h +++ b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999,2000,2001,2002,2003 Free Software Foundation, Inc. +/* Copyright (C) 1999,2000,2001,2002,2003,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 @@ -202,8 +202,7 @@ struct stat64 #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ -#if defined __USE_ATFILE || defined __USE_GNU -/* XXX This will change to the macro for the next 2008 POSIX revision. */ +#ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif |