Commit Graph

37 Commits

Author SHA1 Message Date
2957206718 LibC: Fix and cleanup stdio mode string parsing
The code is now much cleaner andd we are not as strict with the mode
string. Also add support for new 'e' and 'x' modifiers
2026-07-04 19:13:26 +03:00
fe533c2e62 LibC: Fix freopen to preserve file state :) 2026-05-25 02:14:04 +03:00
ee5c225954 LibC: Add __fseterr
This is used by some ports to not require internal FILE structure
2026-05-25 02:14:04 +03:00
6a2f041858 LibC: Handle negative size in fgets 2026-05-15 17:03:33 +03:00
32806a5af3 LibC: Allow "t" in stdio mode 2026-04-02 15:44:50 +03:00
0299d4d44e Kernel/LibC: remove SYS_TERMID
This syscall is not needed. /dev/tty is already a symlink to the
controlling terminal. Also this syscall did not handle pseudo terminals
2026-01-16 15:57:36 +02:00
a00695bdac LibC: Add stubs that I have locally
I'm not sure if these are used by anything but I would assume so as I
have added them :D

functions added:
- getprotobyname
- open_memstream
- munlock
- lockf
- nice
- crypt
- getsid
- wcstoul
2026-01-06 21:58:56 +02:00
4ec8f4a4bf Kernel/LibC: Implement rename{,at} 2025-11-22 23:55:10 +02:00
9854691265 LibC: Don't leak fds on rename 2025-08-28 15:55:40 +03:00
32afa33a06 LibC: Make sure FILE's buffer does not get overflown 2025-08-28 15:55:40 +03:00
c6946d0145 LibC: Use pthread_mutex on FILE instead of atomics 2025-08-28 15:55:40 +03:00
46dd411273 LibC: fflush stdout when reading from stdin
This is the *intended behaviour* per ISO C specification
2025-08-05 03:32:59 +03:00
8aff315c7b LibC: fflush file in setvbuf before updating the buffer 2025-07-02 01:54:03 +03:00
ff289b25b6 LibC: Implement {,v}asprintf
These were added in POSIX issue 8
2025-06-17 13:56:30 +03:00
6beaafcf11 LibC: Define std{in,out,err,dbg} with their actual names 2025-06-06 11:56:39 +03:00
5d80c880c8 LibC: Fix FILE buffering once again :D 2025-05-28 03:10:01 +03:00
b907263f35 LibC: Implement basic tmpfile 2025-05-28 03:10:01 +03:00
f14774d034 libc: fix tmpnam when no name is found 2025-05-05 19:17:16 +03:00
12d47858c1 LibC: Fix overflow error in fread and fwrite 2025-04-19 18:42:12 +03:00
3721dadd72 LibC: Make stdio and malloc initialization constructors 2025-04-15 22:01:57 +03:00
b9cc6063ff LibC: Implement stdio FILE locking 2025-04-02 12:58:39 +03:00
04463675c0 LibC: Lock file during gets 2025-04-01 23:26:13 +03:00
b9da6a4a5d LibC: Implement getdelim and getline 2025-04-01 23:26:13 +03:00
766b8cd62e LibC: Fix stdio FILE operations
Mixing read/write/ungetc was broken. This mostly fixes everything. There
might still be some problems that have to be fixed
2025-01-16 14:57:58 +02:00
1903079f96 LibC: Fix popen to return correct return value instead of -1 2024-12-05 06:47:10 +02:00
79e2c5d48c LibC: Make FILE* reading buffered
There was no reason to perform a syscall for every byte read
2024-12-03 16:13:48 +02:00
04f49a6819 LibC: Implement {,v}dprintf 2024-11-27 21:33:10 +02:00
2464fccadd LibC: Fix *scanf consuming extra characters 2024-10-19 12:43:23 +03:00
2c520391eb Kernel/LibC: Add support for init_array and fini_array 2024-08-27 00:47:03 +03:00
25a47f0df3 LibC: Implement ungetc()
I didn't really test this, but I think this implementation does what it
needs to :)
2024-08-12 19:14:55 +03:00
6cda639869 LibC: Add stubs for tmpfile, mktemp and fchmod 2024-08-09 17:02:49 +03:00
46b1d4d194 LibC: Remove cxx abi stuff from libc
These will cause multiple definitions when linking with libstdc++
2024-08-09 16:58:11 +03:00
fe94d6cf89 LibC: Implement dummy rename() so vim can save files
vim calls rename when saving a file. This patch adds dummy
implementation that only works for regular files and does a copy instead
of proper rename.
2024-08-05 20:16:05 +03:00
4d96ae56ac LibC: Add stubs for ungetc(), tcflush() and symlink() 2024-08-05 01:48:24 +03:00
401b460d75 LibC: Implement setbuf() and setvbuf() 2024-08-01 01:30:00 +03:00
e52dac3b25 LibC: Implement tmpnam()
This implementation is not really spec compliant as rand() does not
guarantee TMP_MAX different outputs + seeding
2024-07-30 12:02:30 +03:00
c69919738b BuildSystem: Move all userpace libraries under the userspace directory
As the number of libraries is increasing, root directory starts to
expand. This adds better organization for libraries
2024-06-18 13:14:35 +03:00