Skip to content

Commit 6521eb1

Browse files
committed
exec.go
1 parent b8fc6bb commit 6521eb1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

agent/agentexec/exec.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ func CommandContext(ctx context.Context, cmd string, args ...string) (*exec.Cmd,
3434
return exec.CommandContext(ctx, cmd, args...), nil
3535
}
3636

37+
// PTYCommandContext returns an pty.Cmd that calls "coder agent-exec" prior to exec'ing
38+
// the provided command if CODER_PROC_PRIO_MGMT is set, otherwise a normal pty.Cmd
39+
// is returned. All instances of pty.Cmd should flow through this function to ensure
40+
// proper resource constraints are applied to the child process.
3741
func PTYCommandContext(ctx context.Context, cmd string, args ...string) (*pty.Cmd, error) {
3842
cmd, args, err := agentExecCmd(cmd, args...)
3943
if err != nil {

0 commit comments

Comments
 (0)