ipc

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ipc provides the local, same-user-only transport between stagent processes: Unix domain sockets on Linux/macOS and named pipes on Windows. Nothing here ever listens on TCP.

Index

Constants

This section is empty.

Variables

View Source
var ErrInUse = errors.New("ipc: address already served by a live process")

ErrInUse is returned by Listen when another live process already serves the address (e.g. a second daemon racing the first).

Functions

func Blocked added in v0.7.0

func Blocked(l *paths.Layout) *paths.OwnerError

Blocked reports the stagent location of l that another user owns, so that no daemon or kept shell can work: a directory in a shared temporary directory (paths.Layout.ForeignOwned), or the daemon's socket or named pipe. It returns nil when nothing is blocked. It creates nothing; the daemon address is probed with a Dial that is closed right away.

func Dial

func Dial(addr string, timeout time.Duration) (net.Conn, error)

Dial connects to addr and makes sure the process serving it runs as us: a socket another user created first (e.g. in a shared /tmp/stagent-<uid> they made) is closed unused and reported as a *paths.OwnerError.

func Listen

func Listen(addr string) (net.Listener, error)

Listen serves addr (a socket path). A stale socket file left by a crashed process is removed; a live one yields ErrInUse. The socket is chmod 0600 and every accepted connection is checked to come from the same UID.

func PeerPID added in v0.7.0

func PeerPID(c net.Conn) (int, error)

PeerPID returns the pid of the process that connected c (SO_PEERCRED: the process that called connect, even if it has exited since; 0 when it lives in a pid namespace this process cannot see into).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL