SysBasic

Usage

use SysBasic;

or

import SysBasic;

Types for low-level system error integration.

This module defines the error types syserr and qio_err_t.

When should one use syserr and when should one use qio_err_t? qio_err_t is a system error code (a c_int by a nicer name to indicate its purpose). syserr is an enhanced error that might also include an error message. All user-facing Chapel library code, or user Chapel code, should generally use syserr. When wrapping functions or declaring them in C, use qio_err_t to indicate that a function is returning an error code.

A note about the error code documentation in this file. Error descriptions for system errors are included here for convenience only. Other documentation, such as system man pages or the POSIX specification are the authority on system error codes.

type syserr

A type storing an error code or an error message. A syserr can be compared using == or != to an qio_err_t (ie integer error code) or to another syserr. A syserr can be cast to or from an qio_err_t. It can be assigned the value of an qio_err_t or another syserr. In addition, syserr can be checked directly in an if statement like so:

var err: syserr;
if err then do writeln("err contains an error, ie err != ENOERR");
if !err then do writeln("err does not contain an error; err == ENOERR");

When a syserr formal has default intent, the actual is copied to the formal upon a function call and the formal cannot be assigned within the function.

The default value of the syserr type is undefined.

type qio_err_t = c_int

An integral error code. This is really just a c_int, but code is clearer if you use qio_err_t to indicate arguments, variables, and return types that are system error codes.

Warning

‘qio_err_t’ has been deprecated; please use a ‘CTypes.c_int’ instead.

type fd_t = c_int

A system file descriptor. This is really just a c_int, but code is clearer if you use fd_t to indicate arguments, variables, and return types that are system file descriptors.

proc ENOERR

The error code indicating that no error occurred (Chapel specific)

proc EEOF

An error code indicating the end of file has been reached (Chapel specific)

proc ESHORT

An error code indicating that the end of file or the end of the input was reached before the requested amount of data could be read. (Chapel specific)

proc EFORMAT

An error code indicating a format error; for example when reading a quoted string literal, this would be returned if we never encountered the opening quote. (Chapel specific)

const EBADE: c_int

Invalid exchange (linux only)

const EBADFD: c_int

File descriptor in bad state (linux only)

const EBADR: c_int

Invalid request descriptor (linux only)

const EBADRQC: c_int

Invalid request code (linux only)

const EBADSLT: c_int

Invalid slot (linux only)

const ECHRNG: c_int

Channel number out of range (linux only)

const ECOMM: c_int

Communication error on send (linux only)

const EHOSTDOWN: c_int

Host is down. A socket operation failed because the destination host was down. (linux, FreeBSD)

const EISNAM: c_int

Is a named type file (linux only)

const EKEYEXPIRED: c_int

Key has expired (linux only)

const EKEYREJECTED: c_int

Key was rejected by service (linux only)

const EKEYREVOKED: c_int

Key has been revoked (linux only)

const EL2HLT: c_int

Level 2 halted (linux only)

const EL2NSYNC: c_int

Level 2 not synchronized (linux only)

const EL3HLT: c_int

Level 3 halted (linux only)

const EL3RST: c_int

Level 3 halted (linux only)

const ELIBACC: c_int

Cannot access a needed shared library (linux only)

const ELIBBAD: c_int

Accessing a corrupted shared library (linux only)

const ELIBMAX: c_int

Attempting to link in too many shared libraries (linux only)

const ELIBSCN: c_int

lib section in a.out corrupted (linux only)

const ELIBEXEC: c_int

Cannot exec a shared library directly (linux only)

const EMEDIUMTYPE: c_int

Wrong medium type (linux only)

const ENODATA: c_int

No message is available on the STREAM head read queue (POSIX.1)

const ENOKEY: c_int

Required key not available (linux only)

const ENOMEDIUM: c_int

No medium found (linux only)

const ENONET: c_int

Machine is not on the network (linux only)

const ENOPKG: c_int

Package not installed (linux only)

const ENOSR: c_int

No STREAM resources (POSIX.1 XSI STREAMS option)

const ENOSTR: c_int

Not a STREAM (POSIX.1 XSI STREAMS option)

const ENOTBLK: c_int

Block device required. A block device operation was attempted on a non-block device or file. (linux, FreeBSD)

const ENOTUNIQ: c_int

Name not unique on network (linux only)

const EPFNOSUPPORT: c_int

Protocol family not supported. The protocol family has not been configured into the system or no implementation for it exists. (linux, FreeBSD)

const EREMCHG: c_int

Remote address changed (linux only)

const EREMOTE: c_int

Object is remote (linux only)

const EREMOTEIO: c_int

Remote I/O error (linux only)

const ERESTART: c_int

Interrupted system call should be restarted (linux only)

const ESHUTDOWN: c_int

Can’t send after socket shutdown. A request to send data was disallowed because the socket had already been shut down with a previous shutdown system call.

const ESOCKTNOSUPPORT: c_int

Socket type not supported. The support for the socket type has not been configured into the system or no implementation for it exists. (linux, FreeBSD)

const ESTRPIPE: c_int

Streams pipe error (linux only)

const ETIME: c_int

Timer expired (POSIX.1 XSI STREAMS option)

const EUCLEAN: c_int

Structure needs cleaning (linux only)

const EUNATCH: c_int

Protocol driver not attached (linux only)

const EUSERS: c_int

Too many users. The quota system ran out of table entries. (linux, FreeBSD)

const EXFULL: c_int

Exchange full (linux only)

const E2BIG: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EACCES: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EADDRINUSE: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EADDRNOTAVAIL: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EAFNOSUPPORT: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EAGAIN: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EALREADY: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EBADF: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EBADMSG: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EBUSY: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ECANCELED: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ECHILD: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ECONNABORTED: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ECONNREFUSED: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ECONNRESET: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EDEADLK: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EDESTADDRREQ: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EDOM: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EDQUOT: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EEXIST: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EFAULT: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EFBIG: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EHOSTUNREACH: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EIDRM: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EILSEQ: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EINPROGRESS: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EINTR: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EINVAL: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EIO: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EISCONN: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EISDIR: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ELOOP: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EMFILE: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EMSGSIZE: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EMULTIHOP: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENAMETOOLONG: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENETDOWN: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENETRESET: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENETUNREACH: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENFILE: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOBUFS: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENODEV: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOENT: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOEXEC: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOLCK: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOMEM: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOMSG: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOPROTOOPT: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOSPC: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOSYS: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOTCONN: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOTDIR: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOTEMPTY: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOTSOCK: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOTSUP: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENOTTY: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ENXIO: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EOPNOTSUPP: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EOVERFLOW: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EPERM: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EPIPE: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EPROTO: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EPROTONOSUPPORT: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EPROTOTYPE: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ERANGE: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EROFS: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ESPIPE: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ESRCH: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ESTALE: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ETIMEDOUT: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const ETXTBSY: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EWOULDBLOCK: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead

const EXDEV: c_int

Warning

POSIX error codes defined in ‘SysBasic’ are deprecated; please use them from ‘OS.POSIX’ instead