Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
OpenBSD: Add OpenBSD definitions to core.stdc
Browse files Browse the repository at this point in the history
Add OpenBSD definitions to core.stdc.
  • Loading branch information
redstar committed Jul 5, 2016
1 parent 25d6a9e commit c91a477
Show file tree
Hide file tree
Showing 11 changed files with 1,389 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/stdc/config.d
Expand Up @@ -125,6 +125,8 @@ else version( DigitalMars )
alias real c_long_double;
else version( FreeBSD )
alias real c_long_double;
else version( OpenBSD )
alias real c_long_double;
else version( Solaris )
alias real c_long_double;
else version( Darwin )
Expand Down
96 changes: 96 additions & 0 deletions src/core/stdc/errno.d
Expand Up @@ -1110,6 +1110,102 @@ else version( FreeBSD )
enum EPROTO = 92; /// Protocol error
enum ELAST = 92; /// Must be equal largest errno
}
else version( OpenBSD )
{
enum EPERM = 1; /// Operation not permitted
enum ENOENT = 2; /// No such file or directory
enum ESRCH = 3; /// No such process
enum EINTR = 4; /// Interrupted system call
enum EIO = 5; /// Input/output error
enum ENXIO = 6; /// Device not configured
enum E2BIG = 7; /// Argument list too long
enum ENOEXEC = 8; /// Exec format error
enum EBADF = 9; /// Bad file descriptor
enum ECHILD = 10; /// No child processes
enum EDEADLK = 11; /// Resource deadlock avoided
enum ENOMEM = 12; /// Cannot allocate memory
enum EACCES = 13; /// Permission denied
enum EFAULT = 14; /// Bad address
enum ENOTBLK = 15; /// Block device required
enum EBUSY = 16; /// Device busy
enum EEXIST = 17; /// File exists
enum EXDEV = 18; /// Cross-device link
enum ENODEV = 19; /// Operation not supported by device
enum ENOTDIR = 20; /// Not a directory
enum EISDIR = 21; /// Is a directory
enum EINVAL = 22; /// Invalid argument
enum ENFILE = 23; /// Too many open files in system
enum EMFILE = 24; /// Too many open files
enum ENOTTY = 25; /// Inappropriate ioctl for device
enum ETXTBSY = 26; /// Text file busy
enum EFBIG = 27; /// File too large
enum ENOSPC = 28; /// No space left on device
enum ESPIPE = 29; /// Illegal seek
enum EROFS = 30; /// Read-only file system
enum EMLINK = 31; /// Too many links
enum EPIPE = 32; /// Broken pipe
enum EDOM = 33; /// Numerical argument out of domain
enum ERANGE = 34; /// Result too large
enum EAGAIN = 35; /// Resource temporarily unavailable
enum EWOULDBLOCK = EAGAIN; /// Operation would block
enum EINPROGRESS = 36; /// Operation now in progress
enum EALREADY = 37; /// Operation already in progress
enum ENOTSOCK = 38; /// Socket operation on non-socket
enum EDESTADDRREQ = 39; /// Destination address required
enum EMSGSIZE = 40; /// Message too long
enum EPROTOTYPE = 41; /// Protocol wrong type for socket
enum ENOPROTOOPT = 42; /// Protocol not available
enum EPROTONOSUPPORT = 43; /// Protocol not supported
enum ESOCKTNOSUPPORT = 44; /// Socket type not supported
enum EOPNOTSUPP = 45; /// Operation not supported
enum EPFNOSUPPORT = 46; /// Protocol family not supported
enum EAFNOSUPPORT = 47; /// Address family not supported by protocol family
enum EADDRINUSE = 48; /// Address already in use
enum EADDRNOTAVAIL = 49; /// Can't assign requested address
enum ENETDOWN = 50; /// Network is down
enum ENETUNREACH = 51; /// Network is unreachable
enum ENETRESET = 52; /// Network dropped connection on reset
enum ECONNABORTED = 53; /// Software caused connection abort
enum ECONNRESET = 54; /// Connection reset by peer
enum ENOBUFS = 55; /// No buffer space available
enum EISCONN = 56; /// Socket is already connected
enum ENOTCONN = 57; /// Socket is not connected
enum ESHUTDOWN = 58; /// Can't send after socket shutdown
enum ETOOMANYREFS = 59; /// Too many references: can't splice
enum ETIMEDOUT = 60; /// Operation timed out
enum ECONNREFUSED = 61; /// Connection refused
enum ELOOP = 62; /// Too many levels of symbolic links
enum ENAMETOOLONG = 63; /// File name too long
enum EHOSTDOWN = 64; /// Host is down
enum EHOSTUNREACH = 65; /// No route to host
enum ENOTEMPTY = 66; /// Directory not empty
enum EPROCLIM = 67; /// Too many processes
enum EUSERS = 68; /// Too many users
enum EDQUOT = 69; /// Disk quota exceeded
enum ESTALE = 70; /// Stale NFS file handle
enum EREMOTE = 71; /// Too many levels of remote in path
enum EBADRPC = 72; /// RPC struct is bad
enum ERPCMISMATCH = 73; /// RPC version wrong
enum EPROGUNAVAIL = 74; /// RPC program not available
enum EPROGMISMATCH = 75; /// Program version wrong
enum EPROCUNAVAIL = 76; /// Bad procedure for program
enum ENOLCK = 77; /// No locks available
enum ENOSYS = 78; /// Function not implemented
enum EFTYPE = 79; /// Inappropriate file type or format
enum EAUTH = 80; /// Authentication error
enum ENEEDAUTH = 81; /// Need authenticator
enum EIPSEC = 82; /// IPsec processing failure
enum ENOATTR = 83; /// Attribute not found
enum EILSEQ = 84; /// Illegal byte sequence
enum ENOMEDIUM = 85; /// No medium found
enum EMEDIUMTYPE = 86; /// Wrong medium type
enum EOVERFLOW = 87; /// Value too large to be stored in data type
enum ECANCELED = 88; /// Operation canceled
enum EIDRM = 89; /// Identifier removed
enum ENOMSG = 90; /// No message of desired type
enum ENOTSUP = 91; /// Not supported
enum ELAST = 91; /// Must be equal largest errno
}
else version (Solaris)
{
enum EPERM = 1 /** Not super-user */;
Expand Down
22 changes: 22 additions & 0 deletions src/core/stdc/fenv.d
Expand Up @@ -196,6 +196,22 @@ else version ( FreeBSD )

alias ushort fexcept_t;
}
else version ( OpenBSD )
{
struct fenv_t
{
struct __x87
{
uint __control;
uint __status;
uint __tag;
uint[4] __others;
}
}
uint __mxcsr;

alias fexcept_t = uint;
}
else version( CRuntime_Bionic )
{
version(X86)
Expand Down Expand Up @@ -310,6 +326,12 @@ else version( FreeBSD )
///
enum FE_DFL_ENV = &__fe_dfl_env;
}
else version( OpenBSD )
{
private extern const fenv_t __fe_dfl_env;
///
enum FE_DFL_ENV = &__fe_dfl_env;
}
else version( CRuntime_Bionic )
{
private extern const fenv_t __fe_dfl_env;
Expand Down
17 changes: 17 additions & 0 deletions src/core/stdc/locale.d
Expand Up @@ -135,6 +135,23 @@ else version(FreeBSD)
///
enum LC_MESSAGES = 6;
}
else version(OpenBSD)
{
///
enum LC_ALL = 0;
///
enum LC_COLLATE = 1;
///
enum LC_CTYPE = 2;
///
enum LC_MONETARY = 3;
///
enum LC_NUMERIC = 4;
///
enum LC_TIME = 5;
///
enum LC_MESSAGES = 6;
}
else version(CRuntime_Bionic)
{
enum
Expand Down

0 comments on commit c91a477

Please sign in to comment.