浏览文件
bootsession_darwin.go
13 行 · 420 B历史下载| 1 | // SPDX-FileCopyrightText: Copyright The Lima Authors |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | package osutil |
| 5 | |
| 6 | import "golang.org/x/sys/unix" |
| 7 | |
| 8 | // BootSessionID returns an identifier of the current boot of the host. |
| 9 | // The identifier changes on every reboot, so it can be used to detect state that was left |
| 10 | // behind by a previous boot. |
| 11 | func BootSessionID() (string, error) { |
| 12 | return unix.Sysctl("kern.bootsessionuuid") |
| 13 | } |

