0.8.3.85:
[sbcl.git] / contrib / sb-posix / constants.lisp
1 ;;; -*- Lisp -*-
2
3 ;;; This isn't really lisp, but it's definitely a source file.
4
5 ;;; first, the headers necessary to find definitions of everything
6 (#||#
7  "sys/types.h"
8  "unistd.h"
9  "sys/stat.h"
10  
11  "sys/socket.h" "sys/un.h" "netinet/in.h" "netinet/in_systm.h"
12  "netinet/ip.h" "net/if.h" "netdb.h" "errno.h" "netinet/tcp.h"
13  "fcntl.h" "sys/mman.h"
14  "dirent.h" "signal.h")
15
16 ;;; then the stuff we're looking for
17 ((:integer af-inet "AF_INET" "IP Protocol family")
18
19  (:type uid-t "uid_t")
20  (:type gid-t "gid_t")
21
22  (:type pid-t "pid_t")
23
24  ;; signals
25  (:integer SIGHUP "SIGHUP" #+sb-doc "terminal line hangup.")
26  (:integer SIGINT "SIGINT" #+sb-doc "interrupt program.")
27  (:integer SIGQUIT "SIGQUIT" #+sb-doc "quit program.")
28  (:integer SIGILL "SIGILL" #+sb-doc "illegal instruction.")
29  (:integer SIGTRAP "SIGTRAP" #+sb-doc "trace trap.")
30  (:integer SIGABRT "SIGABRT" #+sb-doc "abort program (formerly SIGIOT).")
31  (:integer SIGEMT "SIGEMT" #+sb-doc "emulate instruction executed.")
32  (:integer SIGFPE "SIGFPE" #+sb-doc "floating-point exception.")
33  (:integer SIGKILL "SIGKILL" #+sb-doc "kill program.")
34  (:integer SIGBUS "SIGBUS" #+sb-doc "bus error.")
35  (:integer SIGSEGV "SIGSEGV" #+sb-doc "segmentation violation.")
36  (:integer SIGSYS "SIGSYS" #+sb-doc "non-existent system call invoked.")
37  (:integer SIGPIPE "SIGPIPE" #+sb-doc "write on a pipe with no reader.")
38  (:integer SIGALRM "SIGALRM" #+sb-doc "real-time timer expired.")
39  (:integer SIGTERM "SIGTERM" #+sb-doc "software termination signal.")
40  (:integer SIGURG "SIGURG" #+sb-doc "urgent condition present on socket.")
41  (:integer SIGSTOP "SIGSTOP" #+sb-doc "stop (cannot be caught or ignored).")
42  (:integer SIGTSTP "SIGTSTP" #+sb-doc "stop signal generated from keyboard.")
43  (:integer SIGCONT "SIGCONT" #+sb-doc "continue after stop.")
44  (:integer SIGCHLD "SIGCHLD" #+sb-doc "child status has changed.")
45  (:integer SIGTTIN "SIGTTIN"
46            #+sb-doc "background read attempted from control terminal.")
47  (:integer SIGTTOU "SIGTTOU"
48            #+sb-doc "background write attempted to control terminal.")
49  (:integer SIGIO "SIGIO"
50            #+sb-doc "I/O is possible on a descriptor (see fcntl(2)).")
51  (:integer SIGXCPU "SIGXCPU"
52            #+sb-doc "cpu time limit exceeded (see setrlimit(2)).")
53  (:integer SIGXFSZ "SIGXFSZ"
54            #+sb-doc "file size limit exceeded (see setrlimit(2)).")
55  (:integer SIGVTALRM "SIGVTALRM"
56            #+sb-doc "virtual time alarm (see setitimer(2)).")
57  (:integer SIGPROF "SIGPROF"
58            #+sb-doc "profiling timer alarm (see setitimer(2)).")
59  (:integer SIGWINCH "SIGWINCH" #+sb-doc "Window size change.")
60  (:integer SIGINFO "SIGINFO" #+sb-doc "status request from keyboard.")
61  (:integer SIGUSR1 "SIGUSR1" #+sb-doc "User defined signal 1.")
62  (:integer SIGUSR2 "SIGUSR2" #+sb-doc "User defined signal 2.")
63  (:integer SIGRTMIN "SIGRTMIN" #+sb-doc "Smallest real-time signal number.")
64  (:integer SIGRTMAX "SIGRTMAX" #+sb-doc "Largest real-time signal number.")
65  
66  ;; mode_t
67  (:type mode-t "mode_t")
68  (:integer s-isuid "S_ISUID")
69  (:integer s-isgid "S_ISGID")
70  (:integer s-isvtx "S_ISVTX")
71  (:integer s-irusr "S_IRUSR")
72  (:integer s-iwusr "S_IWUSR")
73  (:integer s-ixusr "S_IXUSR")
74  (:integer s-iread "S_IRUSR")
75  (:integer s-iwrite "S_IWUSR")
76  (:integer s-iexec "S_IXUSR")
77  (:integer s-irgrp "S_IRGRP")
78  (:integer s-iwgrp "S_IWGRP")
79  (:integer s-ixgrp "S_IXGRP")
80  (:integer s-iroth "S_IROTH")
81  (:integer s-iwoth "S_IWOTH")
82  (:integer s-ixoth "S_IXOTH")
83
84  ;; access()
85  (:integer r-ok "R_OK")
86  (:integer w-ok "W_OK")
87  (:integer x-ok "X_OK")
88  (:integer f-ok "F_OK")
89
90  ;; mmap()
91  (:type off-t "off_t")
92  (:integer prot-none "PROT_NONE" #+sb-doc "mmap: no protection")
93  (:integer prot-read "PROT_READ" #+sb-doc "mmap: read protection")
94  (:integer prot-write "PROT_WRITE" #+sb-doc "mmap: write protection")
95  (:integer prot-exec "PROT_EXEC" #+sb-doc "mmap: execute protection")
96  (:integer map-shared "MAP_SHARED" #+sb-doc "mmap: shared memory")
97  (:integer map-private "MAP_PRIVATE" #+sb-doc "mmap: private mapping")
98  (:integer map-fixed "MAP_FIXED" #+sb-doc "mmap: map at given location")
99
100  ;; msync()
101  (:integer ms-async "MS_ASYNC" #+sb-doc "msync: return immediately")
102  (:integer ms-sync "MS_SYNC" #+sb-doc "msync: perform synchronous writes")
103  (:integer ms-invalidate "MS_INVALIDATE"
104            #+sb-doc "msync: invalidate all cached data")
105
106  ;; opendir()
107  (:structure dirent
108              ("struct dirent"
109               (:c-string name "char *" "d_name"
110                          :distrust-length #+solaris t #-solaris nil)))
111  )