summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2009-12-19Implement proper error handling for getgrent(3), getgrnam(3) and getgrgid(3).Ingo Schwarze
1) Distinguish normal end of data (like eof, YPERR_NOMORE, YPERR_KEY) from error conditions. 2) Save errno(2) and restore it in case of success, as suggested by deraadt@ and beck@. While this code is touched, * move the common code for the yp_first and yp_next calls after the respective if/else-block; note that free(data) is not needed in case of failure and that __ypcurrent = NULL does no harm after failing yp_first. * return 0, not NULL: the return value of grscan is int, not a pointer. This is the last part of the work done on getgrent.c during c2k9, heavily relying on the other improvements done at that time. This has been rotting in my tree far too long. "get it in" deraadt@; also lightly tested by simon@ some time ago
2009-12-16save calls to arc4random() by using a nibble at a time; not becauseOtto Moerbeek
arc4random() is slow, but it induces getpid() calls; also saves a bit on stirring efforts
2009-12-16Update the list of async-signal-safe functionsPhilip Guenthe
Document that snprintf/vsnprintf/syslog_r() aren't async-signal-safe for floating-point Provide cursory documentation of SIGTHR Eliminate the NOTE section of the sigaction(2) manpage by merging the good bits into the STANDARDS section ok deraadt@
2009-12-15No point in refreshing the pid from inside arc4_stir() when thatPhilip Guenthe
doesn't test it, so factor out the two places that test it into a routine and do the refreshing there. With this, arch4random_buf() doesn't trigger superfluous calls to getpid() when filling large buffers. ok deraadt@, "looks nicer indeed" otto@
2009-12-14Keep all bits of __svc_fdset up to date, not just those beyond FD_SETSIZE.Ingo Schwarze
Bug found while auditing the same complaint by parfait, see the previous commit; still not shutting parfait up. "wow, that's nasty" deraadt@
2009-12-14sleep(3) is supposed to return zero when it sleeps the entire amountPhilip Guenthe
ok deraadt@
2009-12-11__svc_fdsetsize is counted in bits, not in array elementsIngo Schwarze
When exceeding fd 1024, this bug cleared flag bits for all file descriptors except those <= 64. Found while auditing a (false positive) complaint by parfait. This bugfix does not shut parfait up, though. OK millert@ deraadt@
2009-12-11Fix two memory leaks, one found by parfait, one by myself.Jacek Masiulaniec
ok deraadt@
2009-12-11clean up the realloc code to make a parfait false positive go away.Theo de Raadt
parfait still does not completely understand how realloc() behaves (or %, ?:, >>, or << and its terminal function tracking remains weak)
2009-12-11plug a memory leak; found by parfait, ok djmTheo de Raadt
2009-12-11More changes to avoid truncating 64 bit pointers to 32 bits and sign-extendingMiod Vallat
them; allows userland with stack beyond 2GB to run.
2009-12-10getcwd() is posix, not ansi; from Thomas PfaffJason McIntyre
ok millert
2009-12-10Make sure to use 64 bit instructions in the assembly statements (addi -> daddi)Miod Vallat
in the prologue; this gives a chance for binaries loaded with their stack over 2GB virtual, to run. Who's your daddi now?
2009-12-07Get page size information by reading the kernel image' struct uvmexp, insteadMiod Vallat
of the value of PAGE_SIZE found in the standard headers when compiling.
2009-12-07Make userland malloc use __LDPGSZ granularity on mips, regardless of theMiod Vallat
actual kernel page size.
2009-12-06Make internal file descriptor handling async-signal safe by eliminatingKurt Miller
the use of spinlocks and malloc. All needed memory is allocated upfront and _thread_kern_sig_defer/undefer() is now used to protect critical sections. okay guenther@
2009-12-05missing word;Jason McIntyre
from trhodes@freebsd, r200095;
2009-12-02we don't expose overruns/underruns as negative positions anymore,Alexandre Ratchov
don't call the sio_onmove() call-back with negative argument.
2009-11-28This might not be necessary, but Just In Case: since the underlyingPhilip Guenthe
syscall ABI has changed and everything is going to need to be relinked anyway, bump the rthread major
2009-11-27wrap Nd in quotes, since it has >9 args;Jason McIntyre
2009-11-27Correct description of physically vs logically; spotted by NickOtto Moerbeek
Guenther; ok jmc
2009-11-27Switch the chunk_info lists to doubly-linked lists and use the queueOtto Moerbeek
macros for them. Avoids walking the lists and greatly enhances speed of freeing chunks in reverse or random order at the cost of a little space. Suggested by Fabien Romano and Jonathan Armani; ok djm@
2009-11-27Add setrdomain() and getrdomain() system calls. Committing now toPhilip Guenthe
catch the libc major bump per request from deraadt@ Diff by reyk. ok guenther@
2009-11-27Don't forget to fill region from the cache with junk if needed in one case;Otto Moerbeek
from Fabien Romano and Jonathan Armani
2009-11-27No need to clear a mmapped region; from Fabien Romano and JonathanOtto Moerbeek
Armani
2009-11-27Add a signal for librthread to use for interthread ASTs for cancelationPhilip Guenthe
and suspension. "get it in" deraadt@, tedu@, cheers by others
2009-11-27Convert thrsleep() to an absolute timeout with clockid to eliminate aPhilip Guenthe
race condition and prep for later support of pthread_condattr_setclock() "get it in" deraadt@, tedu@, cheers by others
2009-11-27Convert thrsigdivert to (almost) be sigtimedwait by adding siginfo_tPhilip Guenthe
and struct timespec * argument. sigtimedwait is just a one line wrapper after this. "get it in" deraadt@, tedu@, cheers by others
2009-11-27Change threxit() to take a pointer to a pid_t to zero out from thePhilip Guenthe
kernel so that librthread can detect when a thread is completely done with its stack without need a kqueue. The dying thread moves itself to a GC list, other threads scan the GC list on pthread_create() and pthread_join() and free the stack and handle once the thread's thread id is zeroed. "get it in" deraadt@, tedu@, cheers by others
2009-11-27Bump the libc major for the post-h2k9 string of ABI changes and additionsPhilip Guenthe
(rthreads, MB_LEN_MAX, rdomains)
2009-11-27sync german translations with recent C.msg changesStefan Sperling
"Reads ok" mk@
2009-11-25Italian translationsgiovanni
"syntax looks good" guenther@
2009-11-24Add `da.msg'.Michael Knudsen
2009-11-24Danish translations.Michael Knudsen
(If anyone can suggest a translation for e.g. `breakpoint' that doesn't make me cringe, let me know.)
2009-11-24Update the ENOTSUP summary and description.Philip Guenthe
Pointed out by Alan Bueno and jmc@ ok jmc@
2009-11-24- sync with latest additionsJasper Lievisse Adriaanse
feedback & ok otto@
2009-11-24Change ENOTSUP's strerror() to "Not supported"Philip Guenthe
Provide C and Pig locale expansions for errno values from EAUTH to ENOTSUP ok millert@, mk@, go aheads from others who have other translations in the works
2009-11-23Make the code example fit on an 80 char screen without wrapping.Michael Knudsen
ok guenther (no word from the sunshine girls on the matter, though)
2009-11-22Oops, KSEG -> CKSEG.Miod Vallat
2009-11-22Fixed typo in function name.Tobias Stoeckmann
ok jmc
2009-11-22Allow mips ports to override VM_{MIN,MAX}_KERNEL_ADDRESS, and provide theMiod Vallat
address as a kernel variable for use by libkvm. On sgi IP27 and IP30 kernels, use XKSEG instead of CKSSEG; this will allow kernel KVM size to grow in the future if necessary.
2009-11-21replacing malloc/realloc dance, by only one reallocCharles Longeau
ok millert@
2009-11-21remove unused variableCharles Longeau
ok deraadt@
2009-11-21remove unused variableCharles Longeau
ok guenther@
2009-11-21Ooops, committed an unbaked changePhilip Guenthe
2009-11-21Several stdio functions were failing to set the stream orientationPhilip Guenthe
to 'narrow' as they should. "looks correct" millert@ "makes sense" blambert@
2009-11-19pthread_rwlock_wrlock() should increment the count of writers justPhilip Guenthe
once and not on every wakeup. ok kurt@
2009-11-18More shrinkage, a bit for ramdisks but mostly for static binaries:Philip Guenthe
- wrap with #ifndef NO_LOG_BAD_DNS_RESPONSES libc code that uses p_class() and p_type() for diagnostics, then add that define to libstub to avoid pulling in res_debug_syms.o - split rcmd() and ruserok() into separate files, as nothing uses both - split readdir_r() to its own file - split syslog_r() from syslog(), as the latter needs localtime(); many binaries no longer need to pull in all the time code after this; switch from usleep() to nanosleep() while we're at it (The profit of analysis of -Wl,-M,--cref output) Chops 888kB from /bin and /sbin on i386 ok deraadt@, miod@
2009-11-12simplify the code looking for + in the password database, after analysisTheo de Raadt
of a false positive made by parfait; ok millert
2009-11-12change back to preferring kqueue, now that nicm, tedu and i haveTheo de Raadt
fixed it (or, all the issues we are aware of so far). discussed with nicm