Under Lucent public license V1.02, from plan9.

Copyright © 2002 Lucent Technologies Inc.
All Rights Reserved


./sys/include/ape/errno.h
"
#ifndef __ERRNO
#define __ERRNO
#pragma lib "/$M/lib/ape/libap.a"

extern int errno;

#define EDOM 1000
#define ERANGE 1001

#ifdef _POSIX_SOURCE

#define E2BIG 1
#define EACCES 2
#define EAGAIN 3
#define EBADF 4
#define EBUSY 5
#define ECHILD 6
#define EDEADLK 7
#define EEXIST 8
#define EFAULT 9
#define EFBIG 10
#define EINTR 11
#define EINVAL 12
#define EIO 13
#define EISDIR 14
#define EMFILE 15
#define EMLINK 16
#define ENAMETOOLONG 17
#define ENFILE 18
#define ENODEV 19
#define ENOENT 20
#define ENOEXEC 21
#define ENOLCK 22
#define ENOMEM 23
#define ENOSPC 24
#define ENOSYS 25
#define ENOTDIR 26
#define ENOTEMPTY 27
#define ENOTTY 28
#define ENXIO 29
#define EPERM 30
#define EPIPE 31
#define EROFS 32
#define ESPIPE 33
#define ESRCH 34
#define EXDEV 35

/* bsd networking software */
#define ENOTSOCK 36
#define EPROTONOSUPPORT 37
#define EPROTOTYPE 37
#define ECONNREFUSED 38
#define EAFNOSUPPORT 39
#define ENOBUFS 40
#define EOPNOTSUPP 41
#define EADDRINUSE 42
#define EDESTADDRREQ 43
#define EMSGSIZE 44
#define ENOPROTOOPT 45
#define ESOCKTNOSUPPORT 46
#define EPFNOSUPPORT 47
#define EADDRNOTAVAIL 48
#define ENETDOWN 49
#define ENETUNREACH 50
#define ENETRESET 51
#define ECONNABORTED 52
#define EISCON 53
#define ENOTCONN 54
#define ESHUTDOWN 55
#define ETOOMANYREFS 56
#define ETIMEDOUT 57
#define EHOSTDOWN 58
#define EHOSTUNREACH 59
#define EGREG 60

/* These added in 1003.1b-1993 */
#define ECANCELED 61
#define EINPROGRESS 62

#endif /* _POSIX_SOURCE */

#endif /* __ERRNO */
"

./sys/include/ape/signal.h " #ifndef __SIGNAL_H #define __SIGNAL_H #pragma lib "/$M/lib/ape/libap.a" typedef int sig_atomic_t; /* * We don't give arg types for signal handlers, in spite of ANSI requirement * that it be 'int' (the signal number), because some programs need an * additional context argument. So the real type of signal handlers is * void handler(int sig, char *, struct Ureg *) * where the char * is the Plan 9 message and Ureg is defined in */ #define SIG_DFL ((void (*)())0) #define SIG_ERR ((void (*)())-1) #define SIG_IGN ((void (*)())1) #define SIGHUP 1 /* hangup */ #define SIGINT 2 /* interrupt */ #define SIGQUIT 3 /* quit */ #define SIGILL 4 /* illegal instruction (not reset when caught)*/ #define SIGABRT 5 /* used by abort */ #define SIGFPE 6 /* floating point exception */ #define SIGKILL 7 /* kill (cannot be caught or ignored) */ #define SIGSEGV 8 /* segmentation violation */ #define SIGPIPE 9 /* write on a pipe with no one to read it */ #define SIGALRM 10 /* alarm clock */ #define SIGTERM 11 /* software termination signal from kill */ #define SIGUSR1 12 /* user defined signal 1 */ #define SIGUSR2 13 /* user defined signal 2 */ #define SIGBUS 14 /* bus error */ /* The following symbols must be defined, but the signals needn't be supported * / #define SIGCHLD 15 /* child process terminated or stopped */ #define SIGCONT 16 /* continue if stopped */ #define SIGSTOP 17 /* stop */ #define SIGTSTP 18 /* interactive stop */ #define SIGTTIN 19 /* read from ctl tty by member of background */ #define SIGTTOU 20 /* write to ctl tty by member of background */ #ifdef _BSD_EXTENSION #define NSIG 21 #endif #ifdef __cplusplus extern "C" { #endif extern void (*signal(int, void (*)()))(); extern int raise(int); #ifdef __cplusplus } #endif #ifdef _POSIX_SOURCE typedef long sigset_t; struct sigaction { void (*sa_handler)(); sigset_t sa_mask; int sa_flags; }; /* values for sa_flags */ #define SA_NOCLDSTOP 1 /* first argument to sigprocmask */ #define SIG_BLOCK 1 #define SIG_UNBLOCK 2 #define SIG_SETMASK 3 #ifdef __cplusplus extern "C" { #endif #ifdef __TYPES_H extern int kill(pid_t, int); #endif extern int sigemptyset(sigset_t *); extern int sigfillset(sigset_t *); extern int sigaddset(sigset_t *, int); extern int sigdelset(sigset_t *, int); extern int sigismember(const sigset_t *, int); extern int sigaction(int, const struct sigaction *, struct sigaction *); extern int sigprocmask(int, sigset_t *, sigset_t *); extern int sigpending(sigset_t *); extern int sigsuspend(const sigset_t *); #ifdef __cplusplus } #endif #endif /* _POSIX_SOURCE */ #endif /* __SIGNAL_H */ "
./sys/include/ape/ctype.c #ifndef __CTYPE #define __CTYPE #pragma lib "/$M/lib/ape/libap.a" " #ifdef __cplusplus extern "C" { #endif extern int isalnum(int); extern int isalpha(int); extern int iscntrl(int); extern int isdigit(int); extern int isgraph(int); extern int islower(int); extern int isprint(int); extern int ispunct(int); extern int isspace(int); extern int isupper(int); extern int isxdigit(int); extern int tolower(int); extern int toupper(int); #ifdef __cplusplus } #endif enum { _ISupper = 01, /* UPPERCASE. */ _ISlower = 02, /* lowercase. */ _ISdigit = 04, /* Numeric. */ _ISspace = 010, /* Whitespace. */ _ISpunct = 020, /* Punctuation. */ _IScntrl = 040, /* Control character. */ _ISblank = 0100, /* Blank (usually SPC and TAB). */ _ISxdigit = 0200, /* Hexadecimal numeric. */ }; extern unsigned char _ctype[]; #define isalnum(c) (_ctype[(unsigned char)(c)]&(_ISupper|_ISlower|_ISdigit) ) #define isalpha(c) (_ctype[(unsigned char)(c)]&(_ISupper|_ISlower)) #define iscntrl(c) (_ctype[(unsigned char)(c)]&_IScntrl) #define isdigit(c) (_ctype[(unsigned char)(c)]&_ISdigit) #define isgraph(c) (_ctype[(unsigned char)(c)]&(_ISpunct|_ISupper|_ISlower| _ISdigit)) #define islower(c) (_ctype[(unsigned char)(c)]&_ISlower) #define isprint(c) (_ctype[(unsigned char)(c)]&(_ISpunct|_ISupper|_ISlower| _ISdigit|_ISblank)) #define ispunct(c) (_ctype[(unsigned char)(c)]&_ISpunct) #define isspace(c) (_ctype[(unsigned char)(c)]&_ISspace) #define isupper(c) (_ctype[(unsigned char)(c)]&_ISupper) #define isxdigit(c) (_ctype[(unsigned char)(c)]&_ISxdigit) #ifdef _BSD_EXTENSION #define isascii(c) (((unsigned int)(c))<0x80) #endif #endif /* __CTYPE */