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! >.<
10 lines
113 B
C
10 lines
113 B
C
#ifndef _ERRNO_H
|
|
#define _ERRNO_H
|
|
|
|
extern int errno;
|
|
|
|
#define EPERM 1
|
|
#define ENOMEM 12
|
|
#define EINVAL 22
|
|
|
|
#endif |