Define _GNU_SOURCE only if not already defined
[iolib.git] / src / syscalls / ffi-types-unix.lisp
blob7d5daaf7785518656c05cf64cbd7967fb106834d
1 ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Foreign type definitions for *NIX systems.
4 ;;;
6 (in-package :iolib.syscalls)
8 ;;; FIXME: Find a way to use pkg-config to get these flags
9 ;;; instead of hard-coding them
10 #+linux
11 (progn
12 (c "#if !defined(_GNU_SOURCE)")
13 (define "_GNU_SOURCE")
14 (c "#endif // _GNU_SOURCE")
15 (define "_LARGEFILE_SOURCE")
16 (define "_LARGEFILE64_SOURCE")
17 (define "_FILE_OFFSET_BITS" 64))
19 (include "lfp.h")
21 (include "sys/poll.h" ;; FIXME: add poll() to LFP
22 "sys/ioctl.h" "sys/utsname.h"
23 "pwd.h" "grp.h")
25 #+linux
26 (include "sys/epoll.h" "sys/syscall.h")
28 #+bsd
29 (include "sys/event.h" "sys/time.h") ; for kqueue
33 ;;;-------------------------------------------------------------------------
34 ;;; Simple POSIX types
35 ;;;-------------------------------------------------------------------------
37 (ctype bool "bool")
38 (ctype size-t "size_t")
39 (ctype ssize-t "ssize_t")
40 (ctype intptr-t "intptr_t")
41 (ctype uintptr-t "uintptr_t")
42 (ctype pid-t "pid_t")
43 (ctype uid-t "uid_t")
44 (ctype gid-t "gid_t")
45 (ctype off-t "off_t")
46 (ctype mode-t "mode_t")
47 (ctype time-t "time_t")
48 (ctype useconds-t "useconds_t")
49 (ctype suseconds-t "suseconds_t")
50 (ctype dev-t "dev_t")
51 (ctype ino-t "ino_t")
52 (ctype nlink-t "nlink_t")
53 (ctype blksize-t "blksize_t")
54 (ctype blkcnt-t "blkcnt_t")
55 (ctype nfds-t "nfds_t")
56 (ctype rlim-t "rlim_t")
57 (ctype id-t "id_t")
58 (ctype clockid-t "clockid_t")
61 ;;;-------------------------------------------------------------------------
62 ;;; Structs, slots and C constants
63 ;;;-------------------------------------------------------------------------
65 ;;; errno.h
67 (constantenum (errno-values :define-constants t)
68 (:e2big "E2BIG")
69 (:eacces "EACCES")
70 (:eaddrinuse "EADDRINUSE")
71 (:eaddrnotavail "EADDRNOTAVAIL")
72 (:eafnosupport "EAFNOSUPPORT")
73 (:ealready "EALREADY")
74 (:ebadf "EBADF")
75 (:ebadmsg "EBADMSG")
76 (:ebusy "EBUSY")
77 (:ecanceled "ECANCELED")
78 (:echild "ECHILD")
79 (:econnaborted "ECONNABORTED")
80 (:econnrefused "ECONNREFUSED")
81 (:econnreset "ECONNRESET")
82 (:edeadlk "EDEADLK")
83 (:edestaddrreq "EDESTADDRREQ")
84 (:edom "EDOM")
85 (:edquot "EDQUOT")
86 (:eexist "EEXIST")
87 (:efault "EFAULT")
88 (:efbig "EFBIG")
89 (:ehostdown "EHOSTDOWN")
90 (:ehostunreach "EHOSTUNREACH")
91 (:eidrm "EIDRM")
92 (:eilseq "EILSEQ")
93 (:einprogress "EINPROGRESS")
94 (:eintr "EINTR")
95 (:einval "EINVAL")
96 (:eio "EIO")
97 (:eisconn "EISCONN")
98 (:eisdir "EISDIR")
99 (:eloop "ELOOP")
100 (:emfile "EMFILE")
101 (:emlink "EMLINK")
102 (:emsgsize "EMSGSIZE")
103 (:emultihop "EMULTIHOP")
104 (:enametoolong "ENAMETOOLONG")
105 (:enetdown "ENETDOWN")
106 (:enetreset "ENETRESET")
107 (:enetunreach "ENETUNREACH")
108 (:enfile "ENFILE")
109 (:enobufs "ENOBUFS")
110 (:enodata "ENODATA" :optional t)
111 (:enodev "ENODEV")
112 (:enoent "ENOENT")
113 (:enoexec "ENOEXEC")
114 (:enolck "ENOLCK")
115 (:enolink "ENOLINK")
116 (:enomem "ENOMEM")
117 (:enomsg "ENOMSG")
118 (:enonet "ENONET" :optional t)
119 (:enoprotoopt "ENOPROTOOPT")
120 (:enospc "ENOSPC")
121 (:enosr "ENOSR" :optional t)
122 (:enostr "ENOSTR" :optional t)
123 (:enosys "ENOSYS")
124 (:enotconn "ENOTCONN")
125 (:enotdir "ENOTDIR")
126 (:enotempty "ENOTEMPTY")
127 (:enotsock "ENOTSOCK")
128 (:enotsup "ENOTSUP")
129 (:enotty "ENOTTY")
130 (:enxio "ENXIO")
131 (:eopnotsupp "EOPNOTSUPP")
132 (:eoverflow "EOVERFLOW")
133 (:eperm "EPERM")
134 (:epipe "EPIPE")
135 (:eproto "EPROTO")
136 (:eprotonosupport "EPROTONOSUPPORT")
137 (:eprototype "EPROTOTYPE")
138 (:erange "ERANGE")
139 (:erofs "EROFS")
140 (:eshutdown "ESHUTDOWN")
141 (:espipe "ESPIPE")
142 (:esrch "ESRCH")
143 (:estale "ESTALE")
144 (:etime "ETIME" :optional t)
145 (:etimedout "ETIMEDOUT")
146 (:etxtbsy "ETXTBSY")
147 (:ewouldblock "EWOULDBLOCK")
148 (:exdev "EXDEV")
149 (:ebug "EBUG"))
152 ;;; fcntl.h
154 ;; Open()
156 (constant (o-rdonly "O_RDONLY"))
157 (constant (o-wronly "O_WRONLY"))
158 (constant (o-rdwr "O_RDWR"))
159 (constant (o-creat "O_CREAT"))
160 (constant (o-excl "O_EXCL"))
161 (constant (o-trunc "O_TRUNC"))
162 (constant (o-append "O_APPEND"))
164 (constant (o-noctty "O_NOCTTY"))
165 (constant (o-nonblock "O_NONBLOCK"))
166 (constant (o-ndelay "O_NDELAY"))
167 (constant (o-sync "O_SYNC"))
168 (constant (o-nofollow "O_NOFOLLOW"))
169 (constant (o-async "O_ASYNC"))
170 (constant (o-cloexec "O_CLOEXEC"))
172 ;;; Fcntl()
174 (constant (f-dupfd "F_DUPFD"))
175 (constant (f-getfd "F_GETFD"))
176 (constant (f-setfd "F_SETFD"))
177 (constant (f-getfl "F_GETFL"))
178 (constant (f-setfl "F_SETFL"))
179 (constant (f-getlk "F_GETLK"))
180 (constant (f-setlk "F_SETLK"))
181 (constant (f-setlkw "F_SETLKW"))
182 (constant (f-getown "F_GETOWN"))
183 (constant (f-setown "F_SETOWN"))
184 (constant (f-rdlck "F_RDLCK"))
185 (constant (f-wrlck "F_WRLCK"))
186 (constant (f-unlck "F_UNLCK"))
187 #+linux
188 (progn
189 (constant (f-getsig "F_GETSIG"))
190 (constant (f-setsig "F_SETSIG"))
191 (constant (f-setlease "F_SETLEASE"))
192 (constant (f-getlease "F_GETLEASE")))
195 ;;; unistd.h
197 ;; Lseek()
199 (constant (seek-set "SEEK_SET"))
200 (constant (seek-cur "SEEK_CUR"))
201 (constant (seek-end "SEEK_END"))
203 ;; Access()
205 (constant (r-ok "R_OK"))
206 (constant (w-ok "W_OK"))
207 (constant (x-ok "X_OK"))
208 (constant (f-ok "F_OK"))
211 ;;; time.h
213 (constant (clock-realtime "CLOCK_REALTIME"))
214 (constant (clock-monotonic "CLOCK_MONOTONIC"))
216 (cstruct timespec "struct timespec"
217 "UNIX time specification in seconds and nanoseconds."
218 (sec "tv_sec" :type time-t)
219 (nsec "tv_nsec" :type :long))
222 ;;; sys/stat.h
224 (constant (path-max "PATH_MAX" "MAXPATHLEN"))
226 (cstruct stat "struct stat"
227 (dev "st_dev" :type dev-t)
228 (ino "st_ino" :type ino-t)
229 (mode "st_mode" :type mode-t)
230 (nlink "st_nlink" :type nlink-t)
231 (uid "st_uid" :type uid-t)
232 (gid "st_gid" :type gid-t)
233 (rdev "st_rdev" :type dev-t)
234 (size "st_size" :type off-t)
235 (blksize "st_blksize" :type blkcnt-t)
236 (blocks "st_blocks" :type blksize-t)
237 (atime "st_atime" :type time-t)
238 (mtime "st_mtime" :type time-t)
239 (ctime "st_ctime" :type time-t))
241 (constant (s-irwxu "S_IRWXU"))
242 (constant (s-irusr "S_IRUSR"))
243 (constant (s-iwusr "S_IWUSR"))
244 (constant (s-ixusr "S_IXUSR"))
245 (constant (s-ifmt "S_IFMT"))
246 (constant (s-ififo "S_IFIFO"))
247 (constant (s-ifchr "S_IFCHR"))
248 (constant (s-ifdir "S_IFDIR"))
249 (constant (s-ifblk "S_IFBLK"))
250 (constant (s-ifreg "S_IFREG"))
251 (constant (s-ifwht "S_IFWHT") :optional t)
252 (constant (s-iread "S_IREAD"))
253 (constant (s-iwrite "S_IWRITE"))
254 (constant (s-iexec "S_IEXEC"))
256 (constant (s-irwxg "S_IRWXG"))
257 (constant (s-irgrp "S_IRGRP"))
258 (constant (s-iwgrp "S_IWGRP"))
259 (constant (s-ixgrp "S_IXGRP"))
260 (constant (s-irwxo "S_IRWXO"))
261 (constant (s-iroth "S_IROTH"))
262 (constant (s-iwoth "S_IWOTH"))
263 (constant (s-ixoth "S_IXOTH"))
264 (constant (s-isuid "S_ISUID"))
265 (constant (s-isgid "S_ISGID"))
266 (constant (s-isvtx "S_ISVTX"))
267 (constant (s-iflnk "S_IFLNK"))
268 (constant (s-ifsock "S_IFSOCK"))
271 ;;; sys/ioctl.h
273 ;; Ioctl()
275 (constant (fionbio "FIONBIO"))
276 (constant (fionread "FIONREAD"))
279 ;;; sys/wait.h
281 (constant (wnohang "WNOHANG"))
282 (constant (wuntraced "WUNTRACED"))
283 (constant (wcontinued "WCONTINUED"))
286 ;;;-------------------------------------------------------------------------
287 ;;; signal.h
288 ;;;-------------------------------------------------------------------------
290 ;; POSIX.1-1990
291 (constantenum (signal :define-constants t)
292 (:sighup "SIGHUP")
293 (:sigint "SIGINT")
294 (:sigquit "SIGQUIT")
295 (:sigill "SIGILL")
296 (:sigabrt "SIGABRT")
297 (:sigfpe "SIGFPE")
298 (:sigkill "SIGKILL")
299 (:sigsegv "SIGSEGV")
300 (:sigpipe "SIGPIPE")
301 (:sigalrm "SIGALRM")
302 (:sigterm "SIGTERM")
303 (:sigusr1 "SIGUSR1")
304 (:sigusr2 "SIGUSR2")
305 (:sigchld "SIGCHLD")
306 (:sigcont "SIGCONT")
307 (:sigstop "SIGSTOP")
308 (:sigtstp "SIGTSTP")
309 (:sigttin "SIGTTIN")
310 (:sigttou "SIGTTOU")
311 ;; POSIX.1-2001
312 (:sigbus "SIGBUS")
313 (:sigpoll "SIGPOLL" :optional t)
314 (:sigprof "SIGPROF")
315 (:sigsys "SIGSYS")
316 (:sigtrap "SIGTRAP")
317 (:sigurg "SIGURG")
318 (:sigvtalrm "SIGVTALRM")
319 (:sigxcpu "SIGXCPU")
320 (:sigxfsz "SIGXFSZ")
321 ;; Other signals
322 (:sigemt "SIGEMT" :optional t)
323 (:sigio "SIGIO")
324 (:sigcld "SIGCLD" :optional t)
325 (:sigpwr "SIGPWR" :optional t)
326 (:siginfo "SIGINFO" :optional t)
327 (:siglost "SIGLOST" :optional t)
328 (:sigwinch "SIGWINCH"))
330 (constant (sig-ign "SIG_IGN"))
331 (constant (sig-dfl "SIG_DFL"))
333 (cstruct sigaction "struct sigaction"
334 (handler "sa_handler" :type :pointer)
335 (sigaction "sa_sigaction" :type :pointer)
336 ;; actual type can be structure or array...
337 (mask "sa_mask" :type :unsigned-long)
338 (flags "sa_flags" :type :int))
340 (constant (sa-nocldstop "SA_NOCLDSTOP"))
341 (constant (sa-nocldwait "SA_NOCLDWAIT"))
342 (constant (sa-nodefer "SA_NODEFER"))
343 (constant (sa-onstack "SA_ONSTACK"))
344 (constant (sa-resethand "SA_RESETHAND"))
345 (constant (sa-restart "SA_RESTART"))
346 (constant (sa-siginfo "SA_SIGINFO"))
349 ;;; sys/mman.h
351 ;; Mmap()
353 (constant (prot-none "PROT_NONE"))
354 (constant (prot-read "PROT_READ"))
355 (constant (prot-write "PROT_WRITE"))
356 (constant (prot-exec "PROT_EXEC"))
357 (constant (map-shared "MAP_SHARED"))
358 (constant (map-private "MAP_PRIVATE"))
359 (constant (map-fixed "MAP_FIXED"))
360 (constant (map-failed "MAP_FAILED"))
363 ;;; sys/select.h
365 (cstruct fd-set "fd_set")
366 (constant (fd-setsize "FD_SETSIZE"))
368 (cstruct timeval "struct timeval"
369 "UNIX time specification in seconds and microseconds."
370 (sec "tv_sec" :type time-t)
371 (usec "tv_usec" :type suseconds-t))
374 ;;; sys/poll.h
376 ;; Poll()
378 (cstruct pollfd "struct pollfd"
379 "Poll file descriptor activity specification structure."
380 (fd "fd" :type :int)
381 (events "events" :type :short)
382 (revents "revents" :type :short))
384 (constant (pollin "POLLIN"))
385 (constant (pollrdnorm "POLLRDNORM"))
386 (constant (pollrdband "POLLRDBAND"))
387 (constant (pollpri "POLLPRI"))
388 (constant (pollout "POLLOUT"))
389 (constant (pollwrnorm "POLLWRNORM"))
390 (constant (pollwrband "POLLWRBAND"))
391 (constant (pollerr "POLLERR"))
392 #+linux (constant (pollrdhup "POLLRDHUP"))
393 (constant (pollhup "POLLHUP"))
394 (constant (pollnval "POLLNVAL"))
397 ;;; dirent.h
399 ;; Apparently POSIX 1003.1-2001 (according to linux manpages) only
400 ;; requires d_name. Sigh. I guess we should assemble some decent
401 ;; wrapper functions. No, struct members can't be optional at this
402 ;; point.
403 (cstruct dirent "struct dirent"
404 ;; POSIX actually requires this to be d_ino
405 (fileno "d_fileno" :type #-freebsd ino-t #+freebsd :uint32)
406 (type "d_type" :type :uint8)
407 (name "d_name" :type :uint8 :count :auto))
409 ;;; filetypes set in d_type slot of struct dirent
410 (constant (dt-unknown "DT_UNKNOWN"))
411 (constant (dt-fifo "DT_FIFO"))
412 (constant (dt-chr "DT_CHR"))
413 (constant (dt-dir "DT_DIR"))
414 (constant (dt-blk "DT_BLK"))
415 (constant (dt-reg "DT_REG"))
416 (constant (dt-lnk "DT_LNK"))
417 (constant (dt-sock "DT_SOCK"))
418 (constant (dt-wht "DT_WHT"))
421 ;;;-------------------------------------------------------------------------
422 ;;; sys/resource.h
423 ;;;-------------------------------------------------------------------------
425 (cstruct rlimit "struct rlimit"
426 (cur "rlim_cur" :type rlim-t)
427 (max "rlim_max" :type rlim-t))
429 (cstruct rusage "struct rusage"
430 (utime "ru_utime" :type timeval)
431 (stime "ru_stime" :type timeval)
432 (maxrss "ru_maxrss" :type :long)
433 (ixrss "ru_ixrss" :type :long)
434 (idrss "ru_idrss" :type :long)
435 (isrss "ru_isrss" :type :long)
436 (minflt "ru_minflt" :type :long)
437 (majflt "ru_majflt" :type :long)
438 (nswap "ru_nswap" :type :long)
439 (inblock "ru_inblock" :type :long)
440 (oublock "ru_oublock" :type :long)
441 (msgsnd "ru_msgsnd" :type :long)
442 (msgrcv "ru_msgrcv" :type :long)
443 (nsignals "ru_nsignals" :type :long)
444 (nvcsw "ru_nvcsw" :type :long)
445 (nivcsw "ru_nivcsw" :type :long))
447 (constant (prio-process "PRIO_PROCESS"))
448 (constant (prio-pgrp "PRIO_PGRP"))
449 (constant (prio-user "PRIO_USER"))
450 (constant (rlim-infinity "RLIM_INFINITY"))
451 (constant (rusage-self "RUSAGE_SELF"))
452 (constant (rusage-children "RUSAGE_CHILDREN"))
453 (constant (rlimit-as "RLIMIT_AS"))
454 (constant (rlimit-core "RLIMIT_CORE"))
455 (constant (rlimit-cpu "RLIMIT_CPU"))
456 (constant (rlimit-data "RLIMIT_DATA"))
457 (constant (rlimit-fsize "RLIMIT_FSIZE"))
458 (constant (rlimit-memlock "RLIMIT_MEMLOCK"))
459 (constant (rlimit-nofile "RLIMIT_NOFILE"))
460 (constant (rlimit-nproc "RLIMIT_NPROC"))
461 (constant (rlimit-rss "RLIMIT_RSS"))
462 (constant (rlimit-stack "RLIMIT_STACK"))
464 #+linux
465 (progn
466 (constant (rlim-saved-max "RLIM_SAVED_MAX"))
467 (constant (rlim-saved-cur "RLIM_SAVED_CUR"))
468 (constant (rlimit-locks "RLIMIT_LOCKS"))
469 (constant (rlimit-msgqueue "RLIMIT_MSGQUEUE"))
470 (constant (rlimit-nlimits "RLIMIT_NLIMITS"))
471 (constant (rlimit-nice "RLIMIT_NICE"))
472 (constant (rlimit-rtprio "RLIMIT_RTPRIO"))
473 (constant (rlimit-sigpending "RLIMIT_SIGPENDING")))
475 #+(or dragonfly freebsd)
476 (constant (rlimit-sbsize "RLIMIT_SBSIZE"))
479 ;;;-------------------------------------------------------------------------
480 ;;; sys/utsname.h
481 ;;;-------------------------------------------------------------------------
483 (cstruct utsname "struct utsname"
484 (sysname "sysname" :type :char)
485 (nodename "nodename" :type :char)
486 (release "release" :type :char)
487 (version "version" :type :char)
488 (machine "machine" :type :char))
491 ;;;-------------------------------------------------------------------------
492 ;;; pwd.h
493 ;;;-------------------------------------------------------------------------
495 (cstruct passwd "struct passwd"
496 (name "pw_name" :type :string)
497 (passwd "pw_passwd" :type :string)
498 (uid "pw_uid" :type uid-t)
499 (gid "pw_gid" :type gid-t)
500 (gecos "pw_gecos" :type :string)
501 (dir "pw_dir" :type :string)
502 (shell "pw_shell" :type :string))
505 ;;;-------------------------------------------------------------------------
506 ;;; grp.h
507 ;;;-------------------------------------------------------------------------
509 (cstruct group "struct group"
510 (name "gr_name" :type :string)
511 (passwd "gr_passwd" :type :string)
512 (gid "gr_gid" :type gid-t)
513 (mem "gr_mem" :type :pointer))
516 ;;;-------------------------------------------------------------------------
517 ;;; sys/syscall.h
518 ;;;-------------------------------------------------------------------------
520 #+linux (constant (sys-gettid "SYS_gettid"))
523 ;;;-------------------------------------------------------------------------
524 ;;; sys/epoll.h
525 ;;;-------------------------------------------------------------------------
527 #+linux
528 (progn
529 (cunion epoll-data "epoll_data_t"
530 (ptr "ptr" :type :pointer)
531 (fd "fd" :type :int)
532 (u32 "u32" :type :uint32)
533 (u64 "u64" :type :uint64))
535 (cstruct epoll-event "struct epoll_event"
536 (events "events" :type :uint32)
537 (data "data" :type epoll-data))
539 (constant (epoll-ctl-add "EPOLL_CTL_ADD"))
540 (constant (epoll-ctl-del "EPOLL_CTL_DEL"))
541 (constant (epoll-ctl-mod "EPOLL_CTL_MOD"))
543 (constant (epollin "EPOLLIN"))
544 (constant (epollrdnorm "EPOLLRDNORM"))
545 (constant (epollrdband "EPOLLRDBAND"))
546 (constant (epollpri "EPOLLPRI"))
547 (constant (epollout "EPOLLOUT"))
548 (constant (epollwrnorm "EPOLLWRNORM"))
549 (constant (epollwrband "EPOLLWRBAND"))
550 (constant (epollerr "EPOLLERR"))
551 (constant (epollhup "EPOLLHUP"))
552 (constant (epollmsg "EPOLLMSG"))
553 (constant (epolloneshot "EPOLLONESHOT"))
554 (constant (epollet "EPOLLET")))
557 ;;;-------------------------------------------------------------------------
558 ;;; sys/event.h
559 ;;;-------------------------------------------------------------------------
561 #+bsd
562 (progn
563 (cstruct kevent "struct kevent"
564 (ident "ident" :type uintptr-t)
565 (filter "filter" :type #-netbsd :short
566 #+netbsd :uint32)
567 (flags "flags" :type #-netbsd :unsigned-short
568 #+netbsd :uint32)
569 (fflags "fflags" :type #-netbsd :unsigned-int
570 #+netbsd :uint32)
571 (data "data" :type #-netbsd intptr-t
572 #+netbsd :int64)
573 (udata "udata" :type :pointer))
575 ;; kevent() flags
576 (constant (ev-add "EV_ADD"))
577 (constant (ev-enable "EV_ENABLE"))
578 (constant (ev-disable "EV_DISABLE"))
579 (constant (ev-delete "EV_DELETE"))
580 (constant (ev-oneshot "EV_ONESHOT"))
581 (constant (ev-clear "EV_CLEAR"))
582 (constant (ev-eof "EV_EOF"))
583 (constant (ev-error "EV_ERROR"))
585 ;; kevent() filter flags
586 (constant (evfilt-read "EVFILT_READ"))
587 (constant (evfilt-write "EVFILT_WRITE"))
588 (constant (evfilt-aio "EVFILT_AIO"))
589 (constant (evfilt-vnode "EVFILT_VNODE"))
590 (constant (evfilt-proc "EVFILT_PROC"))
591 (constant (evfilt-signal "EVFILT_SIGNAL"))
592 (constant (evfilt-timer "EVFILT_TIMER"))
593 #-darwin (constant (evfilt-netdev "EVFILT_NETDEV"))
595 ;; EVFILT_VNODE options
596 (constant (note-delete "NOTE_DELETE"))
597 (constant (note-write "NOTE_WRITE"))
598 (constant (note-extend "NOTE_EXTEND"))
599 (constant (note-attrib "NOTE_ATTRIB"))
600 (constant (note-link "NOTE_LINK"))
601 (constant (note-rename "NOTE_RENAME"))
602 (constant (note-revoke "NOTE_REVOKE"))
604 ;; EVFILT_PROC options
605 (constant (note-exit "NOTE_EXIT"))
606 (constant (note-fork "NOTE_FORK"))
607 (constant (note-exec "NOTE_EXEC"))
608 (constant (note-track "NOTE_TRACK"))
609 (constant (note-trackerr "NOTE_TRACKERR"))
611 ;; EVFILT_NETDEV options
612 #-darwin
613 (progn
614 (constant (note-linkup "NOTE_LINKUP"))
615 (constant (note-linkdown "NOTE_LINKDOWN"))
616 (constant (note-linkinv "NOTE_LINKINV"))))
619 ;;;-------------------------------------------------------------------------
620 ;;; syslog.h
621 ;;;-------------------------------------------------------------------------
623 ;; Option flags for openlog.
624 (constant (log-pid "LOG_PID")
625 :documentation "log the pid with each message")
626 (constant (log-cons "LOG_CONS")
627 :documentation "log on the console if errors in sending")
628 (constant (log-odelay "LOG_ODELAY")
629 :documentation "delay open until first syslog() (default)")
630 (constant (log-ndelay "LOG_NDELAY")
631 :documentation "don't delay open")
632 (constant (log-nowait "LOG_NOWAIT")
633 :documentation "don't wait for console forks: DEPRECATED")
634 (constant (log-perror "LOG_PERROR")
635 :documentation "log to stderr as well")
637 ;; facility codes
638 (constant (log-kern "LOG_KERN")
639 :documentation "kernel messages")
640 (constant (log-user "LOG_USER")
641 :documentation "random user-level messages")
642 (constant (log-mail "LOG_MAIL")
643 :documentation "mail system")
644 (constant (log-daemon "LOG_DAEMON")
645 :documentation "system daemons")
646 (constant (log-auth "LOG_AUTH")
647 :documentation "security/authorization messages")
648 (constant (log-syslog "LOG_SYSLOG")
649 :documentation "messages generated internally by syslogd")
650 (constant (log-lpr "LOG_LPR")
651 :documentation "line printer subsystem")
652 (constant (log-news "LOG_NEWS")
653 :documentation "network news subsystem")
654 (constant (log-uucp "LOG_UUCP")
655 :documentation "UUCP subsystem")
656 (constant (log-cron "LOG_CRON")
657 :documentation "clock daemon")
658 (constant (log-authpriv "LOG_AUTHPRIV")
659 :documentation "security/authorization messages (private")
660 (constant (log-ftp "LOG_FTP")
661 :documentation "ftp daemon")
662 #+bsd
663 (constant (log-security "LOG_SECURITY")
664 :documentation "security subsystems")
666 ;; other codes through 15 reserved for system use
667 (constant (log-local0 "LOG_LOCAL0"))
668 (constant (log-local1 "LOG_LOCAL1"))
669 (constant (log-local2 "LOG_LOCAL2"))
670 (constant (log-local3 "LOG_LOCAL3"))
671 (constant (log-local4 "LOG_LOCAL4"))
672 (constant (log-local5 "LOG_LOCAL5"))
673 (constant (log-local6 "LOG_LOCAL6"))
674 (constant (log-local7 "LOG_LOCAL7"))
676 ;; priorities (these are ordered)
677 (constant (log-emerg "LOG_EMERG")
678 :documentation "system is unusable")
679 (constant (log-alert "LOG_ALERT")
680 :documentation "action must be taken immediately")
681 (constant (log-crit "LOG_CRIT")
682 :documentation "critical conditions")
683 (constant (log-err "LOG_ERR")
684 :documentation "error conditions")
685 (constant (log-warning "LOG_WARNING")
686 :documentation "warning conditions")
687 (constant (log-notice "LOG_NOTICE")
688 :documentation "normal but significant condition")
689 (constant (log-info "LOG_INFO")
690 :documentation "informational")
691 (constant (log-debug "LOG_DEBUG")
692 :documentation "debug-level messages")