mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-03 23:57:32 -04:00
unix: add more illumos Lifreq helpers
This work is in support of wireGuard/wireguard-go#39 Change-Id: Id205d28935b76b49ec6b29aba0a741659c5c01d7 Reviewed-on: https://go-review.googlesource.com/c/sys/+/345610 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Trust: Cherry Mui <cherryyz@google.com>
This commit is contained in:
committed by
Tobias Klauser
parent
164ac21ac1
commit
f475640dd0
@@ -162,6 +162,14 @@ func (l *Lifreq) GetLifruInt() int {
|
||||
return *(*int)(unsafe.Pointer(&l.Lifru[0]))
|
||||
}
|
||||
|
||||
func (l *Lifreq) SetLifruUint(d uint) {
|
||||
*(*uint)(unsafe.Pointer(&l.Lifru[0])) = d
|
||||
}
|
||||
|
||||
func (l *Lifreq) GetLifruUint() uint {
|
||||
return *(*uint)(unsafe.Pointer(&l.Lifru[0]))
|
||||
}
|
||||
|
||||
func IoctlLifreq(fd int, req uint, l *Lifreq) error {
|
||||
return ioctl(fd, req, uintptr(unsafe.Pointer(l)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user