THRIFT-5818: Add AIX support
Client: go

Splits recvfrom() into AIX and non-AIX variants because AIX's non-blocking
flag doesn't match other platforms.
diff --git a/lib/go/thrift/socket_aix_syscall.go b/lib/go/thrift/socket_aix_syscall.go
new file mode 100644
index 0000000..2253f75
--- /dev/null
+++ b/lib/go/thrift/socket_aix_syscall.go
@@ -0,0 +1,29 @@
+//go:build aix
+// +build aix
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package thrift
+
+import "syscall"
+
+func peekNonblocking(fd int, p []byte) (int, syscall.Sockaddr, error) {
+	return syscall.Recvfrom(fd, p, syscall.MSG_PEEK|syscall.MSG_NONBLOCK)
+}
diff --git a/lib/go/thrift/socket_non_aix_syscall.go b/lib/go/thrift/socket_non_aix_syscall.go
new file mode 100644
index 0000000..523f356
--- /dev/null
+++ b/lib/go/thrift/socket_non_aix_syscall.go
@@ -0,0 +1,29 @@
+//go:build !aix && !windows && !wasm
+// +build !aix,!windows,!wasm
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package thrift
+
+import "syscall"
+
+func peekNonblocking(fd int, p []byte) (int, syscall.Sockaddr, error) {
+	return syscall.Recvfrom(fd, p, syscall.MSG_PEEK|syscall.MSG_DONTWAIT)
+}
diff --git a/lib/go/thrift/socket_unix_conn.go b/lib/go/thrift/socket_unix_conn.go
index ac0dce9..c06e0e1 100644
--- a/lib/go/thrift/socket_unix_conn.go
+++ b/lib/go/thrift/socket_unix_conn.go
@@ -58,7 +58,7 @@
 	var n int
 
 	if readErr := rc.Read(func(fd uintptr) bool {
-		n, _, err = syscall.Recvfrom(int(fd), sc.buffer[:], syscall.MSG_PEEK|syscall.MSG_DONTWAIT)
+		n, _, err = peekNonblocking(int(fd), sc.buffer[:])
 		return true
 	}); readErr != nil {
 		return readErr