1 // Copyright 2018 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.
11 "golang.org/x/sys/unix"
14 func TestPpoll(t *testing.T) {
16 f, cleanup := mktmpfifo(t)
19 const timeout = 100 * time.Millisecond
21 ok := make(chan bool, 1)
24 case <-time.After(10 * timeout):
25 t.Errorf("Ppoll: failed to timeout after %d", 10*timeout)
30 fds := []unix.PollFd{{Fd: int32(f.Fd()), Events: unix.POLLIN}}
31 timeoutTs := unix.NsecToTimespec(int64(timeout))
32 n, err := unix.Ppoll(fds, &timeoutTs, nil)
35 t.Errorf("Ppoll: unexpected error: %v", err)
39 t.Errorf("Ppoll: wrong number of events: got %v, expected %v", n, 0)
44 func TestSysctlUvmexp(t *testing.T) {
45 uvm, err := unix.SysctlUvmexp("vm.uvmexp")
49 t.Logf("free = %v", uvm.Free)