summaryrefslogtreecommitdiff
path: root/sysdeps/posix
AgeCommit message (Collapse)Author
2014-08-21Remove unnecessary uses of NOT_IN_libcSiddhesh Poyarekar
If a IS_IN_* macro is defined, then NOT_IN_libc is always defined, except obviously for IS_IN_libc. There's no need to check for both. Verified on x86_64 and i686 that the source is unchanged. * include/libc-symbols.h: Remove unnecessary check for NOT_IN_libc. * nptl/pthreadP.h: Likewise. * sysdeps/aarch64/setjmp.S: Likewise. * sysdeps/alpha/setjmp.S: Likewise. * sysdeps/arm/sysdep.h: Likewise. * sysdeps/i386/setjmp.S: Likewise. * sysdeps/m68k/setjmp.c: Likewise. * sysdeps/posix/getcwd.c: Likewise. * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise. * sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise. * sysdeps/s390/s390-32/setjmp.S: Likewise. * sysdeps/s390/s390-64/setjmp.S: Likewise. * sysdeps/sh/sh3/setjmp.S: Likewise. * sysdeps/sh/sh4/setjmp.S: Likewise. * sysdeps/unix/alpha/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/ia64/setjmp.S: Likewise. * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise. * sysdeps/x86_64/setjmp.S: Likewise.
2014-07-02Fix typo in macro nameSiddhesh Poyarekar
It is _POSIX_SIGNALS and not _POSUX_SIGNALS
2014-06-25sysdeps/posix/tempname.c: Merge from gnulibWill Newton
Partial merge from gnulib which fixes a number of -Wundef warnings. The parts that differ from gnulib are the header comment, use of __glibc_unlikely, a #define of __secure_getenv and the use of tabs. The majority of the patch is cosmetic comment changes, the only runtime change is an abort if an unknown kind is passed to __gen_tempname. ChangeLog: 2014-06-25 Will Newton <will.newton@linaro.org> * sysdeps/posix/tempname.c: Merge from gnulib, cosmetic comment changes throughout the file. Remove checks for HAVE_*_H definitions that are not required. (__gen_tempname): Call abort if an unknown kind value is passed.
2014-05-15Return EAI_AGAIN for AF_UNSPEC when herrno is TRY_AGAIN (BZ #16849)Siddhesh Poyarekar
getaddrinfo correctly returns EAI_AGAIN for AF_INET and AF_INET6 queries. For AF_UNSPEC however, an older change (a682a1bf553b1efe4dbb03207fece5b719cec482) broke the check and due to that the returned error was EAI_NONAME. This patch fixes the check so that a non-authoritative not-found is returned as EAI_AGAIN to the user instead of EAI_NONAME.
2014-05-07Fix parsing of getai result from nscd for IPv6-only requestAndreas Schwab
2014-04-09Use statvfs64() for pathconf(_PC_NAME_MAX).Peter TB Brett
pathconf(_PC_NAME_MAX) was implemented on top of statfs(). The 32bit version therefore fails EOVERFLOW if the filesystem blockcount is sufficiently large. Most pathconf() queries use statvfs64(), which avoids this issue. This patch modifies pathconf(_PC_NAME_MAX) to do likewise.
2014-03-24Fix use of half-initialized result in getaddrinfo when using nscd (bug 16743)Andreas Schwab
This fixes a bug in the way the results from __nscd_getai are collected: for every returned result a new entry is first added to the gaih_addrtuple list, but if that result doesn't match the request this entry remains uninitialized. So for this non-matching result an extra result with uninitialized content is returned. To reproduce (with nscd running): $ getent ahostsv4 localhost 127.0.0.1 STREAM localhost 127.0.0.1 DGRAM 127.0.0.1 RAW (null) STREAM (null) DGRAM (null) RAW
2014-02-10Use glibc_likely instead __builtin_expect.Ondřej Bílka
2014-01-15Do not enable asynchronous cancellation in system. Fixes bug 14782.Ondřej Bílka
We needlessly enabled thread cancellation before it was necessary. As only call that needs to be guarded is waitpid which is cancellation point we could remove cancellation altogether.
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae
2013-12-02Remove redundant GAIH_OKIFUNSPEC and GAIH_EAI.Pavel Simerda
Only gaih_inet() and gaih_inet_serv() use a special bit flag denoted by the GAIH_OKIFUNSPEC macro. Only the return value of gaih_inet_serv() is actively checked for the bit flag which is redundant because it just copies the nonzero property of the value otherwise returned. The return value of gaih_inet() is only checked for being zero and then the bit flag is filtered out. As the bit flag is set only for otherwise nonzero return values, it doesn't affect the zero comparison. GAIH_EAI just an alias to ~GAIH_OKIFUNSPEC.
2013-12-02getaddrinfo: remove dead codePavel Simerda
2013-10-25Fix stack overflow due to large AF_INET6 requestsSiddhesh Poyarekar
Resolves #16072 (CVE-2013-4458). This patch fixes another stack overflow in getaddrinfo when it is called with AF_INET6. The AF_UNSPEC case was fixed as CVE-2013-1914, but the AF_INET6 case went undetected back then.
2013-10-25Fix incorrect getaddrinfo assertion triggerAllan McRae
[BZ #9954] With the following /etc/hosts: 127.0.0.1 www.my-domain.es 127.0.1.1 www.my-domain.es 192.168.0.1 www.my-domain.es Using getaddrinfo() on www.my-domain.es, trigger the following assertion: ../sysdeps/posix/getaddrinfo.c:1473: rfc3484_sort: Assertion `src->results[i].native == -1 || src->results[i].native == a1_native' failed. This is due to two different bugs: - In rfc3484_sort() rule 7, src->results[i].native is assigned even if src->results[i].index is -1, meaning that no interface is associated. - In getaddrinfo() the source IP address used with the lo interface needs a special case, as it can be any IP within 127.X.Y.Z.
2013-10-17Don't use gethostbyaddr to determine canonical nameAndreas Schwab
2013-10-10Fix readdir regressions on sparc 32-bit.David S. Miller
* sysdeps/posix/dirstream.h (struct __dirstream): Fix alignment of directory block.
2013-09-30Properly cache the result from looking up the nss database configAndreas Schwab
2013-08-28Use __glibc_unlikely instead of __builtin_expect (..., 0)Siddhesh Poyarekar
2013-08-16CVE-2013-4237, BZ #14699: Buffer overflow in readdir_rFlorian Weimer
* sysdeps/posix/dirstream.h (struct __dirstream): Add errcode member. * sysdeps/posix/opendir.c (__alloc_dir): Initialize errcode member. * sysdeps/posix/rewinddir.c (rewinddir): Reset errcode member. * sysdeps/posix/readdir_r.c (__READDIR_R): Enforce NAME_MAX limit. Return delayed error code. Remove GETDENTS_64BIT_ALIGNED conditional. * sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Do not define GETDENTS_64BIT_ALIGNED. * sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise. * manual/filesys.texi (Reading/Closing Directory): Document ENAMETOOLONG return value of readdir_r. Recommend readdir more strongly. * manual/conf.texi (Limits for Files): Add portability note to NAME_MAX, PATH_MAX. (Pathconf): Add portability note for _PC_NAME_MAX, _PC_PATH_MAX.
2013-06-11Fix symbol definitions for __clock_* functionsSiddhesh Poyarekar
__clock_gettime and other __clock_* functions could result in an extra PLT reference within libc.so if it actually gets used. None of the code currently uses them, which is why this probably went unnoticed.
2013-06-08Use (void) in no-arguments function definitions.Joseph Myers
2013-05-21Set EAI_SYSTEM only when h_errno is NETDB_INTERNALSiddhesh Poyarekar
Fixes BZ #15339. NSS_STATUS_UNAVAIL may mean that a necessary input resource is not available. This could occur in a number of cases including when the network is down, system runs out of file descriptors, etc. The correct differentiator in such a case is the h_errno, which gives the nature of failure. In case of failures other than a simple 'not found', we set h_errno as NETDB_INTERNAL and let errno be the identifier for the exact error.
2013-05-16Add #include <stdint.h> for uint[32|64]_t usage (except installed headers).Ryan S. Arnold
2013-05-06Clean up POSIX.1 implementation of truncate.Roland McGrath
2013-05-01Add missing #include in sysdeps/posix/opendir.c.Roland McGrath
2013-04-23Fix name space use in last commit.Roland McGrath
2013-04-23Add generic POSIX implementation of C11 timespec_get.Roland McGrath
2013-04-22Minor cleanup in getaddrinfoSiddhesh Poyarekar
Replace repeated computations of alloca size with a local variable that stores the computed value.
2013-04-03Fix stack overflow in getaddrinfo with many resultsAndreas Schwab
2013-03-28Never call syslog in __libc_message.Roland McGrath
2013-03-19Consolidate Linux and POSIX libc_fatal code.Roland McGrath
2013-02-14Remove bp-sym.h and BP_SYM uses from C code.Joseph Myers
2013-01-23ulimit: include <limits.h>Pino Toscano
2013-01-23ulimit: move linux implementation as posixPino Toscano
The linux implementation of ulimit works correctly and has nothing specific to Linux, so move it as general posix implementation.
2013-01-02Fix copyright notice corruption from update-copyright bug.Joseph Myers
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers
2013-01-01Add script to update copyright notices and reformat some to facilitate its use.Joseph Myers
2012-11-19Return EAI_SYSTEM if we're out of file descriptorsSiddhesh Poyarekar
Resolves BZ #14719.
2012-11-17Generate /usr/libexec/getconf files when cross-compiling.Joseph Myers
2012-10-30Suppress incorrect link warnings for NSS symbolsChris Metcalf
When glibc is built with --enable-static-nss, the warning that using NSS symbols requires the nss shared objects to be present is no longer true, as those symbols are built into libc. Suppress the warning for those symbols by providing a new macro (nss_interface_function) for the NSS functions that is defined as static_link_warning in the normal case, and empty for static NSS.
2012-10-24BZ#14743: Move clock_* symbols from librt to libc.Roland McGrath
2012-10-16__alloc_dir: avoid integer overflow in malloc argumentFlorian Weimer
2012-10-03sysconf/posix: handle _SC_LEVEL4_CACHE_LINESIZEPino Toscano
2012-09-28Implement POSIX-generic sleep via nanosleep rather than SIGARLM.Roland McGrath
2012-09-28 [BZ #11438]Jeff Law
* sysdeps/posix/getaddrinfo.c (default_scopes): Map RFC 1918 * addresses to global scope. * posix/tst-rfc3484.c: Verify 10/8, 172.16/12 and 196.128/16 addresses are in the same scope as 192.0.2/24. * posix/gai.conf: Document new scope table defaults.
2012-08-22 * sysdeps/posix/getaddrinfo.c (gaih_inet): Only use gethostbyname4_rJeff Law
if the family is PF_UNSPEC.
2012-08-17Move some things from sysdeps/unix to sysdeps/posix.Roland McGrath
2012-08-17Fix typo in last change.Roland McGrath
2012-08-17Fix getaddrinfo for [!_STATBUF_ST_NSEC] case.Roland McGrath
2012-08-15Add casts to suppress warnings in system.c under [!_LIBC_REENTRANT].Roland McGrath