Module Unix_exts


module Unix_exts: sig .. end
Some POSIX system calls missing in the Unix module

val int_of_file_descr : Unix.file_descr -> int
Return the file descriptor as integer
val file_descr_of_int : int -> Unix.file_descr
Make a file descriptor from an integer
val _exit : int -> unit
Exit the program immediately without running the atexit handlers. The argument is the exit code, just as for exit.
val sysconf_open_max : unit -> int
Return the maximum number of open file descriptor per process. It is also ensured that for every file descriptor fd: fd < sysconf_open_max()
val getpgid : int -> int
Return the process group ID of the process with the passed PID. For the number 0, the process group ID of the current process is returned.
val getpgrp : unit -> int
Same as getpgid 0, i.e. returns the process group ID of the current process.
val setpgid : int -> int -> unit
setpgid pid pgid: Set the process group ID of the process pid to pgid. If pid = 0, the process group ID of the current process is changed. If pgid = 0, as process group ID the process ID of the process referenced by pid is used.

It is only possible for a process to join a process group if both belong to the same session.

val setpgrp : unit -> unit
Same as setpgid 0 0: A new process group ID is created, and the current process becomes its sole member.
val tcgetpgrp : Unix.file_descr -> int
Return the process group ID of the foreground process group of the session associated with the file descriptor, which must be a tty.
val tcsetpgrp : Unix.file_descr -> int -> unit
Sets the foreground process group ID of the session associated with the file descriptor, which must be a tty.
val ctermid : unit -> string
Returns the name of the controlling tty of the current process as pathname to a device file
val ttyname : Unix.file_descr -> string
Returns the name of the controlling tty referred to by the file descriptor.
val getsid : int -> int
Returns the session ID of the process with the passed PID. For the PID 0, the session ID of the current process is returned.
val setreuid : int -> int -> unit
Changes both the real and the effective user ID of the current process.
val setregid : int -> int -> unit
Changes both the real and the effective group ID of the current process.