| 1 |
From: Shengjing Zhu <[email protected]> |
| 2 |
Date: Fri, 18 Aug 2023 13:30:45 +0800 |
| 3 |
Subject: Skip TestLinuxOpenPIDFD when PIDFD_NONBLOCK not implemented |
| 4 |
|
| 5 |
PIDFD_NONBLOCK is added in Linux 5.10 |
| 6 |
--- |
| 7 |
conn_linux_test.go | 3 +++ |
| 8 |
1 file changed, 3 insertions(+) |
| 9 |
|
| 10 |
diff --git a/conn_linux_test.go b/conn_linux_test.go |
| 11 |
index 00a7a6d..8a48d90 100644 |
| 12 |
--- a/conn_linux_test.go |
| 13 |
+++ b/conn_linux_test.go |
| 14 |
@@ -168,6 +168,9 @@ func TestLinuxOpenPIDFD(t *testing.T) { |
| 15 |
// ENOTSOCK, as is the case with pidfds. |
| 16 |
fd, err := unix.PidfdOpen(1, unix.PIDFD_NONBLOCK) |
| 17 |
if err != nil { |
| 18 |
+ if errors.Is(err, unix.EINVAL) { |
| 19 |
+ t.Skipf("skipping, PIDFD_NONBLOCK is not implemented: %v", err) |
| 20 |
+ } |
| 21 |
t.Fatalf("failed to open pidfd for init: %v", err) |
| 22 |
} |
| 23 |
|