| Attached Files | unix.patch [^] (14,352 bytes) 2011-04-22 11:19 [Show Content] [Hide Content]=== modified file 'otherlibs/unix/unix.mli'
--- old/otherlibs/unix/unix.mli 2011-03-06 16:26:34 +0000
+++ new/otherlibs/unix/unix.mli 2011-04-22 09:17:28 +0000
@@ -176,11 +176,15 @@
val fork : unit -> int
(** Fork a new process. The returned integer is 0 for the child
- process, the pid of the child process for the parent process. *)
+ process, the pid of the child process for the parent process.
+
+ On Windows: not implemented, use {!create_process} or threads. *)
val wait : unit -> int * process_status
(** Wait until one of the children processes die, and return its pid
- and termination status. *)
+ and termination status.
+
+ On Windows: Not implemented, use {!waitpid}. *)
val waitpid : wait_flag list -> int -> int * process_status
(** Same as {!Unix.wait}, but waits for the child process whose pid is given.
@@ -189,7 +193,9 @@
as the current process.
Negative pid arguments represent process groups.
The list of options indicates whether [waitpid] should return
- immediately without waiting, or also report stopped children. *)
+ immediately without waiting, or also report stopped children.
+
+ On Windows: can only wait for a given PID, not any child process. *)
val system : string -> process_status
(** Execute the given command, wait until it terminates, and return
@@ -202,12 +208,15 @@
(** Return the pid of the process. *)
val getppid : unit -> int
-(** Return the pid of the parent process. *)
+(** Return the pid of the parent process.
+ On windows: not implemented (meaningless under Windows). *)
val nice : int -> int
(** Change the process priority. The integer argument is added to the
``nice'' value. (Higher values of the ``nice'' value mean
- lower priorities.) Return the new nice value. *)
+ lower priorities.) Return the new nice value.
+
+ On windows: not implemented. *)
(** {6 Basic file input/output} *)
@@ -282,7 +291,9 @@
val out_channel_of_descr : file_descr -> out_channel
(** Create an output channel writing on the given descriptor.
The channel is initially in binary mode; use
- [set_binary_mode_out oc false] if text mode is desired. *)
+ [set_binary_mode_out oc false] if text mode is desired.
+
+ On windows: not implemented. *)
val descr_of_in_channel : in_channel -> file_descr
(** Return the descriptor corresponding to an input channel. *)
@@ -305,11 +316,13 @@
(** Set the current position for a file descriptor *)
val truncate : string -> int -> unit
-(** Truncates the named file to the given size. *)
+(** Truncates the named file to the given size.
+ On Windows: not implemented. *)
val ftruncate : file_descr -> int -> unit
(** Truncates the file corresponding to the given descriptor
- to the given size. *)
+ to the given size.
+ On Windows: not implemented. *)
(** {6 File status} *)
@@ -402,7 +415,8 @@
val link : string -> string -> unit
(** [link source dest] creates a hard link named [dest] to the file
- named [source]. *)
+ named [source].
+ On Windows: not implemented (no links under Windows). *)
(** {6 File permissions and ownership} *)
@@ -420,21 +434,28 @@
(** Change the permissions of the named file. *)
val fchmod : file_descr -> file_perm -> unit
-(** Change the permissions of an opened file. *)
+(** Change the permissions of an opened file.
+ On Windows: not implemented. *)
val chown : string -> int -> int -> unit
-(** Change the owner uid and owner gid of the named file. *)
+(** Change the owner uid and owner gid of the named file.
+ On Windows: not implemented (make no sense on a DOS file system). *)
val fchown : file_descr -> int -> int -> unit
-(** Change the owner uid and owner gid of an opened file. *)
+(** Change the owner uid and owner gid of an opened file.
+ On Windows: not implemented (make no sense on a DOS file system). *)
val umask : int -> int
(** Set the process's file mode creation mask, and return the previous
- mask. *)
+ mask.
+ On Windows: not implemented. *)
val access : string -> access_permission list -> unit
(** Check that the process has the given permissions over the named
- file. Raise [Unix_error] otherwise. *)
+ file. Raise [Unix_error] otherwise.
+
+ On Windows: execute permission [X_OK] cannot be tested, it just tests
+ for read permission instead. *)
(** {6 Operations on file descriptors} *)
@@ -454,11 +475,17 @@
on which there is temporarily no data available raises the
[EAGAIN] or [EWOULDBLOCK] error instead of blocking;
writing on a descriptor on which there is temporarily no room
- for writing also raises [EAGAIN] or [EWOULDBLOCK]. *)
+ for writing also raises [EAGAIN] or [EWOULDBLOCK].
+
+ On Windows: implemented as a dummy function; use threads instead of
+ non-blocking I/O. *)
val clear_nonblock : file_descr -> unit
(** Clear the ``non-blocking'' flag on the given descriptor.
- See {!Unix.set_nonblock}.*)
+ See {!Unix.set_nonblock}.
+
+ On Windows: implemented as a dummy function; use threads instead of
+ non-blocking I/O. *)
val set_close_on_exec : file_descr -> unit
(** Set the ``close-on-exec'' flag on the given descriptor.
@@ -500,7 +527,8 @@
@raise End_of_file when the end of the directory has been reached. *)
val rewinddir : dir_handle -> unit
-(** Reposition the descriptor to the beginning of the directory *)
+(** Reposition the descriptor to the beginning of the directory.
+ On Windows: not implemented; re-open the directory instead. *)
val closedir : dir_handle -> unit
(** Close a directory descriptor. *)
@@ -516,7 +544,8 @@
opened for writing, that's the entrance to the pipe. *)
val mkfifo : string -> file_perm -> unit
-(** Create a named pipe with the given permissions. *)
+(** Create a named pipe with the given permissions.
+ On Windows: not implemented. *)
(** {6 High-level process and redirection management} *)
@@ -600,10 +629,12 @@
val symlink : string -> string -> unit
(** [symlink source dest] creates the file [dest] as a symbolic link
- to the file [source]. *)
+ to the file [source].
+ On Windows: not implemented (no links under Windows). *)
val readlink : string -> string
-(** Read the contents of a link. *)
+(** Read the contents of a link.
+ On Windows: not implemented (no links under Windows). *)
(** {6 Polling} *)
@@ -669,7 +700,8 @@
val kill : int -> int -> unit
(** [kill pid sig] sends signal number [sig] to the process
- with id [pid]. *)
+ with id [pid].
+ On Windows: not implemented (no inter-process signals in Windows). *)
type sigprocmask_command =
SIG_SETMASK
@@ -695,7 +727,8 @@
On return, the blocked signals are reset to their initial value. *)
val pause : unit -> unit
-(** Wait until a non-ignored, non-blocked signal is delivered. *)
+(** Wait until a non-ignored, non-blocked signal is delivered.
+ On Windows: not implemented (no inter-process signals in Windows). *)
(** {6 Time functions} *)
@@ -749,13 +782,15 @@
local time zone. *)
val alarm : int -> int
-(** Schedule a [SIGALRM] signal after the given number of seconds. *)
+(** Schedule a [SIGALRM] signal after the given number of seconds.
+ On Windows: not implemented. *)
val sleep : int -> unit
(** Stop execution for the given number of seconds. *)
val times : unit -> process_times
-(** Return the execution times of the process. *)
+(** Return the execution times of the process.
+ On Windows: not implemented. *)
val utimes : string -> float -> float -> unit
(** Set the last access time (second arg) and last modification time
@@ -781,7 +816,8 @@
(** The type describing the status of an interval timer *)
val getitimer : interval_timer -> interval_timer_status
-(** Return the current status of the given interval timer. *)
+(** Return the current status of the given interval timer.
+ On Windows: not implemented. *)
val setitimer :
interval_timer -> interval_timer_status -> interval_timer_status
@@ -792,43 +828,56 @@
be used in reloading it_value when the timer expires.
Setting [s.it_value] to zero disable the timer.
Setting [s.it_interval] to zero causes the timer to be disabled
- after its next expiration. *)
+ after its next expiration.
+
+ On Windows: not implemented. *)
(** {6 User id, group id} *)
val getuid : unit -> int
-(** Return the user id of the user executing the process. *)
+(** Return the user id of the user executing the process.
+ On Windows: always return 1. *)
val geteuid : unit -> int
-(** Return the effective user id under which the process runs. *)
+(** Return the effective user id under which the process runs.
+ On Windows: always return 1. *)
val setuid : int -> unit
-(** Set the real user id and effective user id for the process. *)
+(** Set the real user id and effective user id for the process.
+ On Windows: not implemented. *)
val getgid : unit -> int
-(** Return the group id of the user executing the process. *)
+(** Return the group id of the user executing the process.
+ On Windows: always return 1. *)
val getegid : unit -> int
-(** Return the effective group id under which the process runs. *)
+(** Return the effective group id under which the process runs.
+ On Windows: always return 1. *)
val setgid : int -> unit
-(** Set the real group id and effective group id for the process. *)
+(** Set the real group id and effective group id for the process.
+ On Windows: not implemented. *)
val getgroups : unit -> int array
(** Return the list of groups to which the user executing the process
- belongs. *)
+ belongs.
+ On Windows: always return [[|1|]]. *)
val setgroups : int array -> unit
- (** [setgroups groups] sets the supplementary group IDs for the
- calling process. Appropriate privileges are required. *)
+(** [setgroups groups] sets the supplementary group IDs for the
+ calling process. Appropriate privileges are required.
+
+ On Windows: not implemented. *)
val initgroups : string -> int -> unit
(** [initgroups user group] initializes the group access list by
reading the group database /etc/group and using all groups of
which [user] is a member. The additional group [group] is also
- added to the list. *)
+ added to the list.
+
+ On Windows: not implemented. *)
type passwd_entry =
{ pw_name : string;
@@ -853,20 +902,20 @@
(** Return the login name of the user executing the process. *)
val getpwnam : string -> passwd_entry
-(** Find an entry in [passwd] with the given name, or raise
- [Not_found]. *)
+(** Find an entry in [passwd] with the given name, or raise [Not_found].
+ On Windows: always raise [Not_found]. *)
val getgrnam : string -> group_entry
-(** Find an entry in [group] with the given name, or raise
- [Not_found]. *)
+(** Find an entry in [group] with the given name, or raise [Not_found].
+ On Windows: always raise [Not_found]. *)
val getpwuid : int -> passwd_entry
-(** Find an entry in [passwd] with the given user id, or raise
- [Not_found]. *)
+(** Find an entry in [passwd] with the given user id, or raise [Not_found].
+ On Windows: always raise [Not_found]. *)
val getgrgid : int -> group_entry
-(** Find an entry in [group] with the given group id, or raise
- [Not_found]. *)
+(** Find an entry in [group] with the given group id, or raise [Not_found].
+ On Windows: always raise [Not_found]. *)
(** {6 Internet addresses} *)
@@ -911,7 +960,10 @@
| PF_INET (** Internet domain (IPv4) *)
| PF_INET6 (** Internet domain (IPv6) *)
(** The type of socket domains. Not all platforms support
- IPv6 sockets (type [PF_INET6]). *)
+ IPv6 sockets (type [PF_INET6]).
+
+ On Windows: the domains [PF_UNIX] and [PF_INET6] are not supported;
+ [PF_INET] is fully supported. *)
type socket_type =
SOCK_STREAM (** Stream socket *)
@@ -1093,7 +1145,9 @@
The function given as first argument is called for each connection
with two buffered channels connected to the client. A new process
is created for each connection. The function {!Unix.establish_server}
- never returns normally. *)
+ never returns normally.
+
+ On Windows: not implemented; use threads. *)
(** {6 Host and protocol databases} *)
@@ -1269,7 +1323,8 @@
val tcgetattr : file_descr -> terminal_io
(** Return the status of the terminal referred to by the given
- file descriptor. *)
+ file descriptor.
+ On Windows: not implemented. *)
type setattr_when =
TCSANOW
@@ -1284,16 +1339,20 @@
or after flushing all input that has been received but not
read ([TCSAFLUSH]). [TCSADRAIN] is recommended when changing
the output parameters; [TCSAFLUSH], when changing the input
- parameters. *)
+ parameters.
+
+ On Windows: not implemented. *)
val tcsendbreak : file_descr -> int -> unit
(** Send a break condition on the given file descriptor.
The second argument is the duration of the break, in 0.1s units;
- 0 means standard duration (0.25s). *)
+ 0 means standard duration (0.25s).
+ On Windows: not implemented. *)
val tcdrain : file_descr -> unit
(** Waits until all output written on the given file descriptor
- has been transmitted. *)
+ has been transmitted.
+ On Windows: not implemented. *)
type flush_queue =
TCIFLUSH
@@ -1305,7 +1364,8 @@
transmitted, or data received but not yet read, depending on the
second argument: [TCIFLUSH] flushes data received but not read,
[TCOFLUSH] flushes data written but not transmitted, and
- [TCIOFLUSH] flushes both. *)
+ [TCIOFLUSH] flushes both.
+ On Windows: not implemented. *)
type flow_action =
TCOOFF
@@ -1318,8 +1378,10 @@
the given file descriptor, depending on the second argument:
[TCOOFF] suspends output, [TCOON] restarts output,
[TCIOFF] transmits a STOP character to suspend input,
- and [TCION] transmits a START character to restart input. *)
+ and [TCION] transmits a START character to restart input.
+ On Windows: not implemented. *)
val setsid : unit -> int
(** Put the calling process in a new session and detach it from
- its controlling terminal. *)
+ its controlling terminal.
+ On Windows: not implemented. *)
|