mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-31 06:16:41 -04:00
unix: add Klogset and related SYSLOG_ACTION_ constants
Adds a new function: Klogset which wraps sys_syslog for cases where the `bufp` argument is not required and the argument that follows needs to be passed to the function. Fixes golang/go#34672 Change-Id: Idf026791ea9265aaca33e78a34fcd490edb8d326 Reviewed-on: https://go-review.googlesource.com/c/sys/+/199278 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
c178f38b41
commit
aed5e4c7ec
@@ -1851,6 +1851,17 @@ func OpenByHandleAt(mountFD int, handle FileHandle, flags int) (fd int, err erro
|
||||
return openByHandleAt(mountFD, handle.fileHandle, flags)
|
||||
}
|
||||
|
||||
// Klogset wraps the sys_syslog system call; it sets console_loglevel to
|
||||
// the value specified by arg and passes a dummy pointer to bufp.
|
||||
func Klogset(typ int, arg int) (err error) {
|
||||
var p unsafe.Pointer
|
||||
_, _, errno := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(p), uintptr(arg))
|
||||
if errno != 0 {
|
||||
return errnoErr(errno)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
/*
|
||||
* Unimplemented
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user