sortix-mirror/kernel/include/sortix/kernel
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
..
addralloc.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
clock.h Make interrupt work thread reliable. 2017-04-12 23:22:09 +02:00
copy.h Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
cpu.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
cpuid.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
decl.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
descriptor.h Fix SEEK_END, file offset overflow, and read/write/mkpartition syscall bugs. 2017-12-04 23:56:46 +01:00
dtable.h Add file descriptor table reservations. 2021-12-31 22:24:07 +01:00
elf.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
fcache.h Move readv/writev family and sendmsg/recvmsg into drivers. 2017-02-13 22:04:21 +01:00
fsfunc.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
harddisk.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
inode.h Implement getpeername(2) and getsockname(2). 2017-02-26 22:24:35 +01:00
interlock.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
interrupt.h Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
ioctx.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
ioport.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
kernel.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
keyboard.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
kthread.h Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
log.h Refactor graphical resolution changes. 2016-11-27 11:18:48 +01:00
memorymanagement.h Add cache-aware memory mapping functions. 2017-02-19 12:13:32 +01:00
mtable.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
panic.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pat.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
pci-mmio.h Add cache-aware memory mapping functions. 2017-02-19 12:13:32 +01:00
pci.h Add PCI scanning functions and busmastering functions. 2017-02-19 12:10:59 +01:00
pipe.h Move readv/writev family and sendmsg/recvmsg into drivers. 2017-02-13 22:04:21 +01:00
poll.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
process.h Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
ps2.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
ptable.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
random.h Seed kernel entropy with randomness from the previous boot. 2016-10-04 00:34:50 +02:00
refcount.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
registers.h Remove not_rsp and not_esp. 2016-10-30 12:03:47 +00:00
scheduler.h Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
segment.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
signal.h Add signal mask support to ppoll(2). 2018-12-08 22:54:28 +01:00
sockopt.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
sortedlist.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
string.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
textbuffer.h Support 8-bit/24-bit color and more escape codes in the graphical console. 2016-11-27 11:19:03 +01:00
thread.h Implement threading primitives that truly sleep. 2021-06-23 22:10:47 +02:00
time.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
timer.h Fix handling of overflow and non-canonical values in timespec APIs. 2021-06-22 21:48:27 +02:00
user-timer.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
video.h Refactor graphical resolution changes. 2016-11-27 11:18:48 +01:00
vnode.h Implement getpeername(2) and getsockname(2). 2017-02-26 22:24:35 +01:00
worker.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
yielder.h Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00