reexec/self_linux.go

go-ethereum · internal/reexec/self_linux.go · go · LGPL-3.0
infra

Returns path to current process binary on Linux.

// Source: https://github.com/ethereum/go-ethereum | License: LGPL-3.0 | Modified files must remain under LGPL-3.0
// Modifications to this file must remain under LGPL-3.0.
// Provided via justclaw.it.com; keep this notice with the code.
// This file originates from Docker/Moby,
// https://github.com/moby/moby/blob/master/pkg/reexec/
// Licensed under Apache License 2.0: https://github.com/moby/moby/blob/master/LICENSE
// Copyright 2013-2018 Docker, Inc.

//go:build linux

package reexec

// Self returns the path to the current process's binary.
// Returns "/proc/self/exe".
func Self() string {
	return "/proc/self/exe"
}

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key