1 ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
3 ;;; --- Package definition.
6 (in-package :common-lisp-user
)
8 (defpackage :iolib.syscalls
10 (:use
:iolib.base
:cffi
)
11 (:shadow
#:open
#:close
#:read
#:write
#:listen
12 #:truncate
#:ftruncate
#:time
)
16 ;;;----------------------------------------------------------------------
18 ;;;----------------------------------------------------------------------
20 ;; Primitive type sizes
29 #:size-t
#:size-of-size-t
30 #:ssize-t
#:size-of-ssize-t
31 #:off-t
#:size-of-off-t
34 ;;;----------------------------------------------------------------------
36 ;;;----------------------------------------------------------------------
38 ;; Syscall error codes
40 #:e2big
#:eacces
#:eaddrinuse
#:eaddrnotavail
41 #:eafnosupport
#:ealready
#:ebadf
#:ebadmsg
#:ebusy
#:ecanceled
42 #:echild
#:econnaborted
#:econnrefused
#:econnreset
#:edeadlk
43 #:edestaddrreq
#:edom
#:edquot
#:eexist
#:efault
#:efbig
44 #:ehostunreach
#:eidrm
#:eilseq
#:einprogress
#:eintr
#:einval
#:eio
45 #:eisconn
#:eisdir
#:eloop
#:emfile
#:emlink
#:emsgsize
#:emultihop
46 #:enametoolong
#:enetdown
#:enetreset
#:enetunreach
#:enfile
47 #:enobufs
#:enodata
#:enodev
#:enoent
#:enoexec
#:enolck
#:enolink
48 #:enomem
#:enomsg
#:enoprotoopt
#:enospc
#:enosr
#:enostr
#:enosys
49 #:enotconn
#:enotdir
#:enotempty
#:enotsock
#:enotsup
#:enotty
50 #:enxio
#:eopnotsupp
#:eoverflow
#:eperm
#:epipe
#:eproto
51 #:eprotonosupport
#:eprototype
#:erange
#:erofs
#:espipe
#:esrch
52 #:estale
#:etime
#:etimedout
#:etxtbsy
#:ewouldblock
#:exdev
61 ;;;----------------------------------------------------------------------
63 ;;;----------------------------------------------------------------------
65 ;; Errno-related functions
89 ;;;----------------------------------------------------------------------
91 ;;;----------------------------------------------------------------------
93 ;; Primitive type sizes
102 #:size-t
#:size-of-size-t
103 #:ssize-t
#:size-of-ssize-t
104 #:pid-t
#:size-of-pid-t
105 #:gid-t
#:size-of-gid-t
106 #:uid-t
#:size-of-uid-t
107 #:off-t
#:size-of-off-t
108 #:mode-t
#:size-of-mode-t
109 #:time-t
#:size-of-time-t
110 #:useconds-t
#:size-of-useconds-t
111 #:suseconds-t
#:size-of-suseconds-t
112 #:dev-t
#:size-of-dev-t
113 #:ino-t
#:size-of-ino-t
114 #:nlink-t
#:size-of-nlink-t
115 #:blksize-t
#:size-of-blksize-t
116 #:blkcnt-t
#:size-of-blkcnt-t
117 #:nfds-t
#:size-of-nfds-t
120 ;;;----------------------------------------------------------------------
122 ;;;----------------------------------------------------------------------
284 #+linux
#:epoll-ctl-add
285 #+linux
#:epoll-ctl-del
286 #+linux
#:epoll-ctl-mod
288 #+linux
#:epollrdnorm
289 #+linux
#:epollrdband
292 #+linux
#:epollwrnorm
293 #+linux
#:epollwrband
297 #+linux
#:epolloneshot
314 #+bsd
#:evfilt-signal
316 #+(and bsd
(not darwin
)) #:evfilt-netdev
328 #+bsd
#:note-trackerr
329 #+(and bsd
(not darwin
)) #:note-linkup
330 #+(and bsd
(not darwin
)) #:note-linkdown
331 #+(and bsd
(not darwin
)) #:note-linkinv
354 #+linux
#:rlim-saved-max
355 #+linux
#:rlim-saved-cur
356 #+linux
#:rlimit-locks
357 #+linux
#:rlimit-msgqueue
358 #+linux
#:rlimit-nlimits
359 #+linux
#:rlimit-nice
360 #+linux
#:rlimit-rtprio
361 #+linux
#:rlimit-sigpending
362 #+bsd
#:rlimit-sbsize
364 ;; Syscall error codes
366 #:e2big
#:eacces
#:eaddrinuse
#:eaddrnotavail
367 #:eafnosupport
#:ealready
#:ebadf
#:ebadmsg
#:ebusy
#:ecanceled
368 #:echild
#:econnaborted
#:econnrefused
#:econnreset
#:edeadlk
369 #:edestaddrreq
#:edom
#:edquot
#:eexist
#:efault
#:efbig
370 #:ehostunreach
#:eidrm
#:eilseq
#:einprogress
#:eintr
#:einval
#:eio
371 #:eisconn
#:eisdir
#:eloop
#:emfile
#:emlink
#:emsgsize
#:emultihop
372 #:enametoolong
#:enetdown
#:enetreset
#:enetunreach
#:enfile
373 #:enobufs
#:enodata
#:enodev
#:enoent
#:enoexec
#:enolck
#:enolink
374 #:enomem
#:enomsg
#:enoprotoopt
#:enospc
#:enosr
#:enostr
#:enosys
375 #:enotconn
#:enotdir
#:enotempty
#:enotsock
#:enotsup
#:enotty
376 #:enxio
#:eopnotsupp
#:eoverflow
#:eperm
#:epipe
#:eproto
377 #:eprotonosupport
#:eprototype
#:erange
#:erofs
#:espipe
#:esrch
378 #:estale
#:etime
#:etimedout
#:etxtbsy
#:ewouldblock
#:exdev
382 ;;;----------------------------------------------------------------------
384 ;;;----------------------------------------------------------------------
387 #:*default-open-mode
*
390 ;; Errno-related functions
394 ;; Memory manipulation functions
465 #+linux
#:epoll-create
484 ;; Process creation and info
560 ;;;----------------------------------------------------------------------
561 ;;; Error conditions, wrappers and definers
562 ;;;----------------------------------------------------------------------
564 #:iolib-condition
#:iolib-error
#:syscall-error
565 #:code-of
#:identifier-of
#:message-of
#:handle-of
#:handle2-of
566 #:make-syscall-error
#:syscall-error-p
#:get-syscall-error-condition
567 #:signal-syscall-error
#:signal-syscall-error
/restart
568 #:poll-error
#:event-type-of
#:poll-timeout
570 ;; Syscall return wrapper
579 #:signal-syscall-error
580 #:signal-syscall-error-kw
581 #:signal-syscall-error
/restart
588 ;; CFFI Type Designators
590 #:pointer-or-nil-designator
594 ;; SSTRING <-> CSTRING
598 #:with-cstring-to-sstring
599 #:with-sstring-to-cstring
602 #:repeat-upon-condition
604 #:repeat-decreasing-timeout
605 #:repeat-upon-condition-decreasing-timeout
608 ;;;----------------------------------------------------------------------
609 ;;; Struct definitions, slots and accessors
610 ;;;----------------------------------------------------------------------
613 #:timespec
#:size-of-timespec
618 #:timeval
#:size-of-timeval
623 #:sigaction
#:size-of-sigaction
627 #:stat
#:size-of-stat
636 #:blksize
#:stat-blksize
637 #:blocks
#:stat-blocks
643 #:fd-set
#:size-of-fd-set
646 #:pollfd
#:size-of-pollfd
652 #+linux
#:epoll-data
#+linux
#:size-of-epoll-data
659 #+linux
#:epoll-event
#+linux
#:size-of-epoll-event
664 #+bsd
#:kevent
#+bsd
#:size-of-kevent
674 #:sc-arg-max
#:sc-child-max
#:sc-host-name-max
#:sc-login-name-max
675 #:sc-clk-tck
#:sc-open-max
#:sc-pagesize
#:sc-re-dup-max
676 #:sc-stream-max
#:sc-symloop-max
#:sc-tty-name-max
#:sc-tzname-max
677 #:sc-version
#:sc-phys-pages
#:sc-avphys-pages
#:sc-nprocessors-conf
678 #:sc-nprocessors-onln