Use utmp APIs rather than utmpx to be more portable

This commit is contained in:
Russ Magee 2018-06-29 14:36:31 -07:00
parent 9047cf4dd3
commit bdf19c1664
2 changed files with 17 additions and 18 deletions

View file

@ -1,14 +1,15 @@
package main
import (
"blitter.com/go/goutmp"
"blitter.com/go/goutmp"
"time"
)
func main() {
user := "bin"
host := "test.example.com"
utmp := goutmp.Put_utmp(user, host)
goutmp.Put_lastlog_entry("hkexsh", user, host)
goutmp.Unput_utmp(utmp)
user := "bin"
host := "test.example.com"
utmp := goutmp.Put_utmp(user, host)
goutmp.Put_lastlog_entry("hkexsh", user, host)
time.Sleep(10 * time.Second)
goutmp.Unput_utmp(utmp)
}