diff options
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/auxv.h | 34 | ||||
-rw-r--r-- | include/sys/cdefs.h | 11 | ||||
-rw-r--r-- | include/sys/personality.h | 18 | ||||
-rw-r--r-- | include/sys/resource.h | 23 | ||||
-rw-r--r-- | include/sys/socket.h | 2 | ||||
-rw-r--r-- | include/sys/stat.h | 18 |
6 files changed, 95 insertions, 11 deletions
diff --git a/include/sys/auxv.h b/include/sys/auxv.h new file mode 100644 index 000000000..b07026457 --- /dev/null +++ b/include/sys/auxv.h @@ -0,0 +1,34 @@ +/* Copyright (C) 2022 uClibc-ng + This file is part of the uClibc-ng 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, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_AUXV_H +#define _SYS_AUXV_H 1 + +#include <features.h> +#include <elf.h> +#include <bits/hwcap.h> + +__BEGIN_DECLS + +/* Return the value associated with an Elf*_auxv_t type from the auxv list + passed to the program on startup. If TYPE was not present in the auxv + list, returns zero and sets errno to ENOENT. */ +extern unsigned long int getauxval (unsigned long int __type) __THROW; + +__END_DECLS + +#endif /* sys/auxv.h */ diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index a4359a05c..5c4daebcd 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -330,6 +330,17 @@ # endif #endif +/* Undefine (also defined in libc-symbols.h). */ +#undef __attribute_copy__ +#if __GNUC_PREREQ (9, 0) +/* Copies attributes from the declaration or type referenced by + the argument. */ +# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg))) +#else +# define __attribute_copy__(arg) +#endif + + /* GCC 4.3 and above allow passing all anonymous arguments of an __extern_always_inline function to some other vararg function. */ #if __GNUC_PREREQ (4,3) diff --git a/include/sys/personality.h b/include/sys/personality.h index ee1de6403..fd77bdbd9 100644 --- a/include/sys/personality.h +++ b/include/sys/personality.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002-2021 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,9 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ -/* Taken verbatim from Linux 2.4 (include/linux/personality.h). */ +/* Taken verbatim from Linux 2.6 (include/linux/personality.h). */ #ifndef _SYS_PERSONALITY_H #define _SYS_PERSONALITY_H 1 @@ -26,11 +26,17 @@ These occupy the top three bytes. */ enum { + UNAME26 = 0x0020000, + ADDR_NO_RANDOMIZE = 0x0040000, + FDPIC_FUNCPTRS = 0x0080000, MMAP_PAGE_ZERO = 0x0100000, + ADDR_COMPAT_LAYOUT = 0x0200000, + READ_IMPLIES_EXEC = 0x0400000, ADDR_LIMIT_32BIT = 0x0800000, SHORT_INODE = 0x1000000, WHOLE_SECONDS = 0x2000000, STICKY_TIMEOUTS = 0x4000000, + ADDR_LIMIT_3GB = 0x8000000 }; /* Personality types. @@ -41,6 +47,7 @@ enum { PER_LINUX = 0x0000, PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT, + PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS, PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE, PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE, @@ -51,14 +58,15 @@ enum PER_SUNOS = 0x0006 | STICKY_TIMEOUTS, PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE, PER_LINUX32 = 0x0008, + PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB, PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS, /* IRIX5 32-bit */ PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS, /* IRIX6 new 32-bit */ PER_IRIX64 = 0x000b | STICKY_TIMEOUTS, /* IRIX6 64-bit */ PER_RISCOS = 0x000c, PER_SOLARIS = 0x000d | STICKY_TIMEOUTS, PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, - PER_HPUX = 0x000f, - PER_OSF4 = 0x0010, + PER_OSF4 = 0x000f, + PER_HPUX = 0x0010, PER_MASK = 0x00ff, }; diff --git a/include/sys/resource.h b/include/sys/resource.h index 17167ed99..a5c69d84e 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -101,6 +101,29 @@ extern int setpriority (__priority_which_t __which, id_t __who, int __prio) __THROW; libc_hidden_proto(setpriority) +#ifdef __USE_GNU +/* Modify and return resource limits of a process atomically. */ +# ifndef __USE_FILE_OFFSET64 +extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, + const struct rlimit *__new_limit, + struct rlimit *__old_limit) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (prlimit, (__pid_t __pid, + enum __rlimit_resource __resource, + const struct rlimit *__new_limit, + struct rlimit *__old_limit), prlimit64); +# else +# define prlimit prlimit64 +# endif +# endif +# ifdef __USE_LARGEFILE64 +extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, + const struct rlimit64 *__new_limit, + struct rlimit64 *__old_limit) __THROW; +# endif +#endif + __END_DECLS #endif /* sys/resource.h */ diff --git a/include/sys/socket.h b/include/sys/socket.h index 83e1fcaa2..c8df3057f 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -281,7 +281,7 @@ libc_hidden_proto(accept4) extern int shutdown (int __fd, int __how) __THROW; -#if 0 /*def __USE_XOPEN2K*/ +#ifdef __USE_XOPEN2K /* Determine wheter socket is at a out-of-band mark. */ extern int sockatmark (int __fd) __THROW; #endif diff --git a/include/sys/stat.h b/include/sys/stat.h index 079e77903..2dca6c552 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -117,7 +117,8 @@ __BEGIN_DECLS # ifdef __S_IFLNK # define S_IFLNK __S_IFLNK # endif -# if (defined __USE_BSD || defined __USE_MISC || defined __USE_UNIX98) \ +# if (defined __USE_BSD || defined __USE_MISC || defined __USE_UNIX98 \ + || defined __USE_XOPEN2K) \ && defined __S_IFSOCK # define S_IFSOCK __S_IFSOCK # endif @@ -142,7 +143,7 @@ __BEGIN_DECLS # define S_ISLNK(mode) 0 #endif -#if (defined __USE_BSD || defined __USE_UNIX98) \ +#if (defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K) \ && defined __S_IFSOCK # define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK) #endif @@ -301,7 +302,7 @@ extern int lchmod (const char *__file, __mode_t __mode) #endif /* Set file access permissions of the file FD is open on to MODE. */ -#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED +#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K extern int fchmod (int __fd, __mode_t __mode) __THROW; #endif @@ -370,7 +371,7 @@ extern int mkfifo (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. */ @@ -385,7 +386,7 @@ libc_hidden_proto(utimensat) /* 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 @@ -393,6 +394,13 @@ extern int futimens (int __fd, const struct timespec __times[2]) __THROW; #undef _MKNOD_VER #define _MKNOD_VER 0 +#ifdef __UCLIBC_HAVE_STATX__ +#ifdef __USE_GNU +# include <bits/statx.h> +#endif +#endif + + __END_DECLS |