unix: skip TestIoctlGetRTCWkAlrm if unsupported

Some RTC devices do not support wakeup alarms and will return
EINVAL in such cases. The generic powerpc rtc driver is one such
case.

Fixes golang/go#48554

Change-Id: I46f6da7902586a7fcaa9a367801d9fead288e264
Reviewed-on: https://go-review.googlesource.com/c/sys/+/352090
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: David Chase <drchase@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/unix/syscall_linux_test.go b/unix/syscall_linux_test.go
index dd0fa6a..f5d3966 100644
--- a/unix/syscall_linux_test.go
+++ b/unix/syscall_linux_test.go
@@ -117,6 +117,12 @@
 	defer f.Close()
 
 	v, err := unix.IoctlGetRTCWkAlrm(int(f.Fd()))
+
+	// Not all RTC drivers support wakeup alarms, and will return EINVAL in such cases.
+	if err == unix.EINVAL {
+		t.Skip("RTC_WKALM_RD ioctl not supported on this rtc, skipping test")
+	}
+
 	if err != nil {
 		t.Fatalf("failed to perform ioctl: %v", err)
 	}