unix/auxv_linux_test.go
raw| 1 | // Copyright 2025 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | //go:build go1.21 && linux |
| 6 | |
| 7 | package unix_test |
| 8 | |
| 9 | import ( |
| 10 | "testing" |
| 11 | |
| 12 | "golang.org/x/sys/unix" |
| 13 | ) |
| 14 | |
| 15 | func TestAuxv(t *testing.T) { |
| 16 | vec, err := unix.Auxv() |
| 17 | if err != nil { |
| 18 | t.Fatalf("unexpected error: %v", err) |
| 19 | } |
| 20 | if len(vec) == 0 { |
| 21 | t.Errorf("got zero auxv entries on linux, expected > 0") |
| 22 | } |
| 23 | } |