Newer
Older
;;; -*- Package: UNIX -*-
;;;
;;; **********************************************************************
;;; This code was written as part of the CMU Common Lisp project at
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix.lisp,v 1.58 1998/01/29 07:41:52 dtc Exp $")
;;;
;;; **********************************************************************
;;;
;;; This file contains the UNIX low-level support.
;;;
(in-package "UNIX")
(use-package "ALIEN")
(use-package "C-CALL")
(use-package "SYSTEM")
(use-package "EXT")
(export '(
daddr-t caddr-t ino-t swblk-t size-t time-t dev-t off-t uid-t gid-t
timeval tv-sec tv-usec timezone tz-minuteswest tz-dsttime
itimerval it-interval it-value tchars t-intrc t-quitc t-startc
t-stopc t-eofc t-brkc ltchars t-suspc t-dsuspc t-rprntc t-flushc
t-werasc t-lnextc sgttyb sg-ispeed sg-ospeed sg-erase sg-kill
sg-flags winsize ws-row ws-col ws-xpixel ws-ypixel
direct d-off d-ino d-reclen #-(or linux svr4) d-namlen d-name
stat st-dev st-mode st-nlink st-uid st-gid st-rdev st-size
st-atime st-mtime st-ctime st-blksize st-blocks
s-ifmt s-ifdir s-ifchr s-ifblk s-ifreg s-iflnk s-ifsock
s-isuid s-isgid s-isvtx s-iread s-iwrite s-iexec
ruseage ru-utime ru-stime ru-maxrss ru-ixrss ru-idrss
ru-isrss ru-minflt ru-majflt ru-nswap ru-inblock ru-oublock
ru-msgsnd ru-msgrcv ru-nsignals ru-nvcsw ru-nivcsw
unix-errno get-unix-error-msg
unix-pathname unix-file-mode unix-fd unix-pid unix-uid unix-gid
unix-access r_ok w_ok x_ok f_ok unix-chdir unix-chmod setuidexec
setgidexec savetext readown writeown execown readgrp writegrp
execgrp readoth writeoth execoth unix-fchmod unix-chown unix-fchown
unix-getdtablesize unix-close unix-creat unix-dup unix-dup2
unix-fcntl f-dupfd f-getfd f-setfd f-getfl f-setfl f-getown f-setown
fndelay fappend fasync fcreat ftrunc fexcl unix-link unix-lseek
l_set l_incr l_xtnd unix-mkdir unix-open o_rdonly o_wronly o_rdwr
#+(or hpux svr4 freebsd linux) o_ndelay
#+(or hpux svr4 freebsd linux) o_noctty #+(or hpux svr4) o_nonblock
o_append o_creat o_trunc o_excl unix-pipe unix-read unix-readlink
unix-rename unix-rmdir unix-fast-select fd-setsize fd-set fd-clr
fd-isset fd-zero unix-select unix-sync unix-fsync unix-truncate
unix-ftruncate unix-symlink
#+(and sparc svr4) unix-times
unix-unlink unix-write unix-ioctl
tcsetpgrp tcgetpgrp tty-process-group
terminal-speeds tty-raw tty-crmod tty-echo tty-lcase
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#-hpux tty-cbreak #-(or hpux linux) tty-tandem
#+(or hpux svr4 linux freebsd) termios
#+(or hpux svr4 linux freebsd) c-lflag
#+(or hpux svr4 linux freebsd) c-iflag
#+(or hpux svr4 linux freebsd) c-oflag
#+(or hpux svr4 linux freebsd) tty-icrnl
#+(or hpux svr4 linux) tty-ocrnl
#+(or hpux svr4 freebsd) vdsusp #+(or hpux svr4 linux freebsd) veof
#+(or hpux svr4 linux freebsd) vintr
#+(or hpux svr4 linux freebsd) vquit
#+(or hpux svr4 linux freebsd) vstart
#+(or hpux svr4 linux freebsd) vstop
#+(or hpux svr4 linux freebsd) vsusp
#+(or hpux svr4 linux freebsd) c-cflag
#+(or hpux svr4 linux freebsd) c-cc
#+(or hpux svr4 linux freebsd) tty-icanon
#+(or hpux svr4 linux freebsd) vmin
#+(or hpux svr4 linux freebsd) vtime
#+(or hpux svr4 linux freebsd) tty-ixon
#+(or hpux svr4 freebsd linux) tcsanow
#+(or hpux svr4 freebsd linux) tcsadrain
#+(or hpux svr4 freebsd linux) tciflush
#+(or hpux svr4 freebsd linux) tcoflush
#+(or hpux svr4 freebsd linux) tcioflush
#+(or hpux svr4 freebsd linux) tcsaflush
#+(or hpux svr4 linux freebsd) unix-tcgetattr
#+(or hpux svr4 linux freebsd) unix-tcsetattr
#+(or hpux svr4 freebsd) unix-cfgetospeed
#+(or hpux svr4 freebsd) unix-cfsetospeed
#+(or hpux svr4 freebsd) unix-cfgetispeed
#+(or hpux svr4 freebsd) unix-cfsetispeed
#+(or hpux svr4 linux freebsd) tty-ignbrk
#+(or hpux svr4 linux freebsd) tty-brkint
#+(or hpux svr4 linux freebsd) tty-ignpar
#+(or hpux svr4 linux freebsd) tty-parmrk
#+(or hpux svr4 linux freebsd) tty-inpck
#+(or hpux svr4 linux freebsd) tty-istrip
#+(or hpux svr4 linux freebsd) tty-inlcr
#+(or hpux svr4 linux freebsd) tty-igncr
#+(or hpux svr4 linux) tty-iuclc
#+(or hpux svr4 linux freebsd) tty-ixany
#+(or hpux svr4 linux freebsd) tty-ixoff
#+hpux tty-ienqak
#+(or hpux irix solaris linux freebsd) tty-imaxbel
#+(or hpux svr4 linux freebsd) tty-opost
#+(or hpux svr4 linux) tty-olcuc
#+(or hpux svr4 linux freebsd) tty-onlcr
#+(or hpux svr4 linux) tty-onocr
#+(or hpux svr4 linux) tty-onlret
#+(or hpux svr4 linux) tty-ofill
#+(or hpux svr4 linux) tty-ofdel
#+(or hpux svr4 linux freebsd) tty-isig
#+(or hpux svr4 linux) tty-xcase
#+(or hpux svr4 linux freebsd) tty-echoe
#+(or hpux svr4 linux freebsd) tty-echok
#+(or hpux svr4 linux freebsd) tty-echonl
#+(or hpux svr4 linux freebsd) tty-noflsh
#+(or hpux svr4 linux freebsd) tty-iexten
#+(or hpux svr4 linux freebsd) tty-tostop
#+(or hpux irix solaris linux freebsd) tty-echoctl
#+(or hpux irix solaris linux freebsd) tty-echoprt
#+(or hpux irix solaris linux freebsd) tty-echoke
#+(or hpux irix solaris) tty-defecho
#+(or hpux irix solaris freebsd) tty-flusho
#+(or hpux irix solaris linux freebsd) tty-pendin
#+(or hpux svr4 linux freebsd) tty-cstopb
#+(or hpux svr4 linux freebsd) tty-cread
#+(or hpux svr4 linux freebsd) tty-parenb
#+(or hpux svr4 linux freebsd) tty-parodd
#+(or hpux svr4 linux freebsd) tty-hupcl
#+(or hpux svr4 linux freebsd) tty-clocal
#+(or irix solaris) rcv1en
#+(or irix solaris) xmt1en
#+(or hpux irix solaris) tty-loblk
#+(or hpux svr4 linux freebsd) vintr
#+(or hpux svr4 linux freebsd) verase
#+(or hpux svr4 linux freebsd) vkill
#+(or hpux svr4 linux freebsd) veol
#+(or hpux irix solaris linux freebsd) veol2
#+(or hpux irix solaris) tty-cbaud
#+(or hpux svr4 freebsd) tty-csize #+(or hpux svr4 freebsd) tty-cs5
#+(or hpux svr4 freebsd) tty-cs6 #+(or hpux svr4 freebsd) tty-cs7
#+(or hpux svr4 freebsd) tty-cs8
#+(or hpux svr4 freebsd) unix-tcsendbreak
#+(or hpux svr4 freebsd) unix-tcdrain
#+(or hpux svr4 freebsd) unix-tcflush
#+(or hpux svr4 freebsd) unix-tcflow
TIOCGETP TIOCSETP TIOCFLUSH TIOCSETC TIOCGETC TIOCSLTC
unix-exit unix-stat unix-lstat unix-fstat
unix-getrusage unix-fast-getrusage rusage_self rusage_children
unix-gettimeofday
#-hpux unix-utimes #-(or svr4 hpux) unix-setreuid
#-(or svr4 hpux) unix-setregid
unix-getpid unix-getppid
unix-getgid unix-getegid unix-getpgrp unix-setpgrp unix-getuid
unix-getpagesize unix-gethostname unix-gethostid unix-fork
unix-current-directory unix-isatty unix-ttyname unix-execve
unix-socket unix-connect unix-bind unix-listen unix-accept
unix-recv unix-send unix-getpeername unix-getsockname))
(pushnew :unix *features*)
;;;; Common machine independent structures.
#+bsd
(def-alien-type quad-t (array unsigned-long 2))
(def-alien-type daddr-t #-(or linux alpha) long #+(or linux alpha) int)
(def-alien-type ino-t #-alpha unsigned-long #+alpha unsigned-int)
(def-alien-type size-t #-(or linux alpha) long #+linux unsigned-int
#+alpha unsigned-long)
(def-alien-type time-t #-(or linux alpha) unsigned-long #+linux long
#+alpha unsigned-int)
(def-alien-type dev-t #-(or alpha svr4 bsd linux) short #+linux unsigned-short
#+alpha int #+(and (not linux) (or bsd svr4)) unsigned-long)
#-FreeBSD
(def-alien-type off-t #-alpha long #+alpha unsigned-long)
#+FreeBSD
(def-alien-type off-t quad-t)
#-FreeBSD
(def-alien-type uid-t #-(or alpha svr4) unsigned-short #+alpha unsigned-int
#+svr4 long)
#+FreeBSD
(def-alien-type uid-t unsigned-long)
#-FreeBSD
(def-alien-type gid-t #-(or alpha svr4) unsigned-short #+alpha unsigned-int
#+svr4 long)
(def-alien-type mode-t #-(or alpha svr4) unsigned-short
Loading
Loading full blame...