diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-05 17:40:32 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-05 17:40:32 +0900 |
| commit | ae7b343cde93bf59d2e3c7f6316d41c1474dd081 (patch) | |
| tree | 5f07c90b493f38fe238c347ab2eb121d5350e81c /hst/config.go | |
| parent | a63a372fe07a35fc355f54e72bbace47f157406c (diff) | |
hst: reword and move constants
These values are considered part of the stable, exported API, so move them to hst.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst/config.go')
| -rw-r--r-- | hst/config.go | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/hst/config.go b/hst/config.go index 4fd3fa96..7f6b079c 100644 --- a/hst/config.go +++ b/hst/config.go @@ -12,10 +12,20 @@ const Tmp = "/.hakurei" var AbsTmp = container.MustAbs(Tmp) const ( - // DefaultWaitDelay is used when WaitDelay has its zero value. - DefaultWaitDelay = 5 * time.Second - // MaxWaitDelay is used if WaitDelay exceeds its value. - MaxWaitDelay = 30 * time.Second + // WaitDelayDefault is used when WaitDelay has its zero value. + WaitDelayDefault = 5 * time.Second + // WaitDelayMax is used if WaitDelay exceeds its value. + WaitDelayMax = 30 * time.Second + + // IdentityMin is the minimum value of [Config.Identity]. This is enforced by cmd/hsu. + IdentityMin = 0 + // IdentityMax is the maximum value of [Config.Identity]. This is enforced by cmd/hsu. + IdentityMax = 9999 + + // ShimExitRequest is returned when the priv side process requests shim exit. + ShimExitRequest = 254 + // ShimExitOrphan is returned when the shim is orphaned before priv side delivers a signal. + ShimExitOrphan = 3 ) type ( @@ -69,8 +79,8 @@ type ( Hostname string `json:"hostname,omitempty"` // Duration in nanoseconds to wait for after interrupting the initial process. - // Defaults to [DefaultWaitDelay] if less than or equals to zero, - // or [MaxWaitDelay] if greater than [MaxWaitDelay]. + // Defaults to [WaitDelayDefault] if less than or equals to zero, + // or [WaitDelayMax] if greater than [WaitDelayMax]. WaitDelay time.Duration `json:"wait_delay,omitempty"` // Emit Flatpak-compatible seccomp filter programs. |
