-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
24 lines (16 loc) · 840 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(Note: this code is unmaintained, and may not build with the latest version of
go.)
Procfs.go allows you to interface (read-only) with procfs from go programs. The
simplest usage is to create a ProcFS object and call the Fill() method:
var pfs procfs.ProcFS
pfs.Fill()
This can be somewhat slow (50ms on a 2GHz processor), so if you only want a
certain part of the structure, you can ask just for that
pfs.Get(PROCFS_MOUNTS) // get the list of mounts in pfs.Mounts
pfs.List(PROCFS_PROCESSES) // fill in stub processes in pfs.Processes
pfs.Get(PROCFS_SELF) // find our process id
pfs.Processes[pfs.Self].Fill() // fill in all information for our own process
Procfs.go is goinstallable with
goinstall github.com/bytbox/procfs.go/procfs
A jsonrpc daemon is also provided in procd, providing a network frontend to
procfs.