Commit Graph

8 Commits

Author SHA1 Message Date
f83c78bcad libc: Implement gettimeofday() and instantly mark it as deprecated 2022-10-30 20:40:05 +01:00
13fce2c4b3 libc: Update headers with more comments 2022-10-25 19:27:24 +02:00
43073cfdbb Add new __lc_used macro 2022-10-21 18:39:46 +02:00
3e2bebf0aa libc: Alias __lc_unreachable to __builtin_unreachable 2022-10-15 11:20:20 +02:00
8398b2e2e4 libc: Change bits/macros.h to use a __lc_ prefix for internal macros
That way, we don't pollute user programs with our own 'noreturn' and 'deprecated' macros
2022-10-15 09:52:37 +02:00
71e15e94af Kernel, libc and userspace: Add basic errno support.
Kernel: Add an errno.h header with definitions for each header,
and return those, negated, from syscalls when there is an error.
mmap() returns an invalid address with errno encoded, instead of
returning a negated errno; this address is encoded as ffffffffffffffEE
where EE is errno in hex.

libc: make syscall() return -1 and set errno on error, instead of
returning the raw return value of the system call. Also, add mmap()
and munmap() wrappers in sys/mman.h :).

userspace: make the memeater program show the value of errno
when allocating memory fails.

Things to improve: add perror() and strerror() to make the errno
experience even better! >.<
2022-10-08 12:06:09 +02:00
ad115e9bab libc: Correct include guards 2022-10-08 11:32:01 +02:00
560b0a1705 libc: Rename the _ folder to bits, as used internally by libraries 2022-10-04 19:11:54 +02:00