master
Make our mktemp(3) callback-driven and split into multiple files. Previously, calling any of the mktemp(3) family would pull in lstat(2), open(2) and mkdir(2). Now, only the necessary system calls will be reachable from the binary. OK deraadt@ guenther@
Update a comment about standards requirements
zap remaining rcsid.
I am retiring my old email address; replace it with my OpenBSD one.
stop flushing streams in abort(). it's hackish and unsafe, and no longer required. try to document this fact and some of the history. with feedback from deraadt guenther millert
Minimize #includes, particularly to avoid thread_private.h
Replace the vague, incorrect, and confusing BUGS sections with CAVEATS clearly stating which arguments have to be avoided, and mention the header files defining the constants required for the checks. Feedback and OK guenther@, OK bluhm@.
Wrap <stdlib.h> so that calls go direct and the symbols not in the C standard are all weak. Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.
Improve wording in alloca. 1. it's not a bug; it's a caveat. 2. "slightly unsafe" gives me the willies. 3. one .Xr to malloc should suffice ok deraadt jmc
remove please from manual pages ok jmc@ sthen@ millert@
spelling fixes; from paul tagliamonte any changes not taken noted on tech, but chiefly here i did not take the cancelation - cancellation changes;
Move __cxa_thread_atexit* to its own .c file to avoid pulling the code (w/ _dlctl reference) into static executables. It's all Mark's code so put his preferred copyright on it.
.Li -> .Vt where appropriate; from josiah frentsos, tweaked by schwarze
ansi ok mpi@ deraadt@
change Xrs from now-defunct db(3) to dbopen(3); this wasn;t a straight replace: thanks both to schwarze and maja for feedback on how to rewrite parts;
bsearch(3): support arrays with more than INT_MAX elements
Only two of the *rand48.c files need <math.h>, so just #include it in them
Again. Make exit(), fclose(), fflush(), and freopen() comply with POSIX-2008 requirements for setting the underlying file position when flushing read-mode streams, and make an fseek()-after-fflush() not change the underlying file position. This commit fixes some minor problems of the previous.
For putenv(3), return an error if string starts with a '=' character. Both FreeBSD and NetBSD have this behavior. OK deraadt@
Zap warning against __findenv usage, it is not exported by libc
If a command or interface first appeared in PWB/UNIX, UNIX System III or UNIX System V mention it. Only do so in manual pages with a pre-existing HISTORY section.
This patch fixes one bug and one instance of undesirable behaviour.
change some 4.4BSD references to earlier releases ok schwarze@
word fix; from edgar pettijohn
Remove dead support for changing BDB hash algorithm and cache of alternatives
Use David Musser's introsort algorithm to fall back to heapsort(3) when the recursion depth reaches 2*lg(n + 1). This avoids quicksort's quadratic behavior for pathological input without appreciably changing the average run time.
Set errno more consistently, and fix a warning, ok tedu
fix Dt;
Add lldiv(), imaxabs(), imaxdiv(), strtoimax() and strtoumax()
Minimal maintenance to make this mess slightly less confusing: queue -> list; mention "intrusive"; element -> member at one place; delete a bogus remark that maybe referred to a long-gone implementation in VAX assembly code. Much more could be improved, but i don't want to waste too much time here.
XPG requires insque() and remque() to work with linear lists and not just circular lists. Amazingly, they managed to extend the requirements to no longer match the behavior of the VAX instructions they were modeled after, so the trivial VAX ASM versions have to go. Nice job breaking it, X/Open!
Reduce qabs() and qdiv() to aliases of llabs() and lldiv(). Merge the manual pages and call them deprecated there.
Move the __rand48_* declarations into rand48.h, and then hide both them and __dorand48() and __rand48_deterministic
lsearch(3): reimplement using lfind(3)
Revert 1.144 of lib/libc/stdlib/malloc.3. It was changed by accident by my previous commit.
<uvm/uvmexp.h> is clearly only for VM_MALLOC_CONF, but <sys/sysctl.h> takes care of doing that include.
Just return if nmemb is 0. Avoids a NULL dereference and is consistent with the behavior of the other libc sort functions. OK deraadt@
Add mkdtemps(3), like mkdtemp(3) but with a suffix. OK deraadt@ tb@
- fix bug wrt posix_memalign(3) of blocks between half a page and a page - document posix_memalign() does not play nice with reacallocarray(3) and freezero(3)
The mdoc(7) .Ft macro does not need quoting of its arguments, but about 10% of our manual pages using this macro employed useless quoting anyway. Remove these quotes such that they do not incite fear, uncertainty, and doubt in developers who happen to look at these pages. jmc@ and tb@ agree with the direction.
correct Research Unix edition "appeared in" use in HISTORY
Don't fall back to heapsort() if we would otherwise switch to insertion sort (when the number of elements is < 7).
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
man pages: add missing word, The foo() ... -> The foo() function ...
GNU ld has prefixed the contents of .gnu.warning.SYMBOL sections with "warning: " since 2003, so the messages themselves need not contain the prefix anymore.
Some people still argue that rand(3) and random(3) have suitable deterministic use cases, so explain the situation a bit more. Since the 80's, I estimate around 5 algorithm changes, so any chosen seed is unrepeatable UB.
Add PROTO_NORMAL() declarations for the remaining syscalls, to avoid future, inadvertant PLT entries. Move the __getcwd and __realpath declarations to hidden/{stdlib,unistd}.h to consolidate and remove duplication.
Type-cast getpagesize() from int to size_t for the comparison with d. getpagesize() will only return positive numbers (there is no negative page size system) and it can not fail. Should fix some compiler warnings seen in -portable projects. OK otto@
Overshot w/PROTO_DEPRECATED: seed48_deterministic() is used internally
The 0x (or 0X) prefix in base 16 is optional so only skip over the prefix if the character following it is a valid hex char. The C99 standard is clear that given the string "0xy" zero should be returned and endptr set to point to the "x". OK deraadt@ espie@
Another couple of commas in the wrong place, ok jmc
Replace all 14 instances of .St -ansiC-99 in our tree with .St -isoC-99. The former is not used anywhere in NetBSD, FreeBSD, or DragonFly and not supported by groff, so i'm going to delete it from mandoc(1). We don't need two macros for the same thing.
be more forceful about not using these. improvements sthen@, jmc@. okay millert@, jca@ jmc@
system(3) should ignore SIGINT and SIGQUIT until the shell exits. This got broken when system.c was converted from signal(3) to sigaction(2). Also add SIGINT and SIGQUIT to the set of blocked signals and unblock them in the parent after the signal handlers are installed. Based on a diff from Leon Fischer. OK deraadt@
lint is dead: delete useless LINTLIBRARY comments
Complete the ld.so boot cleanup: move most libc initialization from _csu_finish() to _libc_preinit(), which is an .init_array function in shared libc (and mark it INITFIRST) or a .preinit_array function in static libc, grabbing the _dl_cb callback there from ld.so. Then in _csu_finish(), invoke the dl_clean_boot() callback to free ld.so's startup bits before main() gets control.
man pages: add missing commas between subordinate and main clauses