]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
nonblock: restore setsockopt method to curlx_nonblock
authorDon <don.j.olmstead@gmail.com>
Tue, 8 Mar 2022 18:44:34 +0000 (10:44 -0800)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 9 Mar 2022 08:13:42 +0000 (09:13 +0100)
The implementation using setsockopt was removed when BeOS support was
purged. However this functionality wasn't BeOS specific, it is still
used by for example Orbis OS (Playstation 4/5 OS).

Closes #8562

lib/nonblock.c

index 92fb22ec2298acee7ac1471b384f5d545958454d..28f6e7588147143e64824aa0dba09ac0bee0bf48 100644 (file)
@@ -73,6 +73,12 @@ int curlx_nonblock(curl_socket_t sockfd,    /* operate on this */
   long flags = nonblock ? 1L : 0L;
   return IoctlSocket(sockfd, FIONBIO, (char *)&flags);
 
+#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)
+
+  /* Orbis OS */
+  long b = nonblock ? 1L : 0L;
+  return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
+
 #else
 #  error "no non-blocking method was found/used/set"
 #endif