summaryrefslogtreecommitdiff
path: root/otherlibs/unix
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix')
-rw-r--r--otherlibs/unix/access.c2
-rw-r--r--otherlibs/unix/signals.c8
-rw-r--r--otherlibs/unix/unix.mli3
-rw-r--r--otherlibs/unix/unixLabels.mli21
4 files changed, 16 insertions, 18 deletions
diff --git a/otherlibs/unix/access.c b/otherlibs/unix/access.c
index d7065c68ee..0c0c5fc1a3 100644
--- a/otherlibs/unix/access.c
+++ b/otherlibs/unix/access.c
@@ -31,7 +31,7 @@
# else
# define R_OK 4/* test for read permission */
# define W_OK 2/* test for write permission */
-# define X_OK 1/* test for execute (search) permission */
+# define X_OK 4/* test for execute permission - not implemented in Win32 */
# define F_OK 0/* test for presence of file */
# endif
#endif
diff --git a/otherlibs/unix/signals.c b/otherlibs/unix/signals.c
index b244f8af64..c388b13936 100644
--- a/otherlibs/unix/signals.c
+++ b/otherlibs/unix/signals.c
@@ -24,7 +24,7 @@
#include "unixsupport.h"
#ifndef NSIG
-#define NSIG 32
+#define NSIG 64
#endif
#ifdef POSIX_SIGNALS
@@ -33,7 +33,7 @@ static void decode_sigset(value vset, sigset_t * set)
{
sigemptyset(set);
while (vset != Val_int(0)) {
- int sig = convert_signal_number(Int_val(Field(vset, 0)));
+ int sig = caml_convert_signal_number(Int_val(Field(vset, 0)));
sigaddset(set, sig);
vset = Field(vset, 1);
}
@@ -46,9 +46,9 @@ static value encode_sigset(sigset_t * set)
Begin_root(res)
for (i = 1; i < NSIG; i++)
- if (sigismember(set, i)) {
+ if (sigismember(set, i) > 0) {
value newcons = alloc_small(2, 0);
- Field(newcons, 0) = Val_int(i);
+ Field(newcons, 0) = Val_int(caml_rev_convert_signal_number(i));
Field(newcons, 1) = res;
res = newcons;
}
diff --git a/otherlibs/unix/unix.mli b/otherlibs/unix/unix.mli
index daa3c9d9de..c131ab114e 100644
--- a/otherlibs/unix/unix.mli
+++ b/otherlibs/unix/unix.mli
@@ -755,7 +755,8 @@ val times : unit -> process_times
val utimes : string -> float -> float -> unit
(** Set the last access time (second arg) and last modification time
(third arg) for a file. Times are expressed in seconds from
- 00:00:00 GMT, Jan. 1, 1970. *)
+ 00:00:00 GMT, Jan. 1, 1970. A time of [0.0] is interpreted as the
+ current time. *)
type interval_timer =
ITIMER_REAL
diff --git a/otherlibs/unix/unixLabels.mli b/otherlibs/unix/unixLabels.mli
index 1f081c81fc..4209739753 100644
--- a/otherlibs/unix/unixLabels.mli
+++ b/otherlibs/unix/unixLabels.mli
@@ -385,7 +385,7 @@ module LargeFile :
end
(** This sub-module provides 64-bit variants of the functions
{!UnixLabels.lseek} (for positioning a file descriptor),
- {!UnixLabels.truncate} and {!UnixLabels.ftruncate}
+ {!UnixLabels.truncate} and {!UnixLabels.ftruncate}
(for changing the size of a file),
and {!UnixLabels.stat}, {!UnixLabels.lstat} and {!UnixLabels.fstat}
(for obtaining information on files). These alternate functions represent
@@ -578,23 +578,23 @@ val open_process_full :
and standard error of the command. *)
val close_process_in : in_channel -> process_status
-(** Close channels opened by {!UnixLabels.open_process_in},
+(** Close channels opened by {!UnixLabels.open_process_in},
wait for the associated command to terminate,
and return its termination status. *)
val close_process_out : out_channel -> process_status
-(** Close channels opened by {!UnixLabels.open_process_out},
+(** Close channels opened by {!UnixLabels.open_process_out},
wait for the associated command to terminate,
and return its termination status. *)
val close_process : in_channel * out_channel -> process_status
-(** Close channels opened by {!UnixLabels.open_process},
+(** Close channels opened by {!UnixLabels.open_process},
wait for the associated command to terminate,
and return its termination status. *)
val close_process_full :
in_channel * out_channel * in_channel -> process_status
-(** Close channels opened by {!UnixLabels.open_process_full},
+(** Close channels opened by {!UnixLabels.open_process_full},
wait for the associated command to terminate,
and return its termination status. *)
@@ -664,9 +664,7 @@ val kill : pid:int -> signal:int -> unit
(** [kill pid sig] sends signal number [sig] to the process
with id [pid]. *)
-
-type sigprocmask_command =
- Unix.sigprocmask_command =
+type sigprocmask_command = Unix.sigprocmask_command =
SIG_SETMASK
| SIG_BLOCK
| SIG_UNBLOCK
@@ -970,11 +968,11 @@ val getsockname : file_descr -> sockaddr
val getpeername : file_descr -> sockaddr
(** Return the address of the host connected to the given socket. *)
-type msg_flag = Unix.msg_flag =
+type msg_flag = Unix.msg_flag =
MSG_OOB
| MSG_DONTROUTE
| MSG_PEEK
-(** The flags for {!UnixLabels.recv}, {!UnixLabels.recvfrom},
+(** The flags for {!UnixLabels.recv}, {!UnixLabels.recvfrom},
{!UnixLabels.send} and {!UnixLabels.sendto}. *)
val recv :
@@ -1311,8 +1309,7 @@ val tcflush : file_descr -> mode:flush_queue -> unit
[TCOFLUSH] flushes data written but not transmitted, and
[TCIOFLUSH] flushes both. *)
-type flow_action =
- Unix.flow_action =
+type flow_action = Unix.flow_action =
TCOOFF
| TCOON
| TCIOFF