| Attached Files | patchfile [^] (3,296 bytes) 2006-07-09 03:43 [Show Content] [Hide Content]diff -Naur ocaml-3.09.2/otherlibs/threads/threadUnix.mli ocaml-3.09.2-patch/otherlibs/threads/threadUnix.mli
--- ocaml-3.09.2/otherlibs/threads/threadUnix.mli 2004-07-13 08:25:14.000000000 -0400
+++ ocaml-3.09.2-patch/otherlibs/threads/threadUnix.mli 2006-07-08 18:42:12.000000000 -0400
@@ -65,7 +65,7 @@
(** {6 Time} *)
-val sleep : int -> unit
+val sleep : int -> int
(** {6 Sockets} *)
diff -Naur ocaml-3.09.2/otherlibs/threads/unix.ml ocaml-3.09.2-patch/otherlibs/threads/unix.ml
--- ocaml-3.09.2/otherlibs/threads/unix.ml 2005-03-24 12:20:53.000000000 -0500
+++ ocaml-3.09.2-patch/otherlibs/threads/unix.ml 2006-07-08 19:46:54.000000000 -0400
@@ -460,7 +460,10 @@
external mktime : tm -> float * tm = "unix_mktime"
external alarm : int -> int = "unix_alarm"
-let sleep secs = delay (float secs)
+(* the zero return here is to make this function comply
+ with the Unix module definition where the sleep
+ function returns the number of seconds remaining *)
+let sleep secs = delay (float secs);0
external times : unit -> process_times = "unix_times"
external utimes : string -> float -> float -> unit = "unix_utimes"
diff -Naur ocaml-3.09.2/otherlibs/unix/sleep.c ocaml-3.09.2-patch/otherlibs/unix/sleep.c
--- ocaml-3.09.2/otherlibs/unix/sleep.c 2001-12-07 08:40:35.000000000 -0500
+++ ocaml-3.09.2-patch/otherlibs/unix/sleep.c 2006-07-08 18:25:25.000000000 -0400
@@ -20,7 +20,8 @@
CAMLprim value unix_sleep(value t)
{
enter_blocking_section();
- sleep(Int_val(t));
+ int remain;
+ remain = sleep(Int_val(t));
leave_blocking_section();
- return Val_unit;
+ return Int_val(remain);
}
diff -Naur ocaml-3.09.2/otherlibs/unix/unixLabels.mli ocaml-3.09.2-patch/otherlibs/unix/unixLabels.mli
--- ocaml-3.09.2/otherlibs/unix/unixLabels.mli 2004-07-13 08:25:14.000000000 -0400
+++ ocaml-3.09.2-patch/otherlibs/unix/unixLabels.mli 2006-07-08 18:26:19.000000000 -0400
@@ -743,7 +743,7 @@
val alarm : int -> int
(** Schedule a [SIGALRM] signal after the given number of seconds. *)
-val sleep : int -> unit
+val sleep : int -> int
(** Stop execution for the given number of seconds. *)
val times : unit -> process_times
diff -Naur ocaml-3.09.2/otherlibs/unix/unix.ml ocaml-3.09.2-patch/otherlibs/unix/unix.ml
--- ocaml-3.09.2/otherlibs/unix/unix.ml 2005-10-12 10:55:40.000000000 -0400
+++ ocaml-3.09.2-patch/otherlibs/unix/unix.ml 2006-07-08 18:25:41.000000000 -0400
@@ -339,7 +339,7 @@
external localtime : float -> tm = "unix_localtime"
external mktime : tm -> float * tm = "unix_mktime"
external alarm : int -> int = "unix_alarm"
-external sleep : int -> unit = "unix_sleep"
+external sleep : int -> int = "unix_sleep"
external times : unit -> process_times = "unix_times"
external utimes : string -> float -> float -> unit = "unix_utimes"
diff -Naur ocaml-3.09.2/otherlibs/unix/unix.mli ocaml-3.09.2-patch/otherlibs/unix/unix.mli
--- ocaml-3.09.2/otherlibs/unix/unix.mli 2006-03-21 10:50:29.000000000 -0500
+++ ocaml-3.09.2-patch/otherlibs/unix/unix.mli 2006-07-08 18:26:00.000000000 -0400
@@ -746,7 +746,7 @@
val alarm : int -> int
(** Schedule a [SIGALRM] signal after the given number of seconds. *)
-val sleep : int -> unit
+val sleep : int -> int
(** Stop execution for the given number of seconds. *)
val times : unit -> process_times
|