X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-posix%2Fconstants.lisp;h=3c753ff6bbce2cc97aaf49b89c1b6c04004a8e6d;hb=4f87ff15a8a6259e59a297fcf74b0c6c8f60c1c4;hp=a040ebae1b86e6db2192bb0c1090578e90dcb2b7;hpb=b665ae77fc8e369b8713abf3ca9e3d8455e4c5a7;p=sbcl.git diff --git a/contrib/sb-posix/constants.lisp b/contrib/sb-posix/constants.lisp index a040eba..3c753ff 100644 --- a/contrib/sb-posix/constants.lisp +++ b/contrib/sb-posix/constants.lisp @@ -6,6 +6,7 @@ (#||# "sys/types.h" "sys/stat.h" + #-win32 "utime.h" #-win32 "sys/socket.h" #-win32 "sys/un.h" #-win32 "netinet/in.h" @@ -21,7 +22,8 @@ "dirent.h" "signal.h" #-win32 "pwd.h" "unistd.h" - #-win32 "termios.h") + #-win32 "termios.h" + #-win32 "syslog.h") ;;; then the stuff we're looking for ((:integer af-inet "AF_INET" "IP Protocol family" t) @@ -75,7 +77,7 @@ (:integer SIGPROF "SIGPROF" #+sb-doc "profiling timer alarm (see setitimer(2))." t) (:integer SIGWINCH "SIGWINCH" #+sb-doc "Window size change." t) - (:integer SIGINFO "SIGINFO" #+sb-doc "status request from keyboard." t) + (:integer SIGPWR "SIGPWR" #+sb-doc "Power failure." t) (:integer SIGUSR1 "SIGUSR1" #+sb-doc "User defined signal 1." t) (:integer SIGUSR2 "SIGUSR2" #+sb-doc "User defined signal 2." t) (:integer SIGRTMIN "SIGRTMIN" #+sb-doc "Smallest real-time signal number." t) @@ -212,6 +214,15 @@ ;; mode_t (:type mode-t "mode_t") + (:integer s-ifmt "S_IFMT" nil t) + (:integer s-ififo "S_IFIFO" nil t) + (:integer s-ifchr "S_IFCHR" nil t) + (:integer s-ifdir "S_IFDIR" nil t) + (:integer s-ifblk "S_IFBLK" nil t) + (:integer s-ifreg "S_IFREG" nil t) + (:integer s-iflnk "S_IFLNK" nil t) + (:integer s-ifsock "S_IFSOCK" nil t) + (:integer s-ifwht "S_IFWHT" nil t) (:integer s-isuid "S_ISUID" nil t) (:integer s-isgid "S_ISGID" nil t) (:integer s-isvtx "S_ISVTX" nil t) @@ -252,7 +263,8 @@ ;; opendir() (:structure dirent - ("struct dirent" + (#+(and linux largefile) "struct dirent64" + #-(and linux largefile) "struct dirent" (:c-string name "char *" "d_name" :distrust-length #+sunos t #-sunos nil)) t) @@ -295,6 +307,12 @@ (time-t mtime "time_t" "st_mtime") (time-t ctime "time_t" "st_ctime"))) + #+darwin + (:structure alien-timespec + ("struct timespec" + (time-t tv-sec "time_t" "tv_sec") + (long tv-nsec "long" "tv_nsec"))) + ;; open() (:integer o-rdonly "O_RDONLY" nil t) (:integer o-wronly "O_WRONLY" nil t) @@ -332,6 +350,12 @@ (:integer f-getown "F_GETOWN" nil t) (:integer f-setown "F_SETOWN" nil t) + ;; lockf() + (:integer f-lock "F_LOCK" nil t) + (:integer f-tlock "F_TLOCK" nil t) + (:integer f-ulock "F_ULOCK" nil t) + (:integer f-test "F_TEST" nil t) + ;; tcgetattr(), tcsetattr() #-win32 (:type cc-t "cc_t") @@ -349,6 +373,23 @@ (tcflag-t lflag "tcflag_t" "c_lflag") ((array cc-t) cc "cc_t" "c_cc"))) + ;; utime(), utimes() + #-win32 + (:type suseconds-t ; OAOOM warning: similar kludge in tools-for-build + #+os-provides-suseconds-t "suseconds_t" + #-os-provides-suseconds-t "long") + + #-win32 + (:structure alien-utimbuf + ("struct utimbuf" + (time-t actime "time_t" "actime") + (time-t modtime "time_t" "modtime"))) + #-win32 + (:structure alien-timeval + ("struct timeval" + (time-t sec "time_t" "tv_sec") + (suseconds-t usec "suseconds_t" "tv_usec"))) + (:integer veof "VEOF" nil t) (:integer veol "VEOL" nil t) (:integer verase "VERASE" nil t) @@ -458,4 +499,119 @@ (:integer tcooff "TCOOFF" nil t) (:integer tcoon "TCOON" nil t) - ) + ;; syslog -- does this exist at all on Windows? + + ;; SUSv3-standard openlog() facilities + #-win32 + (:integer log-user "LOG_USER" "Default openlog() faclity." t) + #-win32 + (:integer log-local0 "LOG_LOCAL0" "Locally-defined openlog() facility" t) + #-win32 + (:integer log-local1 "LOG_LOCAL1" "Locally-defined openlog() facility" t) + #-win32 + (:integer log-local2 "LOG_LOCAL2" "Locally-defined openlog() facility" t) + #-win32 + (:integer log-local3 "LOG_LOCAL3" "Locally-defined openlog() facility" t) + #-win32 + (:integer log-local4 "LOG_LOCAL4" "Locally-defined openlog() facility" t) + #-win32 + (:integer log-local5 "LOG_LOCAL5" "Locally-defined openlog() facility" t) + #-win32 + (:integer log-local6 "LOG_LOCAL6" "Locally-defined openlog() facility" t) + #-win32 + (:integer log-local7 "LOG_LOCAL7" "Locally-defined openlog() facility" t) + + ;; Additional, non-standard openlog() facilities (most of which + ;; probably won't be needed by Lisp programs, but here for + ;; completeness). + #-win32 + (:integer + log-authpriv "LOG_AUTHPRIV" "openlog() facility for authorization messages" t) + #-win32 + (:integer + log-cron "LOG_CRON" "openlog() facility for cron and at daemons" t) + #-win32 + (:integer + log-daemon "LOG_DAEMON" "openlog() facility for arbitrary daemons" t) + #-win32 + (:integer + log-ftp "LOG_FTP" "openlog() facility for FTP daemons" t) + #-win32 + (:integer + log-kern "LOG_KERN" "openlog() facility for kernel messages" t) + #-win32 + (:integer + log-lpr "LOG_LPR" "openlog() facility for the printer subsystem" t) + #-win32 + (:integer + log-mail "LOG_MAIL" "openlog() facility for the mail subsystem" t) + #-win32 + (:integer + log-news "LOG_NEWS" "openlog() facility for the usenet subsystem" t) + #-win32 + (:integer + log-syslog "LOG_SYSLOG" "openlog() facility for the syslog subsystem" t) + #-win32 + (:integer + log-uucp "LOG_UUCP" "openlog() facility for the UUCP subsystem" t) + + ;; openlog() options + #-win32 + (:integer + log-pid "LOG_PID" + "If supplied to openlog(), log the process ID with each message" + t) + #-win32 + (:integer + log-cons "LOG_CONS" + "If supplied to openlog(), log to the system console as well as logfiles" + t) + #-win32 + (:integer + log-ndelay "LOG_NDELAY" + "If supplied to openlog(), immediately open the syslog connection." + t) + #-win32 + (:integer + log-odelay "LOG_ODELAY" + "If supplied to openlog(), delay opening the syslog connection to the first syslog() call." + t) + #-win32 + (:integer + log-nowait "LOG_NOWAIT" + "If supplied to openlog(), do not wait for child processes created by calls to syslog()." + t) + ;; Not in SUSv3, but at least Glibc and BSD libc have this + #-win32 + (:integer + log-perror "LOG_PERROR" + "If supplied to openlog(), write log messages to the process's standard error descriptor in addition to the logging facility." + t) + + ;; syslog() severity levels + #-win32 + (:integer + log-emerg "LOG_EMERG" "Log severity level denoting a panic." t) + #-win32 + (:integer + log-alert "LOG_ALERT" "Log severity level denoting a condition that should be corrected immediately." t) + #-win32 + (:integer + log-crit "LOG_CRIT" "Log severity level denoting critical conditions." t) + #-win32 + (:integer + log-err "LOG_ERR" "Log severity level denoting an error." t) + #-win32 + (:integer + log-warning "LOG_WARNING" "Log severity level denoting a warning." t) + #-win32 + (:integer + log-notice "LOG_NOTICE" "Log severity level denoting non-errors that may require special handling." t) + #-win32 + (:integer + log-info "LOG_INFO" "Log severity level denoting informational messages." t) + #-win32 + (:integer + log-debug "LOG_DEBUG" "Log severity level denoting debugging information ." t) + +)