Remove dep on osicat.
[iolib.git] / syscalls / pkgdcl.lisp
blob16ebf6d78c908bbf1d21f1eac716aba28309aea5
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Package definition.
4 ;;;
6 (in-package :common-lisp-user)
8 (defpackage :iolib.syscalls
9 (:nicknames #:isys)
10 (:use :iolib.base :cffi)
11 (:export
12 ;; Conditions
13 #:condition-info-mixin
14 #:system-error
15 #:syscall-error
16 #:posix-error
17 #:poll-error
18 #:poll-timeout
20 ;; Condition accessors
21 #:code-of
22 #:identifier-of
23 #:message-of
24 #:event-type-of
25 #:os-handle-of
27 ;; Pathname Functions
28 #:native-namestring
30 ;; Type Designators
31 #:filename
32 #:filename-designator
33 #:pointer-or-nil
34 #:pointer-or-nil-designator
35 #:bool
36 #:bool-designator
38 ;; Misc
39 #:repeat-decreasing-timeout
40 #:repeat-upon-condition-decreasing-timeout
42 ;; Syscall return wrapper
43 #:syscall-wrapper
44 #:error-predicate-of
45 #:error-location-of
46 #:return-filter-of
47 #:error-generator-of
48 #:syscall-restart-p
49 #:base-type-of
50 #:never-fails
51 #:signal-posix-error
52 #:signal-posix-error/restart
54 ;; Syscall definition
55 #:defentrypoint
56 #:defcfun*
57 #:defsyscall
59 ;;;--------------------------------------------------------------------------
60 ;;; Syscalls
61 ;;;--------------------------------------------------------------------------
63 ;; Specials
64 #:*default-open-mode*
65 #:*environ*
67 ;; Errno-related functions
68 #:%sys-strerror
69 #:%sys-errno
71 ;; Memory manipulation functions
72 #:%sys-memset
73 #:%sys-bzero
74 #:%sys-memcpy
75 #:%sys-memmove
77 ;; Files
78 #:%sys-read
79 #:%sys-write
80 #:%sys-pread
81 #:%sys-pwrite
82 #:%sys-open
83 #:%sys-creat
84 #:%sys-pipe
85 #:%sys-mkfifo
86 #:%sys-umask
87 #:%sys-lseek
88 #:%sys-access
89 #:%sys-truncate
90 #:%sys-ftruncate
91 #:%sys-rename
92 #:%sys-link
93 #:%sys-symlink
94 #:%sys-readlink
95 #:%sys-unlink
96 #:%sys-chown
97 #:%sys-fchown
98 #:%sys-lchown
99 #:%sys-chmod
100 #:%sys-fchmod
101 #:%sys-stat
102 #:%sys-fstat
103 #:%sys-lstat
104 #:%sys-sync
105 #:%sys-fsync
106 #:%sys-mkstemp
108 ;; Directories
109 #:%sys-mkdir
110 #:%sys-rmdir
111 #:%sys-chdir
112 #:%sys-fchdir
113 #:%sys-getcwd
114 #:%sys-mkdtemp
116 ;; File descriptors
117 #:%sys-close
118 #:%sys-dup
119 #:%sys-dup2
120 #:%sys-ioctl/2
121 #:%sys-ioctl/3
122 #:%sys-fd-open-p
124 ;; I/O Polling
125 #:%sys-select
126 #:%sys-fd-zero
127 #:%sys-copy-fd-set
128 #:%sys-fd-isset
129 #:%sys-fd-clr
130 #:%sys-fd-set
131 #:%sys-poll
132 #+linux #:%sys-epoll-create
133 #+linux #:%sys-epoll-ctl
134 #+linux #:%sys-epoll-wait
135 #+bsd #:%sys-kqueue
136 #+bsd #:%sys-kevent
137 #+bsd #:%sys-ev-set
139 ;; Directory walking
140 #:%sys-opendir
141 #:%sys-closedir
142 #:%sys-readdir
143 #:%sys-rewinddir
144 #:%sys-seekdir
145 #:%sys-telldir
147 ;; Memory mapping
148 #:%sys-mmap
149 #:%sys-munmap
151 ;; Process creation and info
152 #:%sys-fork
153 #:%sys-getpid
154 #:%sys-getppid
155 #:%sys-getuid
156 #:%sys-setuid
157 #:%sys-geteuid
158 #:%sys-seteuid
159 #:%sys-getgid
160 #:%sys-setgid
161 #:%sys-getegid
162 #:%sys-setegid
163 #:%sys-setreuid
164 #:%sys-setregid
165 #:%sys-getpgid
166 #:%sys-setpgid
167 #:%sys-getpgrp
168 #:%sys-setpgrp
169 #:%sys-setsid
170 #:%sys-getrlimit
171 #:%sys-setrlimit
172 #:%sys-getrusage
173 #:%sys-getpriority
174 #:%sys-setpriority
175 #:%sys-nice
177 ;; Time
178 #:%sys-usleep
179 #:%sys-time
180 #:%sys-gettimeofday
181 #:%sys-get-monotonic-time
183 ;; Environment
184 #:%sys-getenv
185 #:%sys-setenv
186 #:%sys-unsetenv
188 ;; Local info
189 #:%sys-gethostname
190 #:%sys-getdomainname
191 #:%sys-uname
193 ;; User info
194 #:%sys-getpwnam
195 #:%sys-getpwuid
197 ;; Group info
198 #:%sys-getgrnam
199 #:%sys-getgrgid
201 ;; CMSG readers
202 #:%sys-cmsg-space
203 #:%sys-cmsg-len
204 #:%sys-cmsg-firsthdr
205 #:%sys-cmsg-data
207 ;;;--------------------------------------------------------------------------
208 ;;; Foreign types and constants
209 ;;;--------------------------------------------------------------------------
211 ;; Primitive type sizes
212 #:size-of-char
213 #:size-of-short
214 #:size-of-int
215 #:size-of-long
216 #:size-of-long-long
217 #:size-of-pointer
219 ;; Types
220 #:size-t #:size-of-size-t
221 #:ssize-t #:size-of-ssize-t
222 #:pid-t #:size-of-pid-t
223 #:gid-t #:size-of-gid-t
224 #:uid-t #:size-of-uid-t
225 #:off-t #:size-of-off-t
226 #:mode-t #:size-of-mode-t
227 #:time-t #:size-of-time-t
228 #:useconds-t #:size-of-useconds-t
229 #:suseconds-t #:size-of-suseconds-t
230 #:dev-t #:size-of-dev-t
231 #:ino-t #:size-of-ino-t
232 #:nlink-t #:size-of-nlink-t
233 #:blksize-t #:size-of-blksize-t
234 #:blkcnt-t #:size-of-blkcnt-t
235 #:nfds-t #:size-of-nfds-t
237 ;; OPEN()
238 #:o-rdonly
239 #:o-wronly
240 #:o-rdwr
241 #:o-creat
242 #:o-excl
243 #:o-trunc
244 #:o-append
245 #:o-noctty
246 #:o-nonblock
247 #:o-ndelay
248 #:o-sync
249 #:o-nofollow
250 #:o-async
252 ;; LSEEK()
253 #:seek-set
254 #:seek-cur
255 #:seek-end
257 ;; ACCESS()
258 #:r-ok
259 #:w-ok
260 #:x-ok
261 #:f-ok
263 ;; STAT()
264 #:s-irwxu
265 #:s-irusr
266 #:s-iwusr
267 #:s-ixusr
268 #:s-ifmt
269 #:s-ififo
270 #:s-ifchr
271 #:s-ifdir
272 #:s-ifblk
273 #:s-ifreg
274 #:s-ifwht
275 #:s-iread
276 #:s-iwrite
277 #:s-iexec
278 #:s-irwxg
279 #:s-irgrp
280 #:s-iwgrp
281 #:s-ixgrp
282 #:s-irwxo
283 #:s-iroth
284 #:s-iwoth
285 #:s-ixoth
286 #:s-isuid
287 #:s-isgid
288 #:s-isvtx
289 #:s-iflnk
290 #:s-ifsock
291 #:path-max
293 ;; MMAP()
294 #:prot-none
295 #:prot-read
296 #:prot-write
297 #:prot-exec
298 #:map-shared
299 #:map-private
300 #:map-fixed
301 #:map-failed
303 ;; SELECT()
304 #:fd-setsize
306 ;; POLL()
307 #:pollin
308 #:pollrdnorm
309 #:pollrdband
310 #:pollpri
311 #:pollout
312 #:pollwrnorm
313 #:pollwrband
314 #:pollerr
315 #:pollrdhup
316 #:pollhup
317 #:pollnval
319 ;; EPOLL
320 #+linux #:epoll-ctl-add
321 #+linux #:epoll-ctl-del
322 #+linux #:epoll-ctl-mod
323 #+linux #:epollin
324 #+linux #:epollrdnorm
325 #+linux #:epollrdband
326 #+linux #:epollpri
327 #+linux #:epollout
328 #+linux #:epollwrnorm
329 #+linux #:epollwrband
330 #+linux #:epollerr
331 #+linux #:epollhup
332 #+linux #:epollmsg
333 #+linux #:epolloneshot
334 #+linux #:epollet
336 ;; KEVENT
337 #+bsd #:ev-add
338 #+bsd #:ev-enable
339 #+bsd #:ev-disable
340 #+bsd #:ev-delete
341 #+bsd #:ev-oneshot
342 #+bsd #:ev-clear
343 #+bsd #:ev-eof
344 #+bsd #:ev-error
345 #+bsd #:evfilt-read
346 #+bsd #:evfilt-write
347 #+bsd #:evfilt-aio
348 #+bsd #:evfilt-vnode
349 #+bsd #:evfilt-proc
350 #+bsd #:evfilt-signal
351 #+bsd #:evfilt-timer
352 #+(and bsd (not darwin)) #:evfilt-netdev
353 #+bsd #:note-delete
354 #+bsd #:note-write
355 #+bsd #:note-extend
356 #+bsd #:note-attrib
357 #+bsd #:note-link
358 #+bsd #:note-rename
359 #+bsd #:note-revoke
360 #+bsd #:note-exit
361 #+bsd #:note-fork
362 #+bsd #:note-exec
363 #+bsd #:note-track
364 #+bsd #:note-trackerr
365 #+(and bsd (not darwin)) #:note-linkup
366 #+(and bsd (not darwin)) #:note-linkdown
367 #+(and bsd (not darwin)) #:note-linkinv
369 ;; IOCTL()
370 #:fionbio
371 #:fionread
373 ;; GETRLIMIT()
374 #:prio-process
375 #:prio-pgrp
376 #:prio-user
377 #:rlim-infinity
378 #:rusage-self
379 #:rusage-children
380 #:rlimit-as
381 #:rlimit-core
382 #:rlimit-cpu
383 #:rlimit-data
384 #:rlimit-fsize
385 #:rlimit-memlock
386 #:rlimit-nofile
387 #:rlimit-nproc
388 #:rlimit-rss
389 #:rlimit-stack
390 #+linux #:rlim-saved-max
391 #+linux #:rlim-saved-cur
392 #+linux #:rlimit-locks
393 #+linux #:rlimit-msgqueue
394 #+linux #:rlimit-nlimits
395 #+linux #:rlimit-nice
396 #+linux #:rlimit-rtprio
397 #+linux #:rlimit-sigpending
398 #+bsd #:rlimit-sbsize
400 ;;; Structs
402 ;; timespec
403 #:timespec #:size-of-timespec
404 #:sec
405 #:nsec
407 ;; timeval
408 #:timeval #:size-of-timeval
409 #:sec
410 #:usec
412 ;; stat
413 #:stat #:size-of-stat
414 #:dev #:stat-dev
415 #:ino #:stat-ino
416 #:mode #:stat-mode
417 #:nlink #:stat-nlink
418 #:uid #:stat-uid
419 #:gid #:stat-gid
420 #:rdev #:stat-rdev
421 #:size #:stat-size
422 #:blksize #:stat-blksize
423 #:blocks #:stat-blocks
424 #:atime #:stat-atime
425 #:mtime #:stat-mtime
426 #:ctime #:stat-ctime
428 ;; fd_set
429 #:fd-set #:size-of-fd-set
431 ;; pollfd
432 #:pollfd #:size-of-pollfd
433 #:fd
434 #:events
435 #:revents
437 ;; epoll_data
438 #+linux #:epoll-data #+linux #:size-of-epoll-data
439 #+linux #:ptr
440 #+linux #:fd
441 #+linux #:u32
442 #+linux #:u64
444 ;; epoll_event
445 #+linux #:epoll-event #+linux #:size-of-epoll-event
446 #+linux #:events
447 #+linux #:data
449 ;; kevent
450 #+bsd #:kevent #+bsd #:size-of-kevent
451 #+bsd #:ident
452 #+bsd #:filter
453 #+bsd #:flags
454 #+bsd #:fflags
455 #+bsd #:data
456 #+bsd #:udata
458 ;; Syscall error codes
459 #:errno-values
460 #:eperm #:enoent #:esrch #:eintr #:eio #:enxio #:e2big #:enoexec
461 #:ebadf #:echild #:eagain #:enomem #:eacces #:efault #:ebusy #:eexist
462 #:exdev #:enodev #:enotdir #:eisdir #:einval #:enfile #:emfile
463 #:enotty #:efbig #:enospc #:espipe #:erofs #:emlink #:epipe #:edom
464 #:erange #:edeadlk #:enametoolong #:enolck #:enosys #:enotempty
465 #:echrng #:el2nsync #:el3hlt #:el3rst #:elnrng #:eunatch #:enocsi
466 #:el2hlt #:ebade #:ebadr #:exfull #:enoano #:ebadrqc #:ebadslt
467 #:edeadlock #:ebfont #:enostr #:enodata #:etime #:enosr #:enopkg
468 #:eadv #:esrmnt #:ecomm #:edotdot #:enotuniq #:ebadfd #:elibscn
469 #:elibmax #:elibexec #:eilseq #:erestart #:estrpipe #:euclean
470 #:enotnam #:enavail #:eremoteio #:enomedium #:emediumtype #:estale
471 #:enotblk #:etxtbsy #:eusers #:eloop #:ewouldblock #:enomsg #:eidrm
472 #:eproto #:emultihop #:ebadmsg #:eoverflow #:edquot #:einprogress
473 #:ealready #:eprotonosupport #:esocktnosupport #:enotsock
474 #:edestaddrreq #:emsgsize #:eprototype #:enoprotoopt #:eremote
475 #:enolink #:epfnosupport #:eafnosupport #:eaddrinuse #:eaddrnotavail
476 #:enetdown #:enetunreach #:enetreset #:econnaborted #:econnreset
477 #:eisconn #:enotconn #:eshutdown #:etoomanyrefs #:etimedout
478 #:econnrefused #:ehostdown #:ehostunreach #:enonet #:enobufs
479 #:eopnotsupp