cosmopolitan/libc/calls/struct
Justine Tunney 60cb435cb4
Implement pthread_atfork()
If threads are being used, then fork() will now acquire and release and
runtime locks so that fork() may be safely used from threads. This also
makes vfork() thread safe, because pthread mutexes will do nothing when
the process is a child of vfork(). More torture tests have been written
to confirm this all works like a charm. Additionally:

- Invent hexpcpy() api
- Rename nsync_malloc_() to kmalloc()
- Complete posix named semaphore implementation
- Make pthread_create() asynchronous signal safe
- Add rm, rmdir, and touch to command interpreter builtins
- Invent sigisprecious() and modify sigset functions to use it
- Add unit tests for posix_spawn() attributes and fix its bugs

One unresolved problem is the reclaiming of *NSYNC waiter memory in the
forked child processes, within apps which have threads waiting on locks
2022-10-16 12:25:13 -07:00
..
bpf.h Improve system calls 2022-07-08 06:42:03 -07:00
cpuset.h Make more compatibility improvements 2022-09-06 07:04:13 -07:00
dirent.h Improve cosmo's conformance to libc-test 2022-10-10 17:52:41 -07:00
fd.internal.h Don't relocate file descriptor memory 2022-09-09 16:54:28 -07:00
filter.h Strengthen the pledge() polyfill 2022-06-27 13:02:17 -07:00
flock.h Add more apis to redbean unix module 2022-08-16 23:23:34 -07:00
flock.internal.h Elevate Windows production worthiness 2022-10-13 13:44:41 -07:00
framebufferfixedscreeninfo.h Initial import 2020-06-15 07:18:57 -07:00
framebuffervirtualscreeninfo.h Initial import 2020-06-15 07:18:57 -07:00
fsid.h Add lchown, lchmod, statvfs, fstatvfs 2022-08-22 20:50:16 -07:00
iovec.h Greatly expand system() shell code features 2022-10-11 21:30:31 -07:00
iovec.internal.h Greatly expand system() shell code features 2022-10-11 21:30:31 -07:00
itimerval.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
itimerval.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
metasigaltstack.h Improve memory safety 2021-10-13 17:27:13 -07:00
metastat.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
metatermios.internal.h Apply some touchups 2021-02-07 07:02:46 -08:00
rlimit.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
rlimit.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
rusage.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
rusage.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
sched_param.h Add more missing libc/libc++ functions 2022-07-22 07:20:21 -07:00
sched_param.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
seccomp.h Add seccomp bpf sandboxing to redbean 2022-04-18 08:54:42 -07:00
sigaction-freebsd.internal.h Remove dollars from system call support symbols 2021-02-03 19:35:29 -08:00
sigaction-linux.internal.h Remove dollars from system call support symbols 2021-02-03 19:35:29 -08:00
sigaction-netbsd.h Add NetBSD support 2021-02-05 06:19:45 -08:00
sigaction-openbsd.internal.h Remove dollars from system call support symbols 2021-02-03 19:35:29 -08:00
sigaction-xnu.internal.h Remove dollars from system call support symbols 2021-02-03 19:35:29 -08:00
sigaction.h Change sigaction_f to match sysv signature (#585) 2022-09-02 05:08:35 -07:00
sigaction.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
sigaltstack.h Improve memory safety 2021-10-13 17:27:13 -07:00
sigaltstack.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
siginfo-freebsd.internal.h Improve signals and memory protection 2022-04-12 22:11:00 -07:00
siginfo-meta.internal.h Introduce sigtimedwait() and sigwaitinfo() 2022-10-10 07:39:44 -07:00
siginfo-netbsd.internal.h Improve signals and memory protection 2022-04-12 22:11:00 -07:00
siginfo-openbsd.internal.h Improve signals and memory protection 2022-04-12 22:11:00 -07:00
siginfo-xnu.internal.h Improve signals and memory protection 2022-04-12 22:11:00 -07:00
siginfo.h Introduce sigtimedwait() and sigwaitinfo() 2022-10-10 07:39:44 -07:00
siginfo.internal.h Introduce sigtimedwait() and sigwaitinfo() 2022-10-10 07:39:44 -07:00
sigset.h Implement pthread_atfork() 2022-10-16 12:25:13 -07:00
sigset.internal.h Implement sigpending for sysv and nt (#597) 2022-09-07 05:38:12 -07:00
sigval.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
sigval.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
stat.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
stat.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
stat.macros.h Make some foss compatibility improvements 2022-10-14 13:59:34 -07:00
statfs-freebsd.internal.h Add lchown, lchmod, statvfs, fstatvfs 2022-08-22 20:50:16 -07:00
statfs-linux.internal.h Add lchown, lchmod, statvfs, fstatvfs 2022-08-22 20:50:16 -07:00
statfs-meta.internal.h Polyfill statfs() and fstatfs() on BSD distros 2022-08-17 14:54:03 -07:00
statfs-netbsd.internal.h Add lchown, lchmod, statvfs, fstatvfs 2022-08-22 20:50:16 -07:00
statfs-openbsd.internal.h Add lchown, lchmod, statvfs, fstatvfs 2022-08-22 20:50:16 -07:00
statfs-xnu.internal.h Add lchown, lchmod, statvfs, fstatvfs 2022-08-22 20:50:16 -07:00
statfs.h Add lchown, lchmod, statvfs, fstatvfs 2022-08-22 20:50:16 -07:00
statfs.internal.h Add lchown, lchmod, statvfs, fstatvfs 2022-08-22 20:50:16 -07:00
statvfs.h Add lchown, lchmod, statvfs, fstatvfs 2022-08-22 20:50:16 -07:00
sysinfo.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
sysinfo.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
termios.h Fix termios struct on Linux 2021-09-03 22:19:41 -07:00
timespec.h Clean up some sleep code 2022-10-08 03:00:48 -07:00
timespec.internal.h Introduce clock_nanosleep() 2022-10-05 06:37:15 -07:00
timeval.h Introduce clock_nanosleep() 2022-10-05 06:37:15 -07:00
timeval.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
tms.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
ucontext-freebsd.internal.h Improve signals and memory protection 2022-04-12 22:11:00 -07:00
ucontext-netbsd.internal.h Perform more low-level code cleanup 2022-09-09 04:07:08 -07:00
ucontext-openbsd.internal.h Improve signals and memory protection 2022-04-12 22:11:00 -07:00
ucontext.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
user_regs_struct.h Remove dollars from system call support symbols 2021-02-03 19:35:29 -08:00
utsname-linux.internal.h Improve quality of uname/gethostname/getdomainname 2022-09-03 20:20:40 -07:00
utsname.h Add pthread attributes and other libc functions 2022-09-07 05:28:32 -07:00
vmmeter-meta.internal.h Polyfill sysinfo() a ilttle bit on BSDs 2022-08-18 15:53:11 -07:00
winsize.h Pay off more technical debt 2022-09-12 23:36:56 -07:00
winsize.internal.h Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00