1 (cl:in-package :sb-posix-internal)
3 (define-condition sb-posix::syscall-error (error)
4 ((errno :initarg :errno :reader sb-posix::syscall-errno))
6 (let ((errno (sb-posix::syscall-errno c)))
7 (format s "System call error ~A (~A)"
8 errno (sb-int:strerror errno))))))
10 (defun syscall-error ()
11 (error 'sb-posix::syscall-error :errno (get-errno)))
15 (define-call "access" int minusp (pathname filename) (mode int))
16 (define-call "chdir" int minusp (pathname filename))
17 (define-call "chmod" int minusp (pathname filename) (mode sb-posix::mode-t))
18 (define-call "chown" int minusp (pathname filename)
19 (owner sb-posix::uid-t) (group sb-posix::gid-t))
20 (define-call "close" int minusp (fd file-descriptor))
21 (define-call "dup" int minusp (oldfd file-descriptor))
22 (define-call "dup2" int minusp (oldfd file-descriptor) (newfd file-descriptor))
23 (define-call "fchdir" int minusp (fd file-descriptor))
24 (define-call "fchmod" int minusp (fd file-descriptor) (mode sb-posix::mode-t))
25 (define-call "fchown" int minusp (fd file-descriptor)
26 (owner sb-posix::uid-t) (group sb-posix::gid-t))
27 (define-call "link" int minusp (oldpath filename) (newpath filename))
28 (define-call "lchown" int minusp (pathname filename)
29 (owner sb-posix::uid-t) (group sb-posix::gid-t))
30 (define-call "mkdir" int minusp (pathname filename) (mode sb-posix::mode-t))
31 ;;(define-call "readlink" int minusp (path filename) (buf (* t)) (len int))
32 (define-call "rmdir" int minusp (pathname filename))
33 (define-call "symlink" int minusp (oldpath filename) (newpath filename))
34 (define-call "unlink" int minusp (pathname filename))
39 (define-call "geteuid" sb-posix::uid-t not) ;"always successful", it says
40 (define-call "getresuid" sb-posix::uid-t not)
41 (define-call "getuid" sb-posix::uid-t not)
42 (define-call "seteuid" int minusp (uid sb-posix::uid-t))
43 #+linux (define-call "setfsuid" int minusp (uid sb-posix::uid-t))
44 (define-call "setreuid" int minusp
45 (ruid sb-posix::uid-t) (euid sb-posix::uid-t))
46 (define-call "setresuid" int minusp
47 (ruid sb-posix::uid-t) (euid sb-posix::uid-t)
48 (suid sb-posix::uid-t))
49 (define-call "setuid" int minusp (uid sb-posix::uid-t))
51 (define-call "getegid" sb-posix::gid-t not)
52 (define-call "getgid" sb-posix::gid-t not)
53 (define-call "getresgid" sb-posix::gid-t not)
54 (define-call "setegid" int minusp (gid sb-posix::gid-t))
55 #+linux (define-call "setfsgid" int minusp (gid sb-posix::gid-t))
56 (define-call "setgid" int minusp (gid sb-posix::gid-t))
57 (define-call "setregid" int minusp
58 (rgid sb-posix::gid-t) (egid sb-posix::gid-t))
59 (define-call "setresgid" int minusp
60 (rgid sb-posix::gid-t)
61 (egid sb-posix::gid-t) (sgid sb-posix::gid-t))
63 ;;; processes, signals
64 (define-call "alarm" int not (seconds unsigned))
65 (define-call "getpgid" sb-posix::pid-t minusp (pid sb-posix::pid-t))
66 (define-call "getpid" sb-posix::pid-t not)
67 (define-call "getppid" sb-posix::pid-t not)
68 (define-call "getpgrp" sb-posix::pid-t not)
69 (define-call "getsid" sb-posix::pid-t minusp (pid sb-posix::pid-t))
70 (define-call "kill" int minusp (pid sb-posix::pid-t) (signal int))
71 (define-call "killpg" int minusp (pgrp int) (signal int))
72 (define-call "pause" int minusp)
73 (define-call "setpgid" int minusp
74 (pid sb-posix::pid-t) (pgid sb-posix::pid-t))
75 (define-call "setpgrp" int minusp)