include	clib.inc

	public	sys_errlist
	public	sys_nerr

	public	CP_NOERROR
	public	CP_ERROR
	public	CP_EPERM
	public	CP_ENOENT
	public	CP_ESRCH
	public	CP_EINTR
	public	CP_EIO
	public	CP_ENXIO
	public	CP_E2BIG
	public	CP_ENOEXEC
	public	CP_EBADF
	public	CP_ECHILD
	public	CP_EAGAIN
	public	CP_ENOMEM
	public	CP_EACCES
	public	CP_EFAULT
	public	CP_EBUSY
	public	CP_EEXIST
	public	CP_EXDEV
	public	CP_ENODEV
	public	CP_ENOTDIR
	public	CP_EISDIR
	public	CP_EINVAL
	public	CP_ENFILE
	public	CP_EMFILE
	public	CP_ENOTTY
	public	CP_EFBIG
	public	CP_ENOSPC
	public	CP_ESPIPE
	public	CP_EROFS
	public	CP_EMLINK
	public	CP_EPIPE
	public	CP_EDOM
	public	CP_ERANGE
	public	CP_EDEADLK
	public	CP_ENAMETOOLONG
	public	CP_ENOLCK
	public	CP_ENOSYS
	public	CP_ENOTEMPTY
	public	CP_EILSEQ
	public	CP_UNKNOWN

_DATA	SEGMENT

CP_NOERROR	DB	'No '
CP_ERROR	DB	'Error',0
CP_EPERM        DB	"Operation not permitted",0
CP_ENOENT       DB	"No such file or directory",0
CP_ESRCH        DB	"No such process",0
CP_EINTR        DB	"Interrupted function call",0
CP_EIO          DB	"Input/output error",0
CP_ENXIO        DB	"No such device or address",0
CP_E2BIG        DB	"Arg list too long",0
CP_ENOEXEC      DB	"Exec format error",0
CP_EBADF        DB	"Bad file descriptor",0
CP_ECHILD       DB	"No child processes",0
CP_EAGAIN       DB	"Resource temporarily unavailable",0
CP_ENOMEM       DB	"Not enough space",0
CP_EACCES       DB	"Permission denied",0
CP_EFAULT       DB	"Bad address",0
CP_EBUSY        DB	"Resource device",0
CP_EEXIST       DB	"File exists",0
CP_EXDEV        DB	"Improper link",0
CP_ENODEV       DB	"No such device",0
CP_ENOTDIR      DB	"Not a directory",0
CP_EISDIR       DB	"Is a directory",0
CP_EINVAL       DB	"Invalid argument",0
CP_ENFILE       DB	"Too many open files in system",0
CP_EMFILE       DB	"Too many open files",0
CP_ENOTTY       DB	"Inappropriate I/O control operation",0
CP_EFBIG        DB	"File too large",0
CP_ENOSPC       DB	"No space left on device",0
CP_ESPIPE       DB	"Invalid seek",0
CP_EROFS        DB	"Read-only file system",0
CP_EMLINK       DB	"Too many links",0
CP_EPIPE        DB	"Broken pipe",0
CP_EDOM         DB	"Domain error",0
CP_ERANGE       DB	"Result too large",0
CP_EDEADLK      DB	"Resource deadlock avoided",0
CP_ENAMETOOLONG DB	"Filename too long",0
CP_ENOLCK       DB	"No locks available",0
CP_ENOSYS       DB	"Function not implemented",0
CP_ENOTEMPTY    DB	"Directory not empty",0
CP_EILSEQ       DB	"Illegal byte sequence",0
CP_UNKNOWN      DB	"Unknown error",0

if LDATA
sys_errlist LABEL DWORD
	DD	DGROUP:CP_NOERROR
	DD	DGROUP:CP_EPERM
	DD	DGROUP:CP_ENOENT
	DD	DGROUP:CP_ESRCH
	DD	DGROUP:CP_EINTR
	DD	DGROUP:CP_EIO
	DD	DGROUP:CP_ENXIO
	DD	DGROUP:CP_E2BIG
	DD	DGROUP:CP_ENOEXEC
	DD	DGROUP:CP_EBADF
	DD	DGROUP:CP_ECHILD
	DD	DGROUP:CP_EAGAIN
	DD	DGROUP:CP_ENOMEM
	DD	DGROUP:CP_EACCES
	DD	DGROUP:CP_EFAULT
	DD	DGROUP:CP_UNKNOWN
	DD	DGROUP:CP_EBUSY
	DD	DGROUP:CP_EEXIST
	DD	DGROUP:CP_EXDEV
	DD	DGROUP:CP_ENODEV
	DD	DGROUP:CP_ENOTDIR
	DD	DGROUP:CP_EISDIR
	DD	DGROUP:CP_EINVAL
	DD	DGROUP:CP_ENFILE
	DD	DGROUP:CP_EMFILE
	DD	DGROUP:CP_ENOTTY
	DD	DGROUP:CP_UNKNOWN
	DD	DGROUP:CP_EFBIG
	DD	DGROUP:CP_ENOSPC
	DD	DGROUP:CP_ESPIPE
	DD	DGROUP:CP_EROFS
	DD	DGROUP:CP_EMLINK
	DD	DGROUP:CP_EPIPE
	DD	DGROUP:CP_EDOM
	DD	DGROUP:CP_ERANGE
	DD	DGROUP:CP_UNKNOWN
	DD	DGROUP:CP_EDEADLK
	DD	DGROUP:CP_UNKNOWN
	DD	DGROUP:CP_ENAMETOOLONG
	DD	DGROUP:CP_ENOLCK
	DD	DGROUP:CP_ENOSYS
	DD	DGROUP:CP_ENOTEMPTY
	DD	DGROUP:CP_EILSEQ
	DD	DGROUP:CP_UNKNOWN
else
sys_errlist LABEL WORD
	DW	OFFSET CP_NOERROR
	DW	OFFSET CP_EPERM
	DW	OFFSET CP_ENOENT
	DW	OFFSET CP_ESRCH
	DW	OFFSET CP_EINTR
	DW	OFFSET CP_EIO
	DW	OFFSET CP_ENXIO
	DW	OFFSET CP_E2BIG
	DW	OFFSET CP_ENOEXEC
	DW	OFFSET CP_EBADF
	DW	OFFSET CP_ECHILD
	DW	OFFSET CP_EAGAIN
	DW	OFFSET CP_ENOMEM
	DW	OFFSET CP_EACCES
	DW	OFFSET CP_EFAULT
	DW	OFFSET CP_UNKNOWN
	DW	OFFSET CP_EBUSY
	DW	OFFSET CP_EEXIST
	DW	OFFSET CP_EXDEV
	DW	OFFSET CP_ENODEV
	DW	OFFSET CP_ENOTDIR
	DW	OFFSET CP_EISDIR
	DW	OFFSET CP_EINVAL
	DW	OFFSET CP_ENFILE
	DW	OFFSET CP_EMFILE
	DW	OFFSET CP_ENOTTY
	DW	OFFSET CP_UNKNOWN
	DW	OFFSET CP_EFBIG
	DW	OFFSET CP_ENOSPC
	DW	OFFSET CP_ESPIPE
	DW	OFFSET CP_EROFS
	DW	OFFSET CP_EMLINK
	DW	OFFSET CP_EPIPE
	DW	OFFSET CP_EDOM
	DW	OFFSET CP_ERANGE
	DW	OFFSET CP_UNKNOWN
	DW	OFFSET CP_EDEADLK
	DW	OFFSET CP_UNKNOWN
	DW	OFFSET CP_ENAMETOOLONG
	DW	OFFSET CP_ENOLCK
	DW	OFFSET CP_ENOSYS
	DW	OFFSET CP_ENOTEMPTY
	DW	OFFSET CP_EILSEQ
	DW	OFFSET CP_UNKNOWN
endif

sys_nerr DW	(($ - OFFSET sys_errlist) / DPTRZ)

_DATA	ENDS

	END
