X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Funix.lisp;h=7a1a62888c6d29f34fd0457e39aebf85328226de;hb=6d9e2243954872457115bbb9ac1ecb1d161acced;hp=57f531cd9a95a9a4f724bb5f192e8e538198dbbf;hpb=567588a0316e6202e5158b8a9ff773b9e6d03762;p=sbcl.git diff --git a/src/code/unix.lisp b/src/code/unix.lisp index 57f531c..7a1a628 100644 --- a/src/code/unix.lisp +++ b/src/code/unix.lisp @@ -427,9 +427,20 @@ corresponds to NAME, or NIL if there is none." ;;; Terminate the current process with an optional error code. If ;;; successful, the call doesn't return. If unsuccessful, the call ;;; returns NIL and an error number. -(defun unix-exit (&optional (code 0)) - (declare (type (signed-byte 32) code)) - (void-syscall ("exit" int) code)) +(deftype exit-code () + `(signed-byte 32)) +(defun os-exit (code &key abort) + #!+sb-doc + "Exit the process with CODE. If ABORT is true, exit is performed using _exit(2), +avoiding atexit(3) hooks, etc. Otherwise exit(2) is called." + (unless (typep code 'exit-code) + (setf code (if abort 1 0))) + (if abort + (void-syscall ("_exit" int) code) + (void-syscall ("exit" int) code))) + +(define-deprecated-function :early "1.0.56.55" unix-exit os-exit (code) + (os-exit code)) ;;; Return the process id of the current process. (define-alien-routine ("getpid" unix-getpid) int) @@ -976,6 +987,9 @@ corresponds to NAME, or NIL if there is none." (rem-nsec (slot rem 'tv-nsec))) (when (or (> secs rem-sec) (and (= secs rem-sec) (>= nsecs rem-nsec))) + ;; Update for next round. + (setf secs rem-sec + nsecs rem-nsec) t))) do (setf (slot req 'tv-sec) (slot rem 'tv-sec) (slot req 'tv-nsec) (slot rem 'tv-nsec)))))