summaryrefslogtreecommitdiff
path: root/libc/unistd
AgeCommit message (Collapse)Author
2014-12-12unistd: allow to turn off getopt_longBernhard Reutner-Fischer
The GNU variant of getopt() previously had no way to turn off getopt_long() support.
2013-02-18libc: add non standard execvpe functionHenning Heinold
Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-02-07buildsys: Fix kbuild-style switch falloutMarkos Chandras
regressions introduced in 1b3025b7352f5e432ffa1c7adc57085ac9092b77 "buildsys: switch libc to kbuild-style" unistd: Handle !UCLIBC_HAS_GET{, SUB}OPT cases libc/libc_so.a(getsubopt-susv3.os): In function getsubopt': getsubopt-susv3.c:(.text+0x0): multiple definition of getsubopt' libc/libc_so.a(getsubopt.os):getsubopt.c:(.text+0x0): first defined here. The solution is to filter out the correct files when UCLIBC_HAS_GETOPT and UCLIBC_HAS_GETSUBOPT are not defined. inet: Move INET_RPC_{DIR, OUT} before CSRC_ALL libc/libc_so.a(rpc_thread.oS): In function __rpc_thread_svc_max_pollfd': rpc_thread.c:(.text+0x148): undefined reference to svc_max_pollfd' libc/libc_so.a(rpc_thread.oS): In function __rpc_thread_svc_pollfd': rpc_thread.c:(.text+0x184): undefined reference to svc_pollfd' The CSRC_ALL variable uses the INET_RPC_DIR variable which is initialized later on. We fix this problem by moving the INET_RCP_{DIR,OUT} definitions before we use them in CSRC_ALL Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-02-05buildsys: switch libc to kbuild-styleBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-11-18drop support for pre ISO-C compilersMike Frysinger
This drops __signed, __volatile, and __const. Only the latter was used in the code base, and for uClibc, not consistently. Much of the code used plain "const" which meant "__const" was useless. Really, the point of this is to stay in sync with what glibc did. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-11-18Replace FSF snail mail address with URLsMike Frysinger
This matches a similar change made to glibc. No functional changes here. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-06-15exec.c: remove duplicate attribute_hiddenPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15use open_not_cancel_2 instead of open_not_cancelPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15enable the common code for NPTLPeter S. Mazinger
the generic open, close, waitpid, read, write are good for NPTL too no good reason to have the same sleep in both libc and libpthread (NPTL) no good reason to add sigwaitinfo, sigtimedwait and sigwait to libpthread (NPTL) Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15sysconf.c: the clock_getres function is good for NPTL as wellPeter S. Mazinger
Even if glibc reuses the syscall (bloat), we can reuse the function. Make sure, that we use it only if it is provided by the syscall and the function is really around (UCLIBC_HAS_REALTIME disables it), else we get into a loop. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15pthreadP.h: avoid shadow warningsPeter S. Mazinger
Change CANCELLATION_P macro and adapt usage. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15geopt.c, LT new/pthread.c: s/__mempcpy/mempcpy/Peter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15getopt[-susv3].c: use libintl's _(x)Peter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15getopt.c, getopt.h: avoid the need for __FORCE_GLIBCPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15wordexp.c, sysconf.c: include ctype.h for isspacePeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-04-18sysconf: use getrlimit to determine ARG_MAXBernhard Reutner-Fischer
getrlimit previously was only called for NPTL (why?), fix that to be used everywhere. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-01getpass: s/sizeof(buf)-1/sizeof(buf)/ in fgetsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-12-23getpass: several fixesDenys Vlasenko
fixes bogus fgets error check fixes bogus strlen() < 0 check switches off buffering regardless of tcgetattr() success prints newline even on error or if there was no '\n' on input uses sizeof(buf) instead of PWD_BUFFER_SIZE Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2011-11-17unistd: hide relocationsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-04-29sysconf: clock_getres depends on HAS_REALTIMEBernhard Reutner-Fischer
Bug was introduced in revision a202cf6f. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-10-30sleep: include Linus' email in the commentDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-29sleep: document testing result on 2.4.x kernelsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-29sleep: add comment with test program for SIG_IGNed SIGCHLDDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-22*: inline constant __sig{add,del}set and __sigismemberDenys Vlasenko
text data bss dec hex filename - 318 4 0 322 142 libc/pwd_grp/lckpwdf.o + 312 4 0 316 13c libc/pwd_grp/lckpwdf.o - 166 0 1 167 a7 libc/stdlib/abort.o + 157 0 1 158 9e libc/stdlib/abort.o - 42 0 0 42 2a libc/sysdeps/linux/common/pause.o + 27 0 0 27 1b libc/sysdeps/linux/common/pause.o Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-22sleep: tiny code shrinkDenys Vlasenko
...or rather, it WILL BE code shrink when gcc become clever enough to not emit a second, useless XORing of ebx: 31 db xor %ebx,%ebx 85 c0 test %eax,%eax 74 11 je 73 <__GI_sleep+0x73> 31 db xor %ebx,%ebx <=== ?! Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-22sleep: employ __USE_EXTERN_INLINES (with necessary fixes)Denys Vlasenko
__USE_EXTERN_INLINES was unused and had bit-rotted, had to fix it when it didn't work as intended at first. text data bss dec hex filename - 168 0 0 168 a8 libc/unistd/sleep.o + 146 0 0 146 92 libc/unistd/sleep.o Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-22sleep: check "SIGCHLD is SIG_IGN'ed" first. Saves two syscalls in common caseDenys Vlasenko
text data bss dec hex filename - 197 0 0 197 c5 libc/unistd/sleep.o + 168 0 0 168 a8 libc/unistd/sleep.o Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-22sleep: remove commented-out code. no code changesDenys Vlasenko
It can be easily reconstructed, since it's obvious Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-10-21sleep: code shrinkDenys Vlasenko
Use less stack by using same "sigset_t set" object for new and saved signal set, remove redundant clearing of set, and do not save/restore errno around sigprocmask(SIG_SETMASK) - it never changes it. While at it, improve comments and make code style consistent across sleep.c file. text data bss dec hex filename - 242 0 0 242 f2 libc/unistd/sleep.o + 197 0 0 197 c5 libc/unistd/sleep.o Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-09-15libc: Fix cancellation handling in some C functionsSalvatore Cro
According to POSIX.1-2008 standard, the following syscalls shall be cancellation points : waitid, sleep, fdatasync, ppoll. Further, if generic syscall is not available and stubs are configured, provide the stub implementation for function. Signed-off-by: Salvatore Cro <salvatore.cro@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-08-05usershell: switch to config parserBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-08-05sysconf: implement _SC_NPROCESSORS_CONF, _SC_NPROCESSORS_ONLNBernhard Reutner-Fischer
perusing the config parser Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-07-26daemon: drop cruft incorrectly re-introduced by nptl mergeMike Frysinger
This likes to break nommu systems. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-07-09include/param.h: Dont use ARG_MAX from kernel headersKhem Raj
* Use getrlimit for ARG_MAX in sysconf on nptl. * Define NCARGS directly instead of ARG_MAX Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-04-12Merge remote branch 'origin/master' into nptlAustin Foxley
Conflicts: libc/unistd/confstr.c Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-08confstr: properly stringify version partsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-04-06correctly quote version in confstrAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-06Merge commit 'origin/master' into nptlAustin Foxley
Conflicts: libc/misc/utmp/utent.c libc/sysdeps/linux/i386/bits/syscalls.h Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-06getconf: print arbitrary GNU_LIBPTHREAD_VERSION stringBernhard Reutner-Fischer
the NPTL should probably print the version-string of the glibc it's compatible with and not the uClibc version (check what mysql expects). Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-04-02Merge commit 'origin/master' into nptlAustin Foxley
Conflicts: Makefile.in extra/Configs/Config.in libc/sysdeps/linux/common/bits/kernel-features.h libc/sysdeps/linux/common/poll.c libc/sysdeps/linux/common/sysdep.h libc/sysdeps/linux/sh/sysdep.h Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-03-25prettify make cleanBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-02-17Assorted fixed to get nptl compiling on ARMKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2009-11-28Merge remote branch 'origin/master' into nptlAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-11-26sync confname, environments with glibcBernhard Reutner-Fischer
Plus related synch. Add a testcase for the sysconf variables based on the one from glibc Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-10-17librt additions that are now possible with nptlAustin Foxley
* clock_getcpuclockid, clock_gettime, clock_nanosleep, mq_receive, mq_send, mq_timedreceive, mq_timedsend, _SC_MONOTONIC_CLOCK Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-10-17use *_not_cancel variants to avoid accidental cancellations with nptlAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-09-18convert // comments to /**/; remove empty #if/#endif pairs. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-18trim Experimentally off and uncommented hiddenBernhard Reutner-Fischer
sed -i -e '/Experimentally off - /d' $(grep -rl "Experimentally off - " *) sed -i -e '/^\/\*[[:space:]]*libc_hidden_proto(/d' $(grep -rl "libc_hidden_proto" *) should be a nop Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-09-15daemon: fix up INTERNAL_SYSCALL() usageMike Frysinger
Make sure we declare the error properly in case a port uses it, and fix the invocation of exit(). Since clone() will be returning a pid, assume that the value will not have the MSB set (negative) to simplify the error test a bit more. If gcc supports it, force this function to always be heavily optimized in a bid to avoid stack usage as much as possible. Signed-off-by: James Coleman <james.coleman@ubicom.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-05do not pass 3rd param to open() which do not create filesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>