Skip to content

Commit

Permalink
Make notices about lack of Windows support simpler and consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
mjambon committed Feb 15, 2022
1 parent a3d6224 commit 2554f08
Showing 1 changed file with 14 additions and 38 deletions.
52 changes: 14 additions & 38 deletions otherlibs/unix/unix.mli
Expand Up @@ -230,15 +230,14 @@ 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.
On Windows: not implemented, use {!create_process} or threads.
@raise Invalid_argument on Windows *)
@raise Invalid_argument on Windows. Use {!create_process} or threads
instead. *)

val wait : unit -> int * process_status
(** Wait until one of the children processes die, and return its pid
and termination status.
On Windows: not implemented, use {!waitpid}.
@raise Invalid_argument on Windows *)
@raise Invalid_argument on Windows. Use {!waitpid} instead. *)

val waitpid : wait_flag list -> int -> int * process_status
(** Same as {!wait}, but waits for the child process whose pid is given.
Expand Down Expand Up @@ -289,15 +288,14 @@ val getpid : unit -> int
val getppid : unit -> int
(** Return the pid of the parent process.
On Windows: not implemented (because it is meaningless).
@raise Invalid_argument on Windows *)
@raise Invalid_argument on Windows (because it is
meaningless) *)

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.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

(** {1 Basic file input/output} *)
Expand Down Expand Up @@ -671,26 +669,22 @@ val chmod : string -> file_perm -> unit
val fchmod : file_descr -> file_perm -> unit
(** Change the permissions of an opened file.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

val chown : string -> int -> int -> unit
(** Change the owner uid and owner gid of the named file.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

val fchown : file_descr -> int -> int -> unit
(** Change the owner uid and owner gid of an opened file.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

val umask : int -> int
(** Set the process's file mode creation mask, and return the previous
mask.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

val access : string -> access_permission list -> unit
Expand Down Expand Up @@ -802,7 +796,6 @@ val getcwd : unit -> string
val chroot : string -> unit
(** Change the process root directory.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

type dir_handle
Expand Down Expand Up @@ -837,7 +830,6 @@ val pipe : ?cloexec: (* thwart tools/sync_stdlib_docs *) bool ->
val mkfifo : string -> file_perm -> unit
(** Create a named pipe with the given permissions (see {!umask}).
On Windows: not implemented.
@raise Invalid_argument on Windows *)


Expand Down Expand Up @@ -1135,28 +1127,28 @@ val sigprocmask : sigprocmask_command -> int list -> int list
function redirects to [Thread.sigmask]. I.e., [sigprocmask] only
changes the mask of the current thread.
On Windows: not implemented (no inter-process signals on Windows).
@raise Invalid_argument on Windows *)
@raise Invalid_argument on Windows (no inter-process signals on
Windows) *)

val sigpending : unit -> int list
(** Return the set of blocked signals that are currently pending.
On Windows: not implemented (no inter-process signals on Windows).
@raise Invalid_argument on Windows *)
@raise Invalid_argument on Windows (no inter-process
signals on Windows) *)

val sigsuspend : int list -> unit
(** [sigsuspend sigs] atomically sets the blocked signals to [sigs]
and waits for a non-ignored, non-blocked signal to be delivered.
On return, the blocked signals are reset to their initial value.
On Windows: not implemented (no inter-process signals on Windows).
@raise Invalid_argument on Windows *)
@raise Invalid_argument on Windows (no inter-process signals on
Windows) *)

val pause : unit -> unit
(** Wait until a non-ignored, non-blocked signal is delivered.
On Windows: not implemented (no inter-process signals on Windows).
@raise Invalid_argument on Windows *)
@raise Invalid_argument on Windows (no inter-process signals on
Windows) *)


(** {1 Time functions} *)
Expand Down Expand Up @@ -1215,7 +1207,6 @@ val mktime : tm -> float * tm
val alarm : int -> int
(** Schedule a [SIGALRM] signal after the given number of seconds.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

val sleep : int -> unit
Expand Down Expand Up @@ -1261,7 +1252,6 @@ type interval_timer_status =
val getitimer : interval_timer -> interval_timer_status
(** Return the current status of the given interval timer.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

val setitimer :
Expand All @@ -1275,7 +1265,6 @@ val setitimer :
Setting [s.it_interval] to zero causes the timer to be disabled
after its next expiration.
On Windows: not implemented.
@raise Invalid_argument on Windows *)


Expand All @@ -1294,7 +1283,6 @@ val geteuid : unit -> int
val setuid : int -> unit
(** Set the real user id and effective user id for the process.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

val getgid : unit -> int
Expand All @@ -1310,7 +1298,6 @@ val getegid : unit -> int
val setgid : int -> unit
(** Set the real group id and effective group id for the process.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

val getgroups : unit -> int array
Expand All @@ -1323,7 +1310,6 @@ val setgroups : int array -> unit
(** [setgroups groups] sets the supplementary group IDs for the
calling process. Appropriate privileges are required.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

val initgroups : string -> int -> unit
Expand All @@ -1332,7 +1318,6 @@ val initgroups : string -> int -> unit
which [user] is a member. The additional group [group] is also
added to the list.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

type passwd_entry =
Expand Down Expand Up @@ -1466,7 +1451,6 @@ val socketpair :
See {!set_close_on_exec} for documentation on the [cloexec]
optional argument.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

val accept : ?cloexec: (* thwart tools/sync_stdlib_docs *) bool ->
Expand Down Expand Up @@ -1667,8 +1651,7 @@ val establish_server :
{!Stdlib.close_out} and leave the input channel unclosed,
for reasons explained in {!Unix.in_channel_of_descr}.
On Windows: not implemented (use threads).
@raise Invalid_argument on Windows *)
@raise Invalid_argument on Windows. Use threads instead. *)


(** {1 Host and protocol databases} *)
Expand Down Expand Up @@ -1846,7 +1829,6 @@ val tcgetattr : file_descr -> terminal_io
(** Return the status of the terminal referred to by the given
file descriptor.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

type setattr_when =
Expand All @@ -1864,22 +1846,19 @@ val tcsetattr : file_descr -> setattr_when -> terminal_io -> unit
the output parameters; [TCSAFLUSH], when changing the input
parameters.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

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).
On Windows: not implemented.
@raise Invalid_argument on Windows *)

val tcdrain : file_descr -> unit
(** Waits until all output written on the given file descriptor
has been transmitted.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

type flush_queue =
Expand All @@ -1894,7 +1873,6 @@ val tcflush : file_descr -> flush_queue -> unit
[TCOFLUSH] flushes data written but not transmitted, and
[TCIOFLUSH] flushes both.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

type flow_action =
Expand All @@ -1910,12 +1888,10 @@ val tcflow : file_descr -> flow_action -> unit
[TCIOFF] transmits a STOP character to suspend input,
and [TCION] transmits a START character to restart input.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

val setsid : unit -> int
(** Put the calling process in a new session and detach it from
its controlling terminal.
On Windows: not implemented.
@raise Invalid_argument on Windows *)

0 comments on commit 2554f08

Please sign in to comment.