Skip to content

Commit 1eb1197

Browse files
committed
Only expose pgid in setpgid
1 parent ecbe2b8 commit 1eb1197

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

lib_eio/unix/fork_action.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ let inherit_fds m =
7272
external action_setpgid : unit -> fork_fn = "eio_unix_fork_setpgid"
7373
let action_setpgid = action_setpgid ()
7474

75-
let setpgid ~pid ~pgid =
76-
{ run = fun k -> k (Obj.repr (action_setpgid, pid, pgid)) }
75+
let setpgid pgid =
76+
{ run = fun k -> k (Obj.repr (action_setpgid, 0, pgid)) }

lib_eio/unix/fork_action.mli

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ val inherit_fds : (int * Fd.t * [< blocking]) list -> t
5959
6060
After this, the new FDs may also be set as blocking or non-blocking, depending on [flags]. *)
6161

62-
val setpgid : pid:int -> pgid:int -> t
63-
(** [setpgid ~pid ~pgid] sets the process group ID to [pgid] for the process [pid].
62+
val setpgid : int -> t
63+
(** [setpgid pgid] sets the child's process group ID to [pgid].
6464
65-
If [pid] is [0] then the process ID of the calling process shall be used. *)
65+
If [pgid] is [0] the child's process ID will be used as the PGID, placing
66+
the child in a {e new} process group. *)

lib_eio_linux/eio_linux.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ module Process_mgr = struct
226226
] in
227227
let actions = match pgid with
228228
| None -> actions
229-
| Some pgid -> Eio_unix.Private.Fork_action.setpgid ~pid:0 ~pgid :: actions
229+
| Some pgid -> Eio_unix.Private.Fork_action.setpgid pgid :: actions
230230
in
231231
let with_actions cwd fn = match cwd with
232232
| None -> fn actions

lib_eio_posix/process.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module Impl = struct
3030
] in
3131
let actions = match pgid with
3232
| None -> actions
33-
| Some pgid -> Low_level.Process.Fork_action.setpgid ~pid:0 ~pgid :: actions
33+
| Some pgid -> Low_level.Process.Fork_action.setpgid pgid :: actions
3434
in
3535
let with_actions cwd fn = match cwd with
3636
| None -> fn actions

0 commit comments

Comments
 (0)