aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/proc/priv/init/early.go
blob: cc1c2f7ea0bbd71bba7fce6db1f7948d9c99f1c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package init0

import (
	"os"
	"path"

	"git.gensokyo.uk/security/fortify/internal/fmsg"
)

// used by the parent process

// TryArgv0 calls [Main] if argv0 indicates the process is started from a file named "init".
func TryArgv0() {
	if len(os.Args) > 0 && path.Base(os.Args[0]) == "init" {
		Main()
		fmsg.Exit(0)
	}
}