mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Update <errno.h> to current coding conventions.
This commit is contained in:
parent
ad1c6e0ed7
commit
69eb2f0e5f
3 changed files with 88 additions and 99 deletions
|
@ -1,14 +0,0 @@
|
||||||
#ifndef _ERRNO_DECL
|
|
||||||
#define _ERRNO_DECL
|
|
||||||
|
|
||||||
/* Returns the address of the errno variable for this thread. */
|
|
||||||
extern int* get_errno_location(void);
|
|
||||||
|
|
||||||
/* get_errno_location will forward the request to a user-specified function if
|
|
||||||
specified, or if NULL, will return the global thread-shared errno value. */
|
|
||||||
typedef int* (*errno_location_func_t)(void);
|
|
||||||
extern void set_errno_location_func(errno_location_func_t func);
|
|
||||||
|
|
||||||
#define errno (*get_errno_location())
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,80 +0,0 @@
|
||||||
#ifndef _ERRNO_VALUES_DECL
|
|
||||||
#define _ERRNO_VALUES_DECL
|
|
||||||
|
|
||||||
#define ENOTBLK 12
|
|
||||||
#define ENODEV 13
|
|
||||||
#define EWOULDBLOCK 14
|
|
||||||
#define EBADF 15
|
|
||||||
#define EOVERFLOW 16
|
|
||||||
#define ENOENT 17
|
|
||||||
#define ENOSPC 18
|
|
||||||
#define EEXIST 19
|
|
||||||
#define EROFS 20
|
|
||||||
#define EINVAL 21
|
|
||||||
#define ENOTDIR 22
|
|
||||||
#define ENOMEM 23
|
|
||||||
#define ERANGE 24
|
|
||||||
#define EISDIR 25
|
|
||||||
#define EPERM 26
|
|
||||||
#define EIO 27
|
|
||||||
#define ENOEXEC 28
|
|
||||||
#define EACCES 29
|
|
||||||
#define ESRCH 30
|
|
||||||
#define ENOTTY 31
|
|
||||||
#define ECHILD 32
|
|
||||||
#define ENOSYS 33
|
|
||||||
#define ENOTSUP 34
|
|
||||||
#define EBLOCKING 35
|
|
||||||
#define EINTR 36
|
|
||||||
#define ENOTEMPTY 37
|
|
||||||
#define EBUSY 38
|
|
||||||
#define EPIPE 39
|
|
||||||
#define EILSEQ 40
|
|
||||||
#define ELAKE 41
|
|
||||||
#define EMFILE 42
|
|
||||||
#define EAGAIN 43
|
|
||||||
#define EEOF 44
|
|
||||||
#define EBOUND 45
|
|
||||||
#define EINIT 46
|
|
||||||
#define ENODRV 47
|
|
||||||
#define E2BIG 48
|
|
||||||
#define EFBIG 49
|
|
||||||
#define EXDEV 50
|
|
||||||
#define ESPIPE 51
|
|
||||||
#define ENAMETOOLONG 52
|
|
||||||
#define ELOOP 53
|
|
||||||
#define EMLINK 54
|
|
||||||
#define ENXIO 55
|
|
||||||
#define EPROTONOSUPPORT 56
|
|
||||||
#define EAFNOSUPPORT 57
|
|
||||||
#define ENOTSOCK 58
|
|
||||||
#define EADDRINUSE 59
|
|
||||||
#define ETIMEDOUT 60
|
|
||||||
#define ECONNREFUSED 61
|
|
||||||
#define EDOM 62
|
|
||||||
#define EINPROGRESS 63
|
|
||||||
#define EALREADY 64
|
|
||||||
#define ESHUTDOWN 65
|
|
||||||
#define ECONNABORTED 66
|
|
||||||
#define ECONNRESET 67
|
|
||||||
#define EADDRNOTAVAIL 68
|
|
||||||
#define EISCONN 69
|
|
||||||
#define EFAULT 70
|
|
||||||
#define EDESTADDRREQ 71
|
|
||||||
#define EHOSTUNREACH 72
|
|
||||||
#define EMSGSIZE 73
|
|
||||||
#define ENETDOWN 74
|
|
||||||
#define ENETRESET 75
|
|
||||||
#define ENETUNREACH 76
|
|
||||||
#define ENOBUFS 77
|
|
||||||
#define ENOMSG 78
|
|
||||||
#define ENOPROTOOPT 79
|
|
||||||
#define ENOTCONN 80
|
|
||||||
#define EDEADLK 81
|
|
||||||
#define ENFILE 82
|
|
||||||
#define EPROTOTYPE 83
|
|
||||||
#define ENOLCK 84
|
|
||||||
|
|
||||||
#define EOPNOTSUPP ENOTSUP
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
||||||
Copyright(C) Jonas 'Sortie' Termansen 2011.
|
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013.
|
||||||
|
|
||||||
This file is part of the Sortix C Library.
|
This file is part of the Sortix C Library.
|
||||||
|
|
||||||
|
@ -22,15 +22,98 @@
|
||||||
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
#ifndef _ERRNO_H
|
#ifndef INCLUDE_ERRNO_H
|
||||||
#define _ERRNO_H 1
|
#define INCLUDE_ERRNO_H
|
||||||
|
|
||||||
#include <features.h>
|
#include <features.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
@include(errno_decl.h)
|
#define ENOTBLK 12
|
||||||
@include(errno_values.h)
|
#define ENODEV 13
|
||||||
|
#define EWOULDBLOCK 14
|
||||||
|
#define EBADF 15
|
||||||
|
#define EOVERFLOW 16
|
||||||
|
#define ENOENT 17
|
||||||
|
#define ENOSPC 18
|
||||||
|
#define EEXIST 19
|
||||||
|
#define EROFS 20
|
||||||
|
#define EINVAL 21
|
||||||
|
#define ENOTDIR 22
|
||||||
|
#define ENOMEM 23
|
||||||
|
#define ERANGE 24
|
||||||
|
#define EISDIR 25
|
||||||
|
#define EPERM 26
|
||||||
|
#define EIO 27
|
||||||
|
#define ENOEXEC 28
|
||||||
|
#define EACCES 29
|
||||||
|
#define ESRCH 30
|
||||||
|
#define ENOTTY 31
|
||||||
|
#define ECHILD 32
|
||||||
|
#define ENOSYS 33
|
||||||
|
#define ENOTSUP 34
|
||||||
|
#define EBLOCKING 35
|
||||||
|
#define EINTR 36
|
||||||
|
#define ENOTEMPTY 37
|
||||||
|
#define EBUSY 38
|
||||||
|
#define EPIPE 39
|
||||||
|
#define EILSEQ 40
|
||||||
|
#define ELAKE 41
|
||||||
|
#define EMFILE 42
|
||||||
|
#define EAGAIN 43
|
||||||
|
#define EEOF 44
|
||||||
|
#define EBOUND 45
|
||||||
|
#define EINIT 46
|
||||||
|
#define ENODRV 47
|
||||||
|
#define E2BIG 48
|
||||||
|
#define EFBIG 49
|
||||||
|
#define EXDEV 50
|
||||||
|
#define ESPIPE 51
|
||||||
|
#define ENAMETOOLONG 52
|
||||||
|
#define ELOOP 53
|
||||||
|
#define EMLINK 54
|
||||||
|
#define ENXIO 55
|
||||||
|
#define EPROTONOSUPPORT 56
|
||||||
|
#define EAFNOSUPPORT 57
|
||||||
|
#define ENOTSOCK 58
|
||||||
|
#define EADDRINUSE 59
|
||||||
|
#define ETIMEDOUT 60
|
||||||
|
#define ECONNREFUSED 61
|
||||||
|
#define EDOM 62
|
||||||
|
#define EINPROGRESS 63
|
||||||
|
#define EALREADY 64
|
||||||
|
#define ESHUTDOWN 65
|
||||||
|
#define ECONNABORTED 66
|
||||||
|
#define ECONNRESET 67
|
||||||
|
#define EADDRNOTAVAIL 68
|
||||||
|
#define EISCONN 69
|
||||||
|
#define EFAULT 70
|
||||||
|
#define EDESTADDRREQ 71
|
||||||
|
#define EHOSTUNREACH 72
|
||||||
|
#define EMSGSIZE 73
|
||||||
|
#define ENETDOWN 74
|
||||||
|
#define ENETRESET 75
|
||||||
|
#define ENETUNREACH 76
|
||||||
|
#define ENOBUFS 77
|
||||||
|
#define ENOMSG 78
|
||||||
|
#define ENOPROTOOPT 79
|
||||||
|
#define ENOTCONN 80
|
||||||
|
#define EDEADLK 81
|
||||||
|
#define ENFILE 82
|
||||||
|
#define EPROTOTYPE 83
|
||||||
|
#define ENOLCK 84
|
||||||
|
|
||||||
|
#define EOPNOTSUPP ENOTSUP
|
||||||
|
|
||||||
|
/* Returns the address of the errno variable for this thread. */
|
||||||
|
int* get_errno_location(void);
|
||||||
|
|
||||||
|
/* get_errno_location will forward the request to a user-specified function if
|
||||||
|
specified, or if NULL, will return the global thread-shared errno value. */
|
||||||
|
typedef int* (*errno_location_func_t)(void);
|
||||||
|
void set_errno_location_func(errno_location_func_t func);
|
||||||
|
|
||||||
|
#define errno (*get_errno_location())
|
||||||
|
|
||||||
extern char* program_invocation_name;
|
extern char* program_invocation_name;
|
||||||
extern char* program_invocation_short_name;
|
extern char* program_invocation_short_name;
|
||||||
|
|
Loading…
Add table
Reference in a new issue