From dbfefe51727544e0e791a1cd9785716af181a169 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Thu, 30 Dec 2021 18:18:54 +0100 Subject: [PATCH] errno: add ENOTEMPTY for rmdir() --- include/errno.h | 33 +++++++++++++++++---------------- src/libc/string/strerror.c | 35 ++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/include/errno.h b/include/errno.h index 7941df6..c78dc0e 100644 --- a/include/errno.h +++ b/include/errno.h @@ -9,22 +9,23 @@ extern "C" { threads are supported. */ extern int errno; -#define EDOM 1 /* Outside of domain of math function. */ -#define EILSEQ 2 /* Illegal multi-byte character sequence. */ -#define ERANGE 3 /* Range error during text-to-numeric conversion. */ -#define EACCES 4 /* File access denied. */ -#define EEXIST 5 /* File already exists. */ -#define EINVAL 6 /* Invalid argument in general; lots of uses. */ -#define ENFILE 7 /* Out of file descriptors. */ -#define ENOENT 8 /* File or folder does not exist. */ -#define ENOMEM 9 /* System ran out of memory (RAM). */ -#define EDQUOT 10 /* Out of inodes or memory space. */ -#define ENOSPC 11 /* No space left on device. */ -#define ENOTSUP 12 /* Operation not supported. */ -#define EBADF 13 /* Invalid file descriptor. */ -#define ESPIPE 14 /* File descriptor is unable to seek. */ -#define EISDIR 15 /* File descriptor is a directory. */ -#define ENOTDIR 16 /* File descriptor is not a directory. */ +#define EDOM 1 /* Outside of domain of math function. */ +#define EILSEQ 2 /* Illegal multi-byte character sequence. */ +#define ERANGE 3 /* Range error during text-to-numeric conversion. */ +#define EACCES 4 /* File access denied. */ +#define EEXIST 5 /* File already exists. */ +#define EINVAL 6 /* Invalid argument in general; lots of uses. */ +#define ENFILE 7 /* Out of file descriptors. */ +#define ENOENT 8 /* File or folder does not exist. */ +#define ENOMEM 9 /* System ran out of memory (RAM). */ +#define EDQUOT 10 /* Out of inodes or memory space. */ +#define ENOSPC 11 /* No space left on device. */ +#define ENOTSUP 12 /* Operation not supported. */ +#define EBADF 13 /* Invalid file descriptor. */ +#define ESPIPE 14 /* File descriptor is unable to seek. */ +#define EISDIR 15 /* File descriptor is a directory. */ +#define ENOTDIR 16 /* File descriptor is not a directory. */ +#define ENOTEMPTY 17 /* Directory is not empty. */ #ifdef __cplusplus } diff --git a/src/libc/string/strerror.c b/src/libc/string/strerror.c index 1271e5a..e7315a3 100644 --- a/src/libc/string/strerror.c +++ b/src/libc/string/strerror.c @@ -2,23 +2,24 @@ #include static char *errno_strings [] = { - [0] = "Success", - [EDOM] = "Numerical argument out of domain", - [EILSEQ] = "Invalid or incomplete multibyte or wide character", - [ERANGE] = "Numerical result out of range", - [EACCES] = "Permission denied", - [EEXIST] = "File exists", - [EINVAL] = "Invalid argument", - [ENFILE] = "Too many open files in system", - [ENOENT] = "No such file or directory", - [ENOMEM] = "Cannot allocate memory", - [EDQUOT] = "Disk quota exceeded", - [ENOSPC] = "No space left on device", - [ENOTSUP] = "Operation not supported", - [EBADF] = "Bad file descriptor", - [ESPIPE] = "Illegal seek", - [EISDIR] = "Is a directory", - [ENOTDIR] = "Not a directory", + [0] = "Success", + [EDOM] = "Numerical argument out of domain", + [EILSEQ] = "Invalid or incomplete multibyte or wide character", + [ERANGE] = "Numerical result out of range", + [EACCES] = "Permission denied", + [EEXIST] = "File exists", + [EINVAL] = "Invalid argument", + [ENFILE] = "Too many open files in system", + [ENOENT] = "No such file or directory", + [ENOMEM] = "Cannot allocate memory", + [EDQUOT] = "Disk quota exceeded", + [ENOSPC] = "No space left on device", + [ENOTSUP] = "Operation not supported", + [EBADF] = "Bad file descriptor", + [ESPIPE] = "Illegal seek", + [EISDIR] = "Is a directory", + [ENOTDIR] = "Not a directory", + [ENOTEMPTY] = "Directory not empty", }; char *strerror(int e)