tailscale.comtailscale.com/util/pidowner Index | Files

package pidowner

import "tailscale.com/util/pidowner"

Package pidowner handles lookups from process ID to its owning user.

Index

Variables

var ErrNotImplemented = errors.New("not implemented for GOOS=" + runtime.GOOS)
var ErrProcessNotFound = errors.New("process not found")

Functions

func OwnerOfPID

func OwnerOfPID(pid int) (userID string, err error)

OwnerOfPID returns the user ID that owns the given process ID.

The returned user ID is suitable to passing to os/user.LookupId.

The returned error will be ErrNotImplemented for operating systems where this isn't supported.

Source Files

pidowner.go pidowner_linux.go

Version
v1.84.0 (latest)
Published
May 21, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
1 day ago

Tools for package owners.