diff options
Diffstat (limited to 'src/sd_daemon/listen_fds.go')
-rw-r--r-- | src/sd_daemon/listen_fds.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sd_daemon/listen_fds.go b/src/sd_daemon/listen_fds.go index 45ef699..fbd2247 100644 --- a/src/sd_daemon/listen_fds.go +++ b/src/sd_daemon/listen_fds.go @@ -13,8 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package activation implements primitives for systemd socket activation. -package sd_daemon +package sd import ( "os" @@ -25,6 +24,15 @@ import ( //#include <systemd/sd-daemon.h> import "C" +// Returns a list of file descriptors passed in by the service manager +// as part of the socket-based activation logic. +// +// If unsetEnv is true, then (regarless of whether the function call +// itself succeeds or not) it will unset the environmental variables +// LISTEN_FDS and LISTEN_PID, which will cause further calls to this +// function to fail. +// +// In the case of an error, this function returns nil. func ListenFds(unsetEnv bool) []*os.File { if unsetEnv { defer os.Unsetenv("LISTEN_PID") |