Files
sys/unix/syscall_illumos_test.go
Nahum Shalman c94f62235c 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>
2021-04-26 08:06:07 +00:00

27 lines
573 B
Go

// 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)
}
}