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