Skip to content

proposal: os/exec: add an API to exec over the current process #18148

Closed
@bcmills

Description

@bcmills

Go programs cannot currently call syscall.Exec safely (see #18146).

However, it is sometimes useful for a Go program to be able to execute some other command without retaining resources (such as memory) for a Go program that has no further work to do. syscall.Exec, although error-prone in Go, is the usual way to do that on a Unix-like platform.

If we can find a way to implement portable Exec-like functionality compatible with the Go runtime, it would be nice to have an API for that as part of the standard library (perhaps in the os/exec package). If it cannot be done portably, perhaps we could add something to x/sys/unix?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions