Browse Source

errno: add ENOTEMPTY for rmdir()

pull/2/head
Lephenixnoir 5 months ago
parent
commit
dbfefe5172
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
  1. 33
      include/errno.h
  2. 35
      src/libc/string/strerror.c

33
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
}

35
src/libc/string/strerror.c

@ -2,23 +2,24 @@
#include <errno.h>
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)

Loading…
Cancel
Save