summaryrefslogtreecommitdiffstats
path: root/libc/misc
Commit message (Collapse)AuthorAgeFilesLines
* prettify make cleanBernhard Reutner-Fischer2010-03-2525-50/+50
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* __uClibc_main: use __pagesize to protect against recursionBernhard Reutner-Fischer2010-02-031-4/+2
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* remove two checks for gettimeofday errorDenys Vlasenko2010-02-021-2/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* errno: hide __libc_resp, __libc_errno, and __libc_h_errnoKhem Raj2010-02-011-3/+2
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* wchar.c: fix indentationDenys Vlasenko2010-01-241-10/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* silence some warnings about unused paramsBernhard Reutner-Fischer2010-01-233-4/+6
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* wordexp: silence shadow warningBernhard Reutner-Fischer2010-01-211-18/+18
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* ctime: do not use static struct tm bufferDenys Vlasenko2010-01-091-3/+17
| | | | | | | | text data bss dec hex filename - 19 0 0 19 13 libc/misc/time/ctime.o + 25 0 0 25 19 libc/misc/time/ctime.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* check if USE_TLS is defined before useHans-Christian Egtvedt2009-12-171-3/+3
| | | | | | | | | | | This patch will convert all the #ifdef USE_TLS and #if USE_TLS to #if defined(USE_TLS) && USE_TLS. By checking if the USE_TLS is defined before checking its value will result in correct behavior for architectures not defining this config symbol. Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Acked-by: Carmelo AMOROSO <carmelo.amoroso@st.com>
* syslog: use send(MSG_NOSIGNAL) instead of write, thus no need to handle SIGPIPEDenys Vlasenko2009-12-131-7/+6
| | | | | | | | | | | 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>
* syslog: fix openlog(xx, LOG_KERN) and optimize a bitDenys Vlasenko2009-12-131-45/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* __assert: include unistd.h for smallintBernhard Reutner-Fischer2009-11-201-2/+1
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* msgrcv is of type ssize_tPeter S. Mazinger2009-11-191-2/+2
| | | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* assert: make linenumber unsignedPeter S. Mazinger2009-11-191-4/+3
| | | | | | | 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>
* regex: call memcpy() ourselvesMike Frysinger2009-10-221-1/+2
| | | | | | | 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>
* ftw() is obsolescent in SUSv4Bernhard Reutner-Fischer2009-10-082-2/+5
| | | | | | Apps should switch to nftw() Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* clean up O_CLOEXEC handlingMike Frysinger2009-10-072-22/+7
| | | | | | | 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>
* errno.c: add tls versions of errno and h_errnoAustin Foxley2009-09-262-1/+15
| | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* dl-support.c: add tls supportAustin Foxley2009-09-261-0/+42
| | | | Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* libc/misc/wctype/_wctype.c: make it more readable. no code changesDenys Vlasenko2009-09-191-211/+183
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* remove a few more empty #if/#endif pairsDenys Vlasenko2009-09-192-6/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* convert // comments to /**/; remove empty #if/#endif pairs. no code changesDenys Vlasenko2009-09-1818-103/+42
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* trim Experimentally off and uncommented hiddenBernhard Reutner-Fischer2009-09-1845-353/+3
| | | | | | | | 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>
* fix make {,install_}{,host}utilsBernhard Reutner-Fischer2009-09-181-209/+46
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* time.c: style cleanup. no code changes (verified with objdump)Denys Vlasenko2009-09-081-89/+37
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* simpler and shorter read_TZ_file() helperDenys Vlasenko2009-09-081-10/+23
| | | | | | | | 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>
* wordexp.c: cleanup - remove old hidden_proto's; remove unused parameterDenys Vlasenko2009-09-061-42/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* wordexp.c: fix a bug where we might close stdoutDenys Vlasenko2009-09-061-5/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* do not save/restore errno around free() callsDenys Vlasenko2009-09-051-4/+5
| | | | | | | | 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>
* wtmp code: style fixes, no code changesDenys Vlasenko2009-09-051-18/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* CLOEXEC: use open(CLOEXEC) if exist; do not check fcntl(FD_CLOEXEC) failureDenys Vlasenko2009-09-052-22/+30
| | | | | | | | | | | | 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>
* utent.c: fix a few bugs, and shrink a bitDenys Vlasenko2009-09-051-47/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* math.h: fix trivial typo (missing !): !defined __NO_LONG_DOUBLE_MATHDenys Vlasenko2009-09-051-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* support building out-of-treeBernhard Reutner-Fischer2009-08-1725-0/+50
| | | | | | Handle O= Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* add hidden aliases for newer regex search functionsBernhard Reutner-Fischer2009-08-171-0/+2
| | | | | | | Fixes 3575b741754b391a27e33bb1866bdb29131b7fea which only changed the old impl but not the new one. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* fnmatch.c: Include unistd.h before undefining _LIBC.Khem Raj2009-08-011-2/+9
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* fnmatch.c: Change scope of posixly_correct to be global.Khem Raj2009-07-311-1/+1
| | | | Signed-off-by: Khem Raj <raj.khem@gmail.com>
* remove erroneous ';'Bernhard Reutner-Fischer2009-07-282-4/+4
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* fix dl_iterate_phdr() for FDPIC systemsMike Frysinger2009-07-231-0/+5
| | | | | | | 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>
* fix building for systems w/out ldso supportMike Frysinger2009-07-201-1/+3
| | | | | | | 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>
* first pass at implementing *at funcsMike Frysinger2009-07-201-19/+49
| | | | | | | 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>
* dirent: push dirent type to prototypesMike Frysinger2009-07-206-32/+12
| | | | | | | | | | 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>
* regex: convert #if to #ifdefMike Frysinger2009-07-202-2/+2
| | | | | | Avoid gcc warnings about #if statements with defines that aren't defined. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* add hidden aliases for older regex search functionsMike Frysinger2009-07-201-0/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Check #if feature test macros are defined where they may not beRon2009-07-051-1/+1
| | | | | | | | | 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>
* Provide token prototypes for functions that are external but have no headerRon2009-07-051-3/+2
| | | | | | | 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>
* wchar: fix inverted parameters in error messageAndré Goddard Rosa2009-06-281-1/+1
| | | | | | | | | | 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>
* - fix fallout from r24140 and r24160 for !CTYPE_TABLESBernhard Reutner-Fischer2009-02-131-0/+1
|
* Add strverscmp() and versionsort[64]().Denis Vlasenko2009-02-083-2/+34
| | | | | By Hai Zaar (haizaar AT codefidence.com)
* "make utils" now successfully makes utils for targetDenis Vlasenko2009-01-281-1/+1
|