]> pd.if.org Git - pdclib/commitdiff
Documentation for errno.h and errno
authorOwen Shepherd <owen.shepherd@e43.eu>
Tue, 14 Aug 2012 23:40:43 +0000 (00:40 +0100)
committerOwen Shepherd <owen.shepherd@e43.eu>
Tue, 14 Aug 2012 23:40:43 +0000 (00:40 +0100)
man/errno.3 [new file with mode: 0644]
man/errno.h.3 [new file with mode: 0644]

diff --git a/man/errno.3 b/man/errno.3
new file mode 100644 (file)
index 0000000..da54640
--- /dev/null
@@ -0,0 +1,66 @@
+.\" This file is part of the Public Domain C Library (PDCLib).\r
+.\" Permission is granted to use, modify, and / or redistribute at will.\r
+.\"\r
+.Dd\r
+.Dt ERRNO 3\r
+.Os\r
+\r
+.Sh NAME\r
+.Nm errno\r
+.Nd library error result\r
+\r
+.Sh SYNOPSIS\r
+.In errno.h\r
+.Pp\r
+.Sy #define errno <object of thread local storage duration>\r
+.\"\r
+.Sh DESCRIPTION\r
+The header\r
+.In errno.h\r
+defines the name\r
+.Va errno\r
+to refer to an object of thread local storage duration. It is undefined whether\r
+or not \r
+.Va errno\r
+refers to a preprocessor symbol or not.\r
+.\"\r
+.Pp\r
+At program startup, the runtime shall initialize\r
+.Va errno\r
+to contain the value zero (the initial value in other threads is undefined). It \r
+is guaranteed that no function provided by the C standard library shall set the \r
+value of \r
+.Va errno\r
+to zero; therefore, for functions which do not have a unique return value for\r
+indicating error, it is possible to determine whether an error occured by \r
+setting\r
+.Va errno\r
+to zero before the call, then after the call seeing if an error value has been\r
+stored into \r
+.Va errno.\r
+.Pp\r
+.Bf Sy\r
+Note that it is valid for any function which is not described as explicitly \r
+setting \r
+.Va errno \r
+to set it to a non-zero value. Checking for a non-zero value is only valid with\r
+functions which are defined to modify \r
+.Va errno .\r
+.Ef\r
+.\"\r
+.Pp\r
+In some historical versions of the POSIX standard, the prescribed method of \r
+using errno was to define\r
+.Va extern int errno .\r
+This is no longer supported by the POSIX or C standards, and will not work on \r
+the majority of implementations, including this one.\r
+\r
+.Sh SEE ALSO\r
+.Xr errno.h 3\r
+.Xr abort 3\r
+.Xr assert 3\r
+\"\r
+.Sh STANDARDS\r
+Conforming to\r
+.St -isoC-90 ,\r
+.St -isoC-99 .
\ No newline at end of file
diff --git a/man/errno.h.3 b/man/errno.h.3
new file mode 100644 (file)
index 0000000..a754d80
--- /dev/null
@@ -0,0 +1,114 @@
+.\" This file is part of the Public Domain C Library (PDCLib).\r
+.\" Permission is granted to use, modify, and / or redistribute at will.\r
+.\"\r
+.Dd\r
+.Dt ERRNO.H 3\r
+.Os\r
+.\"\r
+.Sh NAME\r
+.Nm errno.h\r
+.Nd error results\r
+.\"\r
+.Sh SYNOPSIS\r
+.In errno.h\r
+.\"\r
+.Sh DESCRIPTION\r
+The header defines the value\r
+.Dv errno\r
+to be an lvalue of thread-local storage duration.\r
+.\"\r
+.Pp\r
+From the ISO C standard, the following error code constants are defined:\r
+.Bl -tag -compact\r
+.It ERANGE\r
+indicating a value is out of range\r
+.It EDOM\r
+indicating that a value is outside the domain of the current function\r
+.It EILSEQ\r
+indicating an invalid character sequence\r
+.El\r
+.\"\r
+.Pp\r
+From the ISO C++ 2011 standard, the following error code constants are defined:\r
+.Bl -tag -compact\r
+.It E2BIG\r
+.It ECONNRESET\r
+.It EISCONN\r
+.It ENOENT\r
+.It ENOTRECOVERABLE\r
+.It EROFS\r
+.It EACCES\r
+.It EDEADLK\r
+.It EISDIR\r
+.It ENOEXEC\r
+.It ENOTSOCK\r
+.It ESPIPE\r
+.It EADDRINUSE\r
+.It EDESTADDRREQ\r
+.It ELOOP\r
+.It ENOLCK\r
+.It ENOTSUP\r
+.It ESRCH\r
+.It EADDRNOTAVAIL\r
+.It EMFILE\r
+.It ENOLINK\r
+.It ENOTTY\r
+.It ETIME\r
+.It EAFNOSUPPORT\r
+.It EEXIST\r
+.It EMLINK\r
+.It ENOMEM\r
+.It ENXIO\r
+.It ETIMEDOUT\r
+.It EAGAIN\r
+.It EFAULT\r
+.It EMSGSIZE\r
+.It ENOMSG\r
+.It EOPNOTSUPP\r
+.It ETXTBSY\r
+.It EALREADY\r
+.It EFBIG\r
+.It ENAMETOOLONG\r
+.It ENOPROTOOPT\r
+.It EOVERFLOW\r
+.It EWOULDBLOCK\r
+(which may have the same value as \r
+.Ev EAGAIN )\r
+.It EBADF\r
+.It EHOSTUNREACH\r
+.It ENETDOWN\r
+.It ENOSPC\r
+.It EOWNERDEAD\r
+.It EXDEV\r
+.It EBADMSG\r
+.It EIDRM\r
+.It ENETRESET\r
+.It ENOSR\r
+.It EPERM\r
+.It EBUSY\r
+.It ENETUNREACH\r
+.It ENOSTR\r
+.It EPIPE\r
+.It ECANCELED\r
+.It EINPROGRESS\r
+.It ENFILE\r
+.It ENOSYS\r
+.It EPROTO\r
+.It ECHILD\r
+.It EINTR\r
+.It ENOBUFS\r
+.It ENOTCONN\r
+.It EPROTONOSUPPORT\r
+.It ECONNABORTED\r
+.It EINVAL\r
+.It ENODATA\r
+.It ENOTDIR\r
+.It EPROTOTYPE\r
+.El\r
+.Sh SEE ALSO\r
+.Xr errno 3\r
+.Sh STANDARDS\r
+Conforming to\r
+.St -isoC-90 ,\r
+.St -isoC-99 , \r
+ISO/IEC 14882:2011 "ISO C++ 11"
\ No newline at end of file