// Copyright 2026 The Gitea Authors. All rights reserved. // SPDX-License-Identifier: MIT package process import ( "os" "strconv" ) func listPIDs() ([]int, error) { entries, err := os.ReadDir("/proc") if err != nil { return nil, err } var pids []int for _, entry := range entries { if pid, err := strconv.Atoi(entry.Name()); err == nil { pids = append(pids, pid) } } return pids, nil } func environment(pid int) ([]byte, error) { return os.ReadFile("/proc/" + strconv.Itoa(pid) + "/environ") }