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/resource.h | 23 | ||||
-rw-r--r-- | include/sys/stat.h | 11 |
4 files changed, 74 insertions, 5 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/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/stat.h b/include/sys/stat.h index b6480bf97..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 |