sortix-mirror/kernel/include/sortix
Jonas 'Sortie' Termansen b9898086c6 Add file descriptor table reservations.
The file descriptor table now allows reserving room for multiple file
descriptors without assigning their numbers. This functionality means
any error conditions happen up front and the subsequent number
assignment will never fail.

This change uses the new functionality to fix troublesome error handling
when allocating multiple file descriptors. One pty allocation error path
was even wrong.

There were subtle race conditions where one (kernel) thread may have
allocated one file descriptor, and another thread spuciously replaces it
with something else, and then the second file descriptor allocation
failed in the first thread, and it closes the first file descriptor now
pointing to a different file description. This case seems harmless but
it's not a great class of bugs to exist in the first place. The new
behavior means the file descriptions appear in the file descriptor table
without fail and never needs to be cleaned up midway and is certainly
immune to shenangians from other threads.

Reviewed-by: Pedro Falcato <pedro.falcato@gmail.com>
2021-12-31 22:24:07 +01:00
..
__ Fix <fcntl.h> including <sys/stat.h> namespace pollution. 2018-08-06 23:59:34 +02:00
kernel Add file descriptor table reservations. 2021-12-31 22:24:07 +01:00
clock.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
dirent.h Fix <fcntl.h> including <sys/stat.h> namespace pollution. 2018-08-06 23:59:34 +02:00
display.h Fix system headers using C89 incompatible comments. 2017-07-10 13:37:46 +02:00
exit.h Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
fcntl.h Add factory inode support. 2016-11-23 21:46:06 +01:00
fork.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
futex.h Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
initrd.h Fix system headers using C89 incompatible comments. 2017-07-10 13:37:46 +02:00
ioctl.h Detect whether the terminal has a display and a keyboard layout. 2016-11-23 22:31:04 +01:00
itimerspec.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
kblayout.h Fix system headers using C89 incompatible comments. 2017-07-10 13:37:46 +02:00
keycodes.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
limits.h Move readv/writev family and sendmsg/recvmsg into drivers. 2017-02-13 22:04:21 +01:00
mman.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
mode.h Fix <fcntl.h> including <sys/stat.h> namespace pollution. 2018-08-06 23:59:34 +02:00
mount.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
poll.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
ps2mouse.h Add header for working with the PS/2 mouse protocol. 2021-12-12 20:34:07 +02:00
psctl.h Add support for sessions. 2016-11-23 22:30:47 +01:00
resource.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
seek.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
sigaction.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
sigevent.h Compile libc with -ffreestanding. 2016-05-15 22:43:29 +02:00
siginfo.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
signal.h Fix <signal.h> namespace pollution for strict C. 2017-08-20 12:44:33 +02:00
sigprocmask.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
sigset.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
sigval.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
socket.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
stack.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
stat.h Fix <fcntl.h> including <sys/stat.h> namespace pollution. 2018-08-06 23:59:34 +02:00
statvfs.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
syscall.h Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
tar.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
termios.h Add ONLCR and OCRNL. 2016-11-05 23:38:40 +01:00
termmode.h Add ONLCR and OCRNL. 2016-11-05 23:38:40 +01:00
time.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
timespec.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
tmns.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
types.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
ucontext.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
uio.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
unistd.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
uthread.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
vga.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
wait.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
winsize.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00