summaryrefslogtreecommitdiffstats
path: root/libc/unistd
Commit message (Collapse)AuthorAgeFilesLines
* Switch to current upstream getopt_long.Elliott Hughes2013-06-251-537/+0
| | | | Change-Id: I4c646dcb8be9e88dd54d069a03bbc5fbfd92de03
* Clean up abort.Elliott Hughes2013-06-121-92/+0
| | | | | | | | | | | | | | | | | | * A dlmalloc usage error shouldn't call abort(3) because we want to cause a SIGSEGV by writing the address dlmalloc didn't like to an address the kernel won't like, so that debuggerd will dump the memory around the address that upset dlmalloc. * Switch to the simpler FreeBSD/NetBSD style of registering stdio cleanup. Hopefully this will let us simplify more of the stdio implementation. * Clear the stdio cleanup handler before we abort because of a dlmalloc corruption error. This fixes the reported bug, where we'd hang inside dlmalloc because the stdio cleanup reentered dlmalloc. Bug: 9301265 Change-Id: Ief31b389455d6876e5a68f0f5429567d37277dbc
* Fix abort(3) to raise SIGABRT rather than causing SIGSEGV.Ben Cheng2013-06-101-15/+3
| | | | | | | | | tgkill() needs the .save stack unwinding directive to get the complete stack trace. BUG: https://code.google.com/p/android/issues/detail?id=16672 Change-Id: Ifb447dca2147a592c48baf32769dfc175d8aea72
* Upgrade to current NetBSD popen/pclose.Elliott Hughes2013-03-061-164/+0
| | | | | | | | This gets us back to using vfork now our ARM vfork assembler stub is fixed, and adds the missing thread safety for the 'pidlist'. Bug: 5335385 Change-Id: Ib08bfa65b2cb9fa695717aae629ea14816bf988d
* __progname should be const char*, not char*.Elliott Hughes2013-02-071-1/+1
| | | | Change-Id: I8e846872c30a712fbc05c8da59ffa1cec1be31a4
* More upstream NetBSD upgrades.Elliott Hughes2012-10-231-45/+0
| | | | Change-Id: Idb781d37de3b05585271d7d258ecffd5ba87d0b8
* Move non-upstream code into the libc/bionic directory.Elliott Hughes2012-10-0156-3436/+0
| | | | | | | I'll need at least one more pass, because there's some upstream code lurking in libc/bionic, but this is still a step in the right direction. Change-Id: I55927315972da8327ae01c5240ed587db17e8462
* Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and ↵Irina Tirdea2012-09-131-38/+0
| | | | | | psiginfo(3). Change-Id: I426109db25e907980d6cb3a7a695796e45783b78
* Enhance getcwd(3) to handle NULL like glibc.Elliott Hughes2012-08-161-40/+0
| | | | | Bug: http://code.google.com/p/android/issues/detail?id=36085 Change-Id: I960a1b585887eb66176c61d29c5c61c239a4003f
* Switch to the current NetBSD regex implementation.Elliott Hughes2012-08-151-34/+0
| | | | Change-Id: If32b28dd85d6a7ab8957ab81d19fa4c0de9499d5
* Fix nice...Elliott Hughes2012-08-131-35/+0
| | | | | | ...by switching to the NetBSD implementation. Change-Id: I562b27b237a24ded95804035cc322c7bff12ff59
* MIPS support to sigsuspend and sigwait routinesRaghu Gandham2012-08-092-4/+19
| | | | Change-Id: I870e798ed7eac5a8c74e5784a670f3a4f24331a9
* Auto-generate a complete NOTICE file.Elliott Hughes2012-08-091-0/+28
| | | | | | | Remove the hand-collated ones, and switch to a script that pulls the copyright headers out of every file and collects the unique ones. Change-Id: Ied3b98b3f56241df97166c410ff81de4e0157c9d
* Report errors to the log, not just stderr.Elliott Hughes2012-07-271-6/+1
| | | | | | | | | | In particular this affects assert(3) and __cxa_pure_virtual, both of which have managed to confuse people this week by apparently aborting without reason. (Because stderr goes nowhere, normally.) Bug: 6852995 Bug: 6840813 Change-Id: I7f5d17d5ddda439e217b7932096702dc013b9142
* [MIPS] Use an aligned address to provoke SIGSEGV in abort()Chris Dearman2012-07-241-0/+5
| | | | Change-Id: I269c9ccc07058773fb0f9d70673673157ab38f6a
* FORTIFY_SOURCE: Add openat, fix bugNick Kralevich2012-07-091-0/+15
| | | | | | | | | | | Add fortify_source support for openat(). This change requires that an argument be supplied when using O_CREAT. Fix unnecessary call to __open_2. If, at compile time, we know that "flags" is constant and DOESN'T contain O_CREAT, the call to __open_2 is useless. Change-Id: Ifcd29c4fb25e25656961d7552d672e161f0cfdbd
* FORTIFY_SOURCE: add open() checksNick Kralevich2012-06-261-0/+14
| | | | | | | | Add a FORTIFY_SOURCE check which requires that you pass a "mode" argument when calling open(..., O_CREAT). If a mode isn't passed, then the file is created with "undefined" permissions. Change-Id: I4427be4f9ce170c69da01af5b00fb05b03613a28
* am 2b89f1e3: Merge "Fix sysconf(_SC_NPROCESSORS_CONF) on ARM."Elliott Hughes2012-06-061-180/+87
|\ | | | | | | | | * commit '2b89f1e37df838e466d382fc602728930bad4c68': Fix sysconf(_SC_NPROCESSORS_CONF) on ARM.
| * Fix sysconf(_SC_NPROCESSORS_CONF) on ARM.Elliott Hughes2012-06-061-180/+87
| | | | | | | | | | Bug: http://code.google.com/p/enh/issues/detail?id=33 Change-Id: I679b4cd888d362031042284e8edf01c5273a92aa
| * Implement the "abort" stub in assembly for ARM.Ben Cheng2012-05-081-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that we can always get the full stack trace regardless of gcc's handling of the "noreturn" attribute associated with abort(). (Cherry pick of Id264a5167e7cabbf11515fbc48f5469c527e34d4.) Bug: 6455193 Conflicts: libc/Android.mk Change-Id: I568fc5303fd1d747075ca933355f914122f94dac
* | Implement the "abort" stub in assembly for ARM.Ben Cheng2012-05-081-26/+0
| | | | | | | | | | | | | | | | | | | | So that we can always get the full stack trace regardless of gcc's handling of the "noreturn" attribute associated with abort(). [cherry-picked from master] BUG:6455193 Change-Id: I0102355f5bf20e636d3feab9d1424495f38e39e2
* | am ff219e57: am 6435d27f: Merge "bionic: fix NULL parameter failure in getcwd()"Elliott Hughes2012-04-161-0/+5
|\ \ | |/ | | | | | | * commit 'ff219e57c0ffe5ac2816f79677ce4f1afa677277': bionic: fix NULL parameter failure in getcwd()
| * bionic: fix NULL parameter failure in getcwd()Jack Ren2012-04-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | LTP: getcwd01 failed in LTP Need to check getcwd parameters, otherwise it will lead to posix test case to fail. Change-Id: Ieb673b6dd4ca6481da81c5339dbf7ec0a463f263 Signed-off-by: Jin Wei <wei.a.jin@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
* | Merge "bionic: pass MADV_MERGEABLE on private & anonymous mmaps"Iliyan Malchev2012-03-211-6/+13
|\ \
| * | bionic: pass MADV_MERGEABLE on private & anonymous mmapsJP Abgrall2012-03-211-6/+13
| |/ | | | | | | | | Change-Id: I8bc167bb33dec6417fe772172697ea6ff97da2f6 Signed-off-by: Iliyan Malchev <malchev@google.com>
* | fnmatch.c: Update to version in OpenBSD HEADNick Kralevich2012-03-212-182/+486
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upgrade fnmatch.c from OpenBSD version 1.13 to 1.16. This is needed primarily to address CVE-2011-0419. This is a straight copy from upstream's version at http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/gen/fnmatch.c and incorporates the following changes: Revision 1.16: New fnmatch(3) implementation which is not recursive. Written and provided under BSD licence by William A. Rowe Jr. Originally released in Apache APR-1.4.5. Merged class matching code from r1.14 and PATH_MAX check from r1.15. ok miod millert Revision 1.15: Put a limit on recursion during matching, and reject input of size greater or equal PATH_MAX. Based on similar fix made in NetBSD. ok miod@ millert@ Revision 1.14: POSIX character class support for fnmatch(3) and glob(3). OK deraadt@ Version 1.14 introduced charclasses.h, which we copy unmodified from upstream version 1.1. http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/gen/charclass.h Bug: 3435120 Change-Id: I45133468f0c3d439fd10eb087a1c647799f9d25b
* execvp: bcopy() is deprecated. Use memcpy() insteadJim Huang2012-01-141-3/+3
| | | | | | | The function bcopy() is marked as LEGACY in POSIX.1-2001 and removed in POSIX.1-2008. memcpy (POSIX.1-2001) is its recommended replacement. Change-Id: I2cc0cc4673d1368255afd11132ddbfd3f87b530b
* readdir: fix interface to kernel getdents64 functionBruce Beare2011-12-191-4/+10
| | | | | | | | | | | | | | | | | Issue: The kernel will pad the entry->d_reclen in a getdents64 call to a long-word boundary. For very long records, this could exceed the size of a struct dirent. The mismatch in the size was causing error paranoid checking code in bionic to fail... thus causing an early "end" when reading the dirent structures from the kernel buffer. Test: ls mkdir abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu ls Change-Id: I75d1f8e45e1655fdd7bac4a08a481d086f28073a Author: Bruce Beare <bruce.j.beare@intel.com>
* pathconf: dead loop in bionic function __2_symlinksBruce Beare2011-12-071-14/+11
| | | | | | | | Fix dead loops in file ./bionic/libc/unistd/pathconf.c Change-Id: I7a1e6bcd9879c96bacfd376b88a1f899793295c8 Author: Jin Wei <wei.a.jin@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
* libc: popen: work around data corruptionJP Abgrall2011-09-171-14/+11
| | | | | | | | | | | | | | | | | | | | vfork() would not save the registers that the parent would expect to have restored after execl() completed. Specially that execl() would call execve() underneath, further messing up the stack of the parent. To avoid that, we fork() for now. Later we will revisit and cleanup vfork()+execve() to actually have vfork() store all the register that the parent expects to see, and not those left by execve(). In the original code, looking at the registers just before the call to popen(), and after the call showed that r7 would get clobbered. This would leave the caller with an invalid pointer, leading to all kinds of data corruptions. execve() is simpler that execl() in this case. Bug: 5336252 Change-Id: I3bf718c0bb4c0439f6f2753f153cdea14175be9c
* am f2ebd304: am 57aadbb0: Merge "enable support for large files (> 2G)"David Turner2011-07-132-4/+0
|\ | | | | | | | | * commit 'f2ebd304c3c0822121e6a4d0f542a048a7fc3b20': enable support for large files (> 2G)
| * am 57aadbb0: Merge "enable support for large files (> 2G)"David Turner2011-07-112-4/+0
| |\ | | | | | | | | | | | | * commit '57aadbb096a118dd33f9f16c67bd18dbb6b92c4a': enable support for large files (> 2G)
| | * enable support for large files (> 2G)Dragos Tatulea2011-07-052-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bionic has an i386 ifdef guard for the O_LARGEFILE flag. The reason for this is not traceable in the git history, but it's most likely due to some old toolchain or emulator problem. Bug Id: 10035 Change-Id: I742ee6e50220276c2cb268d66f89b5655ef689fc Signed-off-by: Dragos Tatulea <dragos.tatulea@intel.com>
* | | am c643a4d4: am 2be3f09f: Merge "time: Improve C99 compliance"David Turner2011-06-241-4/+7
|\ \ \ | |/ / | | | | | | | | | * commit 'c643a4d4c71c2caaf016ab402fba99c1c9377567': time: Improve C99 compliance
| * | am 2be3f09f: Merge "time: Improve C99 compliance"David Turner2011-06-231-4/+7
| |\ \ | | |/ | | | | | | | | | * commit '2be3f09f2d9b6d35b262f7a6148f51c164bb8cbb': time: Improve C99 compliance
| | * time: Improve C99 complianceJim Huang2011-06-221-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Quote from Linux Programmer's Manual: "If t is non-NULL, the return value is also stored in the memory pointed to by t." Change-Id: I8cb66b67e5f34c536ce2f0db76a6dc337c42ea3f Signed-off-by: Jim Huang <jserv@0xlab.org>
* | | Add some missing includes.Carl Shapiro2011-03-211-0/+1
|/ / | | | | | | Change-Id: Ieec623c06bc32ec78334f628af25b00c2bccd2e7
* | am c59b2482: am 5a6f593b: Merge "Use sigemptyset to initialise sigset_t ↵Brad Fitzpatrick2011-03-162-0/+2
|\ \ | |/ | | | | | | | | | | values. sigset_t may not be implemented as an integral type." * commit 'c59b248241b18492d20e112230a907c14400275b': Use sigemptyset to initialise sigset_t values. sigset_t may not be implemented as an integral type.
| * Use sigemptyset to initialise sigset_t values.Chris Dearman2011-03-142-0/+2
| | | | | | | | | | | | | | sigset_t may not be implemented as an integral type. Change-Id: I3f5ec86d6383685979d8d23ef508b6c609569b38 Signed-off-by: Raghu Gandham <raghu@mips.com>
* | am 84f4753d: am 56faf66f: raise: Send signal to current threadColin Cross2011-01-211-1/+1
|\ \ | |/ | | | | | | * commit '84f4753d1b5f89ace0cc89021916f6f5b44e6540': raise: Send signal to current thread
| * raise: Send signal to current threadColin Cross2011-01-211-1/+1
| | | | | | | | Change-Id: Ie4318b8ddd01cc2f58f5e07c1d71376953943153
* | Bug 3330205, 3362385 clock(3) SMP safety and epochGlenn Kasten2011-01-191-13/+21
|/ | | | Change-Id: Ida1e4400489c8c19818c6af5640ab89942c8f712
* libc: Add ftruncate64 and improve 64-bit parameter syscall handling.David 'Digit' Turner2010-12-164-80/+2
| | | | | | | | | | | | | | | This patch improves the handling of 64-bit parameters in syscalls on ARM. The ARM EABI mandates that 64-bit quantities be passed in even/odd register pairs, which requires special treatment. This allows us to simplify our implementations of pread() and pwrite() and remove the C stubs for pread64() and pwrite64(). Also add ftruncate64() to <unistd.h> Change-Id: I407e2fd223ba0093dd2d0b04c6152fadfc9ce3ef Bug 3107933
* sigsetmask.c was not processing the "mask" argument.Bruce Beare2010-12-091-0/+2
| | | | | | Change-Id: I79b898ea5b882e8c0564e25466e827a9bedda6e8 Author: yhe19 <yunan.he@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
* Revert "sigsetmask.c was not processing the "mask" argument."Yu Shan Emily Lau2010-12-091-2/+0
| | | | This reverts commit 9a9c1619b8124f07fc772c0b700e4d411cd78525.
* am b11d7c3e: am bcb0a925: Merge "sigsetmask.c was not processing the "mask" ↵Jean-Baptiste Queru2010-12-061-0/+2
|\ | | | | | | | | | | | | argument." * commit 'b11d7c3eca0e5bc04c14afe82a530429f173706c': sigsetmask.c was not processing the "mask" argument.
| * am bcb0a925: Merge "sigsetmask.c was not processing the "mask" argument."Jean-Baptiste Queru2010-12-061-0/+2
| |\ | | | | | | | | | | | | * commit 'bcb0a925b0d6d545bbd9a4ebd9ac61bdacbfa2fe': sigsetmask.c was not processing the "mask" argument.
| | * sigsetmask.c was not processing the "mask" argument.Bruce Beare2010-12-031-0/+2
| | | | | | | | | | | | | | | | | | Change-Id: I79b898ea5b882e8c0564e25466e827a9bedda6e8 Author: yhe19 <yunan.he@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
* | | Add support for pread64/pwrite64Kenny Root2010-11-243-10/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 64-bit pread() and pwrite() is needed for ZipFileRO to be able to read ludicrously large ZIP files just in case someone is crazy enough to do it. Also fix a license header that was apparently mangled. Change-Id: I6819ef8b36e46b63b40749c95717b1ecf9307033
* | | am ff7d9453: am f67e5211: Merge "Hide the symbol of helper function ↵Jean-Baptiste Queru2010-10-121-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | __libc_android_abort" Merge commit 'ff7d94530db60cf4fe4a4c287ee8821ebdf6263a' * commit 'ff7d94530db60cf4fe4a4c287ee8821ebdf6263a': Hide the symbol of helper function __libc_android_abort