master
Add elf_aux_info(3)
remove hppa64 port, which we never got going beyond broken single users. hppa reverse-stack gives us a valuable test case, but most developers don't have a 2nd one to proceed further with this. ok kettenis
access(2) alarm(2) pause(2) were not ported from pwb to v7
alarm(3): remove superfluous pointer
Wrap <assert.h> so that __assert2() goes direct
auth_getchallenge does not exist anymore
Do some easy .data -> .rodata/.data.rel.ro conversions
man pages: add missing commas between subordinate and main clauses
For open/openat, if the flags parameter does not contain O_CREAT, the 3rd (variadic) mode_t parameter is irrelevant. Many developers in the past have passed mode_t (0, 044, 0644, or such), which might lead future people to copy this broken idiom, and perhaps even believe this parameter has some meaning or implication or application. Delete them all. This comes out of a conversation where tb@ noticed that a strange (but intentional) pledge behaviour is to always knock-out high-bits from mode_t on a number of system calls as a safety factor, and his bewilderment that this appeared to be happening against valid modes (at least visually), but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef. ok millert
Align the basename(3) and dirname(3) prototypes with the POSIX spec: Both functions take a non-const parameter. Implementations may modify the passed string, even though ours do not.
Use the fancy .In macro for includes. From Jan Klemkow. ok jmc schwarze
Move to the <limits.h> universe. review by millert, binary checking process with doug, concept with guenther
use .In where appropriate; from Kaspars at Bankovskis dot net
Add support for the _POSIX_CPUTIME and _POSIX_THREAD_CPUTIME options, including CLOCK_{PROCESS,THREAD}_CPUTIME_ID constants and {clock,pthread}_getcpuclockid() functions.
Wrap <dirent.h> so that internal calls go direct and they're all weak symbols
obvious .Pa fixes; found with mandocdb(8)
Oops: confstr()'s return value should include the NUL in its count
Add framework for resolving (pun intended) libc namespace issues, using wrapper .h files and asm labels to let internal calls resolve directly and not be overridable or use the PLT. Then, apply that framework to most of the functions in stdio.h, string.h, err.h, and wchar.h. Delete the should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here.
Move ctype.h defines to the _CTYPE_ prefix, avoids clashes with identifiers in ports
we mention interim BSD releases so change some 4.4BSD use to 4.3BSD-Reno ok jmc@ schwarze@
Similar to getpwnam(3) and getnetgrent(3), it is better to call libc-private __hash_open() than the generic dbopen(3) which pulls in all 3 database backends. ok millert
Nuke last references to d_drivedata.
Add additional errno values required by POSIX.
Use a Thread Information Block in both single and multi-threaded programs. This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable!
remove unused variable
default path includes /usr/local/sbin
While we have fabs(3), frexp(3), ldexp(3), and modf(3) in libc, we have their eight *f and *l variants in libm, so add .Lb libm as suggested by tedu@: "A little extra -lm won't hurt anyone."
Implement fdatasync() as a wrapper around fsync()
fpclassify(3) and isgreater(3) are the last two pages living in src/lib/libc that require <math.h>, which implies that POSIX allows them to be in libm. While -lm is not currently required on OpenBSD, which POSIX is also fine with, providing -lm for these may help portability elsewhere. Requested by guenther@ and tedu@.
Wrap the remaining math functions in libc: __fpclassify*(), __flt_rounds(), and ldexp().
Remove useless quoting from .Fo and .Fn function names, to prevent development of a cargo cult in case people look at existing files for examples. This achieves a consistent .Fo and .Fn quoting style across the whole tree.
test LDBL_MANT_DIG == DBL_MANT_DIG instead of hardcoding 53. -> test becomes meaningful on vax No actual change, no bump okay martynas@
remove NOTREACHED
Don't need <sys/types.h> before <sys/ipc.h> anymore
ftok: avoid left shift of a signed in by 24 places Fix "left shift of 255 by 24 places cannot be represented in type 'int'" error from UBSAN. Adapted from a FreeBSD diff via tb@. OK tb@ deraadt@
A few sys/param.h annotations lacked ALIGNBYTES
More correction of section 3 layout. directory->opendir, fts->fts_open, getcap->cgetent. pwcache->user_from_uid. And then repair references. ok jmc
I am retiring my old email address; replace it with my OpenBSD one.
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.
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.
Only allow changing the domainname (from empty) before securelevel increase. libc YP support has a couple of places where the domainname is cached, and this results in wildly incoherent behaviour which could even be risky. If you want to change the domainname, you will have to reboot. ok beck miod
make fixed-sized fixed-value mib[] arrays be const ok guenther tb millert
.Li -> .Vt where appropriate; from josiah frentsos, tweaked by schwarze
1) The yp_bind/yp_unbind and internal _yp_dobind/_yp_unbind sequences shared dom_binding structs between threads, which is unsafe -- example, dom_vers signalled retry events, and structs+socket would get deallocated in _yp_unbind. Change all yp_first (and similar) functions to understand that _yp_dobind now provides a private dom_binding and socket, which must be released using _yp_unbind. Use similar methods in the one-step yp_all function. 2) domainname caching in get* is not neccessary now that the domainname cannot change relative to ypconnect(2)'s decisions. Many fields in dom_binding struct become unused, so delete them. ok jmatthew, also tested by miod
getgrouplist(3): always return the total number of groups found
order sysctl(2) Xr by section missed when sysctl(3) references were changed to sysctl(2)
Minimize #includes, particularly to avoid thread_private.h
When system calls indicate an error they return -1, not some arbitrary value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
getpwnam(3) uses dbopen(3), which pulls all 3 database backends into static binaries. If we call libc-private __hash_open() instead, it results in a ~40K reduction in many static binaries. ok millert
getpagesize() appeared in 4.1c before 4.2
tweak previous;
Prefer "get or set" over "get/set" or "get and set".
environ and __progname are not declared in a public header; declare them in libc's hidden/stdlib.h instead of in each .c file that needs one
I forgot that chpass(1) and passwd(1) reach-around into libc for getpwent.c (isn't it horrible), and therefore lack visibility of the the libc-internal __hash_open() function. Use -DFORCE_DBOPEN in chpass/Makefile and passwd/Makefile and adjust getpwent.c to use the external visible interface. Is there a better way?
Wrap <ttyent.h> so that calls go direct and the symbols are all weak.
Remove includes that are no longer neeed after tedu's simplification. OK jca@
macro fixes from Kaspars at Bankovskis dot net; also fixing one typo in fts(3) while here
Ignore extra groups that don't fit in the buffer passed to getgrouplist(3)
more precision because the argument is signed, and even char is signed on some platforms; OK millert@ jmc@
Wrap <unistd.h> so that internal calls go direct and they're all weak symbols Delete unused 'fd' argument from internal function oldttyname()
The locale is ignored on OpenBSD, match the wording used in isalpha.3. OK schwarze@
pull in missing includes (math.h, unistd.h, stdlib.h) needed for prototypes
First pass at removing clauses 3 and 4 from NetBSD licenses.
fix markup of _PATH_DEFPATH (Li -> Dv); ok jmc
spelling fixes; from paul tagliamonte any changes not taken noted on tech, but chiefly here i did not take the cancelation - cancellation changes;
Make sure modf() returns correct values for infinities. While there, drop the few assembler versions as has been done on other *BSD systems; this function (modf) turns out to be non-trivial enough, having only one known-to-work version is preferrable.
HISTORY; tweaks and ok sobrado@ jmc@
zap remaining rcsid.
correct Research Unix edition "appeared in" use in HISTORY
readdir_r(3) was never necessary and has been deprecated by POSIX. Document that in the manpage and stop using it internally.
Add scandirat(3); from freebsd
pause.3: miscellaneous rewrites, cleanup
be more forceful about not using these. improvements sthen@, jmc@. okay millert@, jca@ jmc@
Fix Ed Schouten's name
man pages: add missing word, The foo() ... -> The foo() function ...
Even though not callable, "Ed" is a macro name, so for clarity, escape it when it appears on a macro line.
More consistently put remarks about the less useful LC_* categoties, i.e. those other than LC_CTYPE, into the CAVEATS section, and standardize wording somewhat. OK jmc@
Use .Rv where appropriate, and move it to RETURN VALUES; remove .Tn, and a few minor macro adjustments. Patch from Kaspars at Bankovskis dot net.
Split the intra-thread functionality from kill(2) into its own syscall thrkill(2), rolling the kill(2) syscall number with the ABI change to avoid breaking binaries during during the transition. thrkill(2) includes a 'tcb' argument that eliminates the need for locking in pthread_kill() and simplifies pthread_cancel(). Switch __stack_smash_handler() to use thrkill(2) and explicitly unblock SIGABRT.
put the _readdir_unlocked() prototype in an obvious place
obvious reallocarray() use ok doug
__progname has type char *, we cannot change its type without causing havoc all over the place. So add some casts to silence the compiler. ok deraadt@ guenther@
Document that shm_open() accepts O_CLOEXEC and O_NOFOLLOW as extensions
shm_open(), sysconf(), tcflow(), and tcsendbreak() are not permitted to be cancellation points in POSIX, so change them to invoke the non-cancellation point versions of open(), close(), nanosleep(), and write()
It is distasteful to have manual pages which don't refer to real function calls, but instead a "class" of functions like "sigsetops". Rename to sigaddset", and while at it improve documentation in sigprocmask(2) to point to it. ok tedu
Don't wrap initialized variables: binutils appears to be mishandling them on arm and m88k
spelling
Finish wrapping <signal.h> so that calls to the sigset ops go direct and everything but raise() and signal() are weak. No longer need _thread_sys_ prefix on getthrid()
Restore .Xr to pthread_sigmask
Move sigwait(3) from libpthread to libc
sleep(3): don't bypass nanosleep(2) if seconds is zero
Fix typo in comment for f_favail. From Alf Schlichting
All these files include <stdlib.h>, so do not need to cast malloc/calloc/realloc* returns.
No specific called "exec(3)", so move primary manpage to a name which does exist -- execv(3). Still call this a family but without "Nm". Adjust Xr in various pages to refer to the precise function used rather than the family, in most cases the semantics of execve(2) are being referenced, so change the Xr. ok jmc
Use sysctl CTL_NET.PF_INET6 to check if IPv6 is available or not. With this sysconf(3) no longer needs the inet pledge. The kernel has been updated for this for a while now. OK sthen@ deraadt@
reentrant functions were not in 386BSD spotted by and ok deraadt@
Do not include a timestamp in the syslog message. There is no need -- syslogd will fill it in immediately upon reception on the other side of sendsyslog(2). Our libc only talks to our syslogd, which will fix the timestamp before forwarding. syslog_r has done this for a long time already. ok tedu bluhm
Reading https://github.com/Geal/rust-syslog/issues/79, I came to a related conclusion that our syslog_r should not stomp on errno. The errno being returned from sendsyslog() isn't exactly compatible with the what a legacy syslog_r() would do here anyways, and it is better to just be void and non-stomping; ok millert bluhm
Use static and __{BEGIN,ENV}_HIDDEN_DECLS to hide a bunch of internal symbols that are not longer exported. (This improves the generated code.)
doubled word; from Leon Fischer
Add support for timeconting in userland.
Remove history of the tms struct. It is tied to the function, and the manual incorrectly claimed it first appeared in 4BSD. ok deraadt@
typo; fix from hiltjo posthuma
Fix a "copy-and-paste" error that Coverity picked up in the augment code
controm terminql -> controlling terminal;
pull in stdlib.h as required
ualarm.3: cleanups, rewrites
Mention that the strings are OS-specific. In part based on input from deraadt@, OK millert@.
Pull in <stdio.h> for NULL
Wrap <vis.h> so that calls go direct and the symbols are all weak
change some 4.4BSD references to earlier releases ok schwarze@
usleep(3): always call nanosleep(2)
Mention aligned_alloc(), prompted by Brad; ok jmc@
Found two multiple evaluation macros. One of them so long and scary it too many people to unravel correctly and place into a static function. While here, move the flags bits into local variables, which reduces the amount of () in the checks. help from millert, miod, tedu
Wrap waitpid() so calls go direct; weaken wait() and wait3(). Strip out unnecessary #includes and use NULL instead of (struct rusage *)0