mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-02 23:27:31 -04:00
unix: add more illumos ioctl wrappers
Expose Strioctl and Lifreq structs Add helpers for working with them Add additional wrapper functions This work is in support of wireGuard/wireguard-go#39 Change-Id: I7a4d919f986ec977e2cd393eaf237d8c43bbc1cb Reviewed-on: https://go-review.googlesource.com/c/sys/+/302831 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Trust: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
09eb48e85f
commit
c94f62235c
@@ -0,0 +1,26 @@
|
||||
// Copyright 2021 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build illumos
|
||||
// +build illumos
|
||||
|
||||
package unix_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func TestLifreqSetName(t *testing.T) {
|
||||
var l unix.Lifreq
|
||||
err := l.SetName("12345678901234356789012345678901234567890")
|
||||
if err == nil {
|
||||
t.Fatal(`Lifreq.SetName should reject names that are too long`)
|
||||
}
|
||||
err = l.SetName("tun0")
|
||||
if err != nil {
|
||||
t.Errorf(`Lifreq.SetName("tun0") failed: %v`, err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user