42964ad0b4
Kernel: Remove concept of OpenFile
...
This was just RefPtr<OpenFileDescription> and descriptor flags.
Descriptor flags only define O_CLOEXEC, so we can just store fd's
cloexec status in a bitmap rather than separate fields. This cuts down
the size of OpenFileDescriptorSet to basically half!
2026-04-12 04:42:08 +03:00
7b580b8f56
Kernel: Implement fd passing with SCM_RIGTHS
2025-11-12 00:06:36 +02:00
72982e3c2b
Kernel/LibC: Take fcntl extra field as uintptr_t
...
This allows passing pointers to fcntl
2025-11-10 01:40:33 +02:00
04d24bce70
Kernel/LibC: Implement {recv,send}msg as syscalls
...
This also removes the now old recvfrom and sendto syscalls. These are
now implemented as wrappers around recvmsg and sendmsg.
Also replace unnecessary spinlocks from unix socket with mutexes
2025-11-10 01:40:33 +02:00
7367672570
Kernel: Default initialize flock as unlocked
...
This caused unlocked flock's to hang on lock
2025-11-02 21:10:13 +02:00
93e5d09a63
Kernel/LibC: Implement flock
2025-06-28 16:55:13 +03:00
89c9bfd052
Kernel/LibC: Implement socketpair for UNIX sockets
2025-05-28 03:10:01 +03:00
c790bad667
Kernel: Make OpenFileDescriptorSet thread safe
...
Also this allows concurrent calling of read/write/send/recv
2025-04-22 04:31:18 +03:00
15045cc486
Kernel: Make nonblocking sockets unblocking :)
2025-04-05 18:42:02 +03:00
ee078fc638
Kernel: Fix fd status/descriptor flag handling
...
I was not sharing status and offset on fork and I was sharing descriptor
flags on dup/dup2
2025-01-17 20:12:04 +02:00
9893c90e74
Kernel: Remove SYS_DUP and implement it using fcntl F_DUPFD
2025-01-17 19:29:47 +02:00
8956835d95
Kernel: Make sys_.*at use VFS relative path finding
2024-09-14 21:15:58 +03:00
ea4ec2eafc
Kernel: Make OpenFileDescrptor store VFS::File instead of inode+path
2024-09-14 20:10:21 +03:00
d20752c318
Kernel: Make OpenFileDescritorSet::open take rvalue
...
This gets rid of some implicit allocations from copy constructors
2024-08-28 16:36:10 +03:00
838d31fa41
Kernel: Implement more POSIX compliant open() and openat() syscalls
2024-08-01 15:35:02 +03:00
18e2559b1e
Kernel/LibC: Add SYS_TRUNCATE
2024-05-28 01:08:04 +03:00
83e3409bd8
Kernel/LibC: Update SYS_SEEK to return new offset and implement lseek
2024-05-23 14:49:23 +03:00
0af74fccda
Kernel/LibC: Rework dirent structure
...
dirent now contains statically sized d_name. This allows using
sizeof on the name and dirent properly, which some programs seem
to be using.
2024-05-22 20:19:59 +03:00
e7dd03e551
Kernel: Implement basic connection-mode unix domain sockets
2024-02-08 02:28:19 +02:00
cf28ecd5a6
Kernel/LibC: Add SYS_SOCKET
2024-02-01 23:39:09 +02:00
dfe5a2d665
All: Cleanup all files
...
Add newline to end of files and remove whitespace from end of lines
2024-01-24 15:53:38 +02:00
f3d9da9549
Kernel: Rewrite all read/write functions to use BAN::ByteSpan
...
This allows us to not work with raw pointers and use sized containers
for reading and writing.
2023-10-24 11:56:00 +03:00
7b1c573ad0
Kernel: Implement MAP_PRIVATE file mappings
...
mmap() now supports mapping files with MAP_PRIVATE.
2023-09-29 17:23:42 +03:00
39a5c52088
Kernel: Fix directory permissions
...
We did not care about X bit in directories and instead used only the
R bit for search/read.
2023-09-08 11:46:53 +03:00
6f002c926a
Kernel: add basic fcntl() with couple of commands and no validation
2023-09-04 12:57:09 +03:00
79f3aa5419
Kernel/LibC: add dup() syscall and function
2023-08-17 12:03:29 +03:00
a2bf474013
Kernel: OpenFileDesctiptor can now return inode of fd
2023-07-23 18:52:33 +03:00
5d2bfc858e
Kernel: SYS_FORK can now fail instead of panicing on error
2023-07-19 17:47:12 +03:00
0910958c04
Kernel: OpenFileDescriptors can now store more than 8 bits of flags
2023-07-10 16:06:36 +03:00
a2f5ad7bed
Kernel: Move open file descriptors to their own class
...
This simplifies code a lot :)
2023-07-07 23:11:37 +03:00