The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
errno.h File Reference

Go to the source code of this file.

Macros

#define ENOSYS   1
 posix-compatible errno constants for ginnOS userspace.
#define EBADF   2
#define EINVAL   3
#define ENOMEM   4
#define ENOENT   5
#define EACCES   6
#define EPIPE   7
#define ESPIPE   8
#define EEXIST   9
#define EISDIR   10
#define ENOTDIR   11
#define EMFILE   12
#define ENFILE   13
#define EIO   14
#define ENOSPC   15
#define EBUSY   16
#define ERANGE   17
#define EFAULT   18
#define ESRCH   19
#define ECHILD   20
#define ENOBUFS   21
#define ENOTTY   22
#define ENODEV   23
#define EINTR   24
#define EAGAIN   25
#define E2BIG   26
#define ENOEXEC   27
#define ENOTEMPTY   28
#define EXDEV   29
#define ENAMETOOLONG   30
#define EPERM   31
#define ELOOP   32
#define EROFS   33
#define ETIMEDOUT   34
#define ENOTSOCK   35
#define EADDRINUSE   36
#define ECONNREFUSED   37
#define EISCONN   38
#define ENOTCONN   39
#define EAFNOSUPPORT   40
#define EPROTONOSUPPORT   41
#define EOPNOTSUPP   42
#define ECANCELED   43
#define EILSEQ   44
#define EMLINK   45
#define EFBIG   46
#define ENOLCK   47
#define ENXIO   48
#define EDEADLK   49
#define EOVERFLOW   50
#define EADDRNOTAVAIL   51
#define EDESTADDRREQ   52
#define EMSGSIZE   53
#define ENETUNREACH   54
#define EHOSTUNREACH   55
#define ENOPROTOOPT   56
#define EPROTOTYPE   57
#define ECONNRESET   58
#define ECONNABORTED   59
#define EINPROGRESS   60
#define EALREADY   61
#define ENETDOWN   62
#define EPROTO   63
#define ENOTSUP   EOPNOTSUPP
#define EWOULDBLOCK   EAGAIN
#define errno   (*__errno_location())

Functions

int * __errno_location (void)
 the calling thread's errno.
void perror (const char *s)
 print a message followed by the string for the current errno.
const char * strerror (int errnum)
 return a string describing the given error number.

Macro Definition Documentation

◆ ENOSYS

#define ENOSYS   1

posix-compatible errno constants for ginnOS userspace.

the numbers are ABI: src/kernel/errno.h has the same ones.

syscalls return negative errno values on failure. the libc wrappers extract the error, store it in errno (one for each thread), and return -1 (or NULL, etc.) to the caller.

◆ EBADF

#define EBADF   2

◆ EINVAL

#define EINVAL   3

◆ ENOMEM

#define ENOMEM   4

◆ ENOENT

#define ENOENT   5

◆ EACCES

#define EACCES   6

◆ EPIPE

#define EPIPE   7

◆ ESPIPE

#define ESPIPE   8

◆ EEXIST

#define EEXIST   9

◆ EISDIR

#define EISDIR   10

◆ ENOTDIR

#define ENOTDIR   11

◆ EMFILE

#define EMFILE   12

◆ ENFILE

#define ENFILE   13

◆ EIO

#define EIO   14

◆ ENOSPC

#define ENOSPC   15

◆ EBUSY

#define EBUSY   16

◆ ERANGE

#define ERANGE   17

◆ EFAULT

#define EFAULT   18

◆ ESRCH

#define ESRCH   19

◆ ECHILD

#define ECHILD   20

◆ ENOBUFS

#define ENOBUFS   21

◆ ENOTTY

#define ENOTTY   22

◆ ENODEV

#define ENODEV   23

◆ EINTR

#define EINTR   24

◆ EAGAIN

#define EAGAIN   25

◆ E2BIG

#define E2BIG   26

◆ ENOEXEC

#define ENOEXEC   27

◆ ENOTEMPTY

#define ENOTEMPTY   28

◆ EXDEV

#define EXDEV   29

◆ ENAMETOOLONG

#define ENAMETOOLONG   30

◆ EPERM

#define EPERM   31

◆ ELOOP

#define ELOOP   32

◆ EROFS

#define EROFS   33

◆ ETIMEDOUT

#define ETIMEDOUT   34

◆ ENOTSOCK

#define ENOTSOCK   35

◆ EADDRINUSE

#define EADDRINUSE   36

◆ ECONNREFUSED

#define ECONNREFUSED   37

◆ EISCONN

#define EISCONN   38

◆ ENOTCONN

#define ENOTCONN   39

◆ EAFNOSUPPORT

#define EAFNOSUPPORT   40

◆ EPROTONOSUPPORT

#define EPROTONOSUPPORT   41

◆ EOPNOTSUPP

#define EOPNOTSUPP   42

◆ ECANCELED

#define ECANCELED   43

◆ EILSEQ

#define EILSEQ   44

◆ EMLINK

#define EMLINK   45

◆ EFBIG

#define EFBIG   46

◆ ENOLCK

#define ENOLCK   47

◆ ENXIO

#define ENXIO   48

◆ EDEADLK

#define EDEADLK   49

◆ EOVERFLOW

#define EOVERFLOW   50

◆ EADDRNOTAVAIL

#define EADDRNOTAVAIL   51

◆ EDESTADDRREQ

#define EDESTADDRREQ   52

◆ EMSGSIZE

#define EMSGSIZE   53

◆ ENETUNREACH

#define ENETUNREACH   54

◆ EHOSTUNREACH

#define EHOSTUNREACH   55

◆ ENOPROTOOPT

#define ENOPROTOOPT   56

◆ EPROTOTYPE

#define EPROTOTYPE   57

◆ ECONNRESET

#define ECONNRESET   58

◆ ECONNABORTED

#define ECONNABORTED   59

◆ EINPROGRESS

#define EINPROGRESS   60

◆ EALREADY

#define EALREADY   61

◆ ENETDOWN

#define ENETDOWN   62

◆ EPROTO

#define EPROTO   63

◆ ENOTSUP

#define ENOTSUP   EOPNOTSUPP

◆ EWOULDBLOCK

#define EWOULDBLOCK   EAGAIN

◆ errno

#define errno   (*__errno_location())

Function Documentation

◆ __errno_location()

int * __errno_location ( void )

the calling thread's errno.

each thread has its own (thread-local storage), as the functions of one thread must not see the errors of another.

Returns
the address of the errno of the calling thread.

◆ perror()

void perror ( const char * s)

print a message followed by the string for the current errno.

Parameters
sprefix string (may be NULL).

◆ strerror()

const char * strerror ( int errnum)

return a string describing the given error number.

Parameters
errnumerror number (one of the E* constants above).
Returns
pointer to a static string.