sig
exception Fatal_error of exn
type environment
val create_env : unit -> Shell_sys.environment
val current_env : unit -> Shell_sys.environment
val copy_env : Shell_sys.environment -> Shell_sys.environment
val set_env : Shell_sys.environment -> string array -> unit
val get_env : Shell_sys.environment -> string array
val iter_env : f:(string -> unit) -> Shell_sys.environment -> unit
val set_env_var : Shell_sys.environment -> string -> string -> unit
val get_env_var : Shell_sys.environment -> string -> string
val iter_env_vars :
f:(string -> string -> unit) -> Shell_sys.environment -> unit
type command
val command :
?cmdname:string ->
?arguments:string array ->
?chdir:string ->
?environment:Shell_sys.environment ->
?descriptors:Unix.file_descr list ->
?assignments:(Unix.file_descr * Unix.file_descr) list ->
filename:string -> unit -> Shell_sys.command
exception Executable_not_found of string
val lookup_executable : ?path:string list -> string -> string
val get_cmdname : Shell_sys.command -> string
val get_arguments : Shell_sys.command -> string array
val get_chdir : Shell_sys.command -> string option
val get_environment : Shell_sys.command -> Shell_sys.environment
val get_descriptors : Shell_sys.command -> Unix.file_descr list
val get_assignments :
Shell_sys.command -> (Unix.file_descr * Unix.file_descr) list
val get_filename : Shell_sys.command -> string
val set_cmdname : Shell_sys.command -> string -> unit
val set_arguments : Shell_sys.command -> string array -> unit
val set_chdir : Shell_sys.command -> string option -> unit
val set_environment : Shell_sys.command -> Shell_sys.environment -> unit
val set_descriptors : Shell_sys.command -> Unix.file_descr list -> unit
val set_assignments :
Shell_sys.command -> (Unix.file_descr * Unix.file_descr) list -> unit
val set_filename : Shell_sys.command -> string -> unit
val copy_command : Shell_sys.command -> Shell_sys.command
val is_executable : Shell_sys.command -> bool
type process
type group_action =
New_bg_group
| New_fg_group
| Join_group of int
| Current_group
val run :
?group:Shell_sys.group_action ->
?pipe_assignments:(Unix.file_descr * Unix.file_descr) list ->
Shell_sys.command -> Shell_sys.process
val process_id : Shell_sys.process -> int
val status : Shell_sys.process -> Unix.process_status
val command_of_process : Shell_sys.process -> Shell_sys.command
type process_event =
File_read of Unix.file_descr
| File_write of Unix.file_descr
| File_except of Unix.file_descr
| Process_event of Shell_sys.process
| Signal
val wait :
?wnohang:bool ->
?wuntraced:bool ->
?restart:bool ->
?check_interval:float ->
?read:Unix.file_descr list ->
?write:Unix.file_descr list ->
?except:Unix.file_descr list ->
Shell_sys.process list -> Shell_sys.process_event list
val call : Shell_sys.command -> Shell_sys.process
val kill : ?signal:int -> Shell_sys.process -> unit
type system_handler = {
sys_register :
?wuntraced:bool ->
?check_interval:float ->
?read:Unix.file_descr list ->
?write:Unix.file_descr list ->
?except:Unix.file_descr list ->
Shell_sys.process list ->
(Shell_sys.process_event list -> unit) -> unit;
sys_wait : unit -> unit;
}
type job
type job_instance
val new_job : unit -> Shell_sys.job
val add_command : Shell_sys.command -> Shell_sys.job -> unit
val add_pipeline :
?bidirectional:bool ->
?src_descr:Unix.file_descr ->
?dest_descr:Unix.file_descr ->
src:Shell_sys.command -> dest:Shell_sys.command -> Shell_sys.job -> unit
val add_producer :
?descr:Unix.file_descr ->
producer:(Unix.file_descr -> bool) ->
Shell_sys.command -> Shell_sys.job -> unit
val from_string :
?pos:int ->
?len:int -> ?epipe:(unit -> unit) -> string -> Unix.file_descr -> bool
val from_stream :
?epipe:(unit -> unit) -> string Stream.t -> Unix.file_descr -> bool
val add_consumer :
?descr:Unix.file_descr ->
consumer:(Unix.file_descr -> bool) ->
Shell_sys.command -> Shell_sys.job -> unit
val to_buffer : Buffer.t -> Unix.file_descr -> bool
type group_mode = Same_as_caller | Foreground | Background
val run_job :
?mode:Shell_sys.group_mode ->
?forward_signals:bool -> Shell_sys.job -> Shell_sys.job_instance
val register_job :
Shell_sys.system_handler -> Shell_sys.job_instance -> unit
val finish_job :
?sys:Shell_sys.system_handler -> Shell_sys.job_instance -> unit
val call_job :
?mode:Shell_sys.group_mode ->
?forward_signals:bool ->
?onerror:(Shell_sys.job_instance -> unit) ->
Shell_sys.job -> Shell_sys.job_instance
val processes : Shell_sys.job_instance -> Shell_sys.process list
exception No_Unix_process_group
val process_group_leader : Shell_sys.job_instance -> Shell_sys.process
val process_group_id : Shell_sys.job_instance -> int
val process_group_expects_signals : Shell_sys.job_instance -> bool
type job_status =
Job_running
| Job_partially_running
| Job_ok
| Job_error
| Job_abandoned
val job_status : Shell_sys.job_instance -> Shell_sys.job_status
val kill_process_group : ?signal:int -> Shell_sys.job_instance -> unit
val kill_processes : ?signal:int -> Shell_sys.job_instance -> unit
val abandon_job : ?signal:int -> Shell_sys.job_instance -> unit
val iter_job_instances : f:(Shell_sys.job_instance -> unit) -> unit
val watch_for_zombies : unit -> unit
exception Already_installed
val configure_job_handlers :
?catch_sigint:bool ->
?catch_sigquit:bool ->
?catch_sigterm:bool ->
?catch_sighup:bool ->
?catch_sigchld:bool -> ?set_sigpipe:bool -> ?at_exit:bool -> unit -> unit
val install_job_handlers : unit -> unit
val init_mt : (unit -> (unit -> unit) * (unit -> unit)) -> unit
end