| // Copyright 2018 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. |
| func TestPpoll(t *testing.T) { |
| const timeout = 100 * time.Millisecond |
| case <-time.After(10 * timeout): |
| t.Errorf("Ppoll: failed to timeout after %d", 10*timeout) |
| fds := []unix.PollFd{{Fd: int32(f.Fd()), Events: unix.POLLIN}} |
| timeoutTs := unix.NsecToTimespec(int64(timeout)) |
| n, err := unix.Ppoll(fds, &timeoutTs, nil) |
| t.Errorf("Ppoll: unexpected error: %v", err) |
| t.Errorf("Ppoll: wrong number of events: got %v, expected %v", n, 0) |
| func TestSysctlUvmexp(t *testing.T) { |
| uvm, err := unix.SysctlUvmexp("vm.uvmexp") |
| t.Logf("free = %v", uvm.Free) |