github.com/ericwq/aprilsh@v0.0.0-20240517091432-958bc568daa0/util/utmp_unix.go (about) 1 // Copyright 2022~2023 wangqi. All rights reserved. 2 // Use of this source code is governed by a MIT-style 3 // license that can be found in the LICENSE file. 4 5 //go:build linux || freebsd 6 7 package util 8 9 // https://blog.csdn.net/sg_knight/article/details/134373559 10 // func AddUtmpx(pts *os.File, host string) bool { 11 // return utmp.UtmpxAddRecord(pts, host) 12 // } 13 // 14 // func ClearUtmpx(pts *os.File) bool { 15 // return utmp.UtmpxRemoveRecord(pts) 16 // } 17 // 18 // func UpdateLastLog(line, userName, host string) bool { 19 // return utmp.PutLastlogEntry(line, userName, host) 20 // }