summaryrefslogtreecommitdiff
path: root/libc/misc
AgeCommit message (Collapse)Author
2009-12-15Merge remote branch 'origin/master' into nptlAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-12-13syslog: use send(MSG_NOSIGNAL) instead of write, thus no need to handle SIGPIPEDenys Vlasenko
Size changes by this and previous change: text data bss dec hex filename 1151 13 2 1166 48e libc/misc/syslog/syslog.o 1093 10 2 1105 451 libc/misc/syslog/syslog.o 1047 10 2 1059 423 libc/misc/syslog/syslog.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-13syslog: fix openlog(xx, LOG_KERN) and optimize a bitDenys Vlasenko
The fix: logfac == 0 in openlog(xx, logfac) is allowed now. Corresponding internal openlog() call in vsyslog() uses explicit LOG_USER in order to set it as a default facility. Optimizations: mylock is not recursive now, since a single intenal call of openlog is converted to a call to openlog_internal which assumes that lock is already taken. No recursive locking is possible now. LogFacility is reduced to byte. cache static LogFile in auto variable fd (smaller code). vsyslog with bogus pri parameter wouldn't lock/unlock and mess with signals - it will just return at once. pass NULL as ident string in internal openlog call - same effect as passing LogTag but smaller code. comment out "if (LogTag)" checks - it is never NULL. use the same struct sigaction for setting new sigaction and for saving old one - saves ~32 bytes of stack. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-11get x86_64 nptl buildingAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-11-27define local stack_chk_guard for nptlNatanael Copa
Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-11-22Merge remote branch 'origin/master' into nptl_mergeAustin Foxley
Conflicts: Rules.mak libc/misc/sysvipc/msgq.c test/Rules.mak Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-11-20__assert: include unistd.h for smallintBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-11-19msgrcv is of type ssize_tPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-11-19assert: make linenumber unsignedPeter S. Mazinger
Move attribute_noreturn to header. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-11-09regex: call memcpy() ourselvesMike Frysinger
Call the hidden memcpy() ourselves otherwise gcc will emit a call to the public memcpy() which goes through the PLT. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-11-09make the sem_open changes actually compileAustin Foxley
__gen_tempname now needs to not be hidden so libpthread can get at it Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-11-09Extend __gen_tempname with mode argumentMikhail Gusarov
sem_open(3) needs to create a temporary file in a way which can't be efficiently implemented in terms of POSIX API. Extend __gen_tempname with mode_t mode argument in order to ease sem_open implementation. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-10-22regex: call memcpy() ourselvesMike Frysinger
Call the hidden memcpy() ourselves otherwise gcc will emit a call to the public memcpy() which goes through the PLT. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-10-17whitespace fixesAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-10-17uClibc_main: add the needed support for nptlAustin Foxley
* setup memory for the cancellation buffer * remove unneeded weak's * deallocation of tsd on main thread exit Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-10-17cancellation support for a large amount of the required syscallsAustin Foxley
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-10-17some tweaks under libc/ needed for nptlAustin Foxley
* updated kernel-features.h * system is provided by pt-system with nptl * _exit should do exit_group with nptl * tsd tls ptr in libc * rt_sigwaitinfo impl added Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-10-08ftw() is obsolescent in SUSv4Bernhard Reutner-Fischer
Apps should switch to nftw() Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-10-07clean up O_CLOEXEC handlingMike Frysinger
Drop the "#ifndef O_CLOEXEC" cruft, enable O_CLOEXEC in most fcntl.h headers, and import __ASSUME_O_CLOEXEC from glibc. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-26errno.c: add tls versions of errno and h_errnoAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-09-26dl-support.c: add tls supportAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-09-19libc/misc/wctype/_wctype.c: make it more readable. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-19remove a few more empty #if/#endif pairsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.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-18fix make {,install_}{,host}utilsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-09-08time.c: style cleanup. no code changes (verified with objdump)Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-08simpler and shorter read_TZ_file() helperDenys Vlasenko
text data bss dec hex filename - 1109 8 76 1193 4a9 libc/misc/time/tzset.o + 1095 8 76 1179 49b libc/misc/time/tzset.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-06wordexp.c: cleanup - remove old hidden_proto's; remove unused parameterDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-06wordexp.c: fix a bug where we might close stdoutDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-05do not save/restore errno around free() callsDenys Vlasenko
In any non-buggy program free() does not fail. And when it fails in a buggy program, the failure is usually fatal (heap corruption and segfault). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-05wtmp code: style fixes, no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-05CLOEXEC: use open(CLOEXEC) if exist; do not check fcntl(FD_CLOEXEC) failureDenys Vlasenko
text data bss dec hex filename - 370 0 0 370 172 libc/misc/dirent/opendir.o + 366 0 0 366 16e libc/misc/dirent/opendir.o - 375 4 0 379 17b libc/pwd_grp/lckpwdf.o + 356 4 0 360 168 libc/pwd_grp/lckpwdf.o - 248 0 0 248 f8 librt/shm.o + 209 0 0 209 d1 librt/shm.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-05utent.c: fix a few bugs, and shrink a bitDenys Vlasenko
bug #1: static_fd = -1; close(static_fd); DOH! bug #2: if (utmp_fd == -1) { __setutent(); } if (utmp_fd == -1) { return NULL; } if utmp_fd == -1, we call _setutent(). if __setutent() opens a fd, utmp_fd (a parameter) wouldn't change, the second check is bogus. We need to use static_fd instead in second check. Which makes clear that having utmp_fd parameter is wrong. See the patch for a complete fix. Shrink comes from simplifying fcntl(static_fd, F_SETFD, FD_CLOEXEC): text data bss dec hex filename - 661 8 384 1053 41d libc/misc/utmp/utent.o + 604 8 384 996 3e4 libc/misc/utmp/utent.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-05math.h: fix trivial typo (missing !): !defined __NO_LONG_DOUBLE_MATHDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-17support building out-of-treeBernhard Reutner-Fischer
Handle O= Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-08-17add hidden aliases for newer regex search functionsBernhard Reutner-Fischer
Fixes 3575b741754b391a27e33bb1866bdb29131b7fea which only changed the old impl but not the new one. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-08-01fnmatch.c: Include unistd.h before undefining _LIBC.Khem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2009-07-31fnmatch.c: Change scope of posixly_correct to be global.Khem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2009-07-28remove erroneous ';'Bernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-07-23fix dl_iterate_phdr() for FDPIC systemsMike Frysinger
The dlpi_addr isn't a simple Elf_Addr type for FDPIC systems, so we can't just assign 0 to it to initialize. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-20fix building for systems w/out ldso supportMike Frysinger
If an arch (like alpha and others) have no ldso support at all, then there is no point in attempting to walk loaded modules in the dl-* helper funcs. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-20first pass at implementing *at funcsMike Frysinger
Tested basic functionality with coreutils and things seem to work. At least gives us a basis to jump from. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-20dirent: push dirent type to prototypesMike Frysinger
This syncs the dirent related functions with the glibc behavior -- rather than take void pointers everywhere, make the struct dirent pointers explicit in the API. After all, the functions themselves will cast the pointers to a dirent structure, so if it isn't as expected, people will crash. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-20regex: convert #if to #ifdefMike Frysinger
Avoid gcc warnings about #if statements with defines that aren't defined. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-20add hidden aliases for older regex search functionsMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-05Check #if feature test macros are defined where they may not beRon
Once again all of these reduce the noise from gcc-4.4. Replaces a few more (USE_TLS && HAVE___THREAD) with USE___THREAD while we need to mess with them for this anyhow. Signed-off-by: Ron Lee <ron@debian.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-05Provide token prototypes for functions that are external but have no headerRon
This cuts down on a lot of noise from gcc-4.4 Signed-off-by: Ron Lee <ron@debian.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-28wchar: fix inverted parameters in error messageAndré Goddard Rosa
The error message should output "fromcode -> tocode" rather than "tocode -> fromcode". Seems to be a typo due to the order of the func called: iconv_t iconv_open(const char *tocode, const char *fromcode); Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>