apio
71e15e94af
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! >.<
8 lines
199 B
C
8 lines
199 B
C
#ifndef _BITS_MACROS_H
|
|
#define _BITS_MACROS_H
|
|
|
|
#define noreturn __attribute__((noreturn))
|
|
#define align(n) __attribute__((aligned(n)))
|
|
#define deprecated(msg) __attribute__((deprecated(msg)))
|
|
|
|
#endif |