1.0.43.63: storing function documentation under names as well
[sbcl.git] / src / code / unix.lisp
index 47eba3d..ae5875f 100644 (file)
@@ -156,12 +156,13 @@ corresponds to NAME, or NIL if there is none."
   (declare (type unix-pathname path)
            (type fixnum flags)
            (type unix-file-mode mode))
-  (int-syscall ("open" c-string int int)
-               path
-               (logior #!+win32 o_binary
-                       #!+largefile o_largefile
-                       flags)
-               mode))
+  (with-restarted-syscall (value errno)
+    (int-syscall ("open" c-string int int)
+                 path
+                 (logior #!+win32 o_binary
+                         #!+largefile o_largefile
+                         flags)
+                 mode)))
 
 ;;; UNIX-CLOSE accepts a file descriptor and attempts to close the file
 ;;; associated with it.
@@ -926,9 +927,16 @@ corresponds to NAME, or NIL if there is none."
                      ;; return with EINT and (unsigned)-1 seconds in the
                      ;; remainder timespec, which would cause us to enter
                      ;; nanosleep again for ~136 years. So, we check that the
-                     ;; remainder time is actually decreasing. Since the cost
-                     ;; of this check is neglible, do it on all platforms.
-                     ;; http://osdir.com/ml/darwin-kernel/2010-03/msg00007.html
+                     ;; remainder time is actually decreasing.
+                     ;;
+                     ;; It would be neat to do this bit of defensive
+                     ;; programming on all platforms, but unfortunately on
+                     ;; Linux, REM can be a little higher than REQ if the
+                     ;; nanosleep() call is interrupted quickly enough,
+                     ;; probably due to the request being rounded up to the
+                     ;; nearest HZ. This would cause the sleep to return way
+                     ;; too early.
+                     #!+darwin
                      (let ((rem-sec (slot rem 'tv-sec))
                            (rem-nsec (slot rem 'tv-nsec)))
                        (when (or (> secs rem-sec)