-
Notifications
You must be signed in to change notification settings - Fork 10
/
pid.mli
46 lines (32 loc) · 1.08 KB
/
pid.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
(** Unique process identification *)
type t = {
host : string; (** machine hostname (no spaces allowed) *)
id : int; (** process id *)
name : string; (** application id (no spaces allowed), for information. *)
stamp : int; (** stamp for uniqueness to guard against pid reuse *)
}
(** dummy instance, use sparingly *)
val dummy : t
(** @return pretty-printed pid (human readable) *)
val show : t -> string
(** @return machine hostname *)
val host : t -> string
(** @return application name *)
val name : t -> string
(** @return string representation of pid, can be read back by [parse_pid_exn] *)
val to_string : t -> string
val make : id:int -> host:string -> stamp:int -> string -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val parse_exn : string -> t
(** {1 Current process identifier} *)
val sanitize_name : string -> string
val set_name : string -> unit
val self : unit -> t
val self_name : unit -> string
val self_as : string -> t
val show_self : unit -> string
(** call this to update Pid.self after fork *)
val update : unit -> unit
(**/**)
val set_fake : t -> unit