[gccsdk] [Bug 225] problem with socketpair() function

bugzilla-daemon at riscos.info bugzilla-daemon at riscos.info
Tue May 1 10:10:06 PDT 2012


http://www.riscos.info/bugzilla3/show_bug.cgi?id=225

--- Comment #1 from Chris Gransden <chrisg at care4free.net> 2012-05-01 10:10:05 PDT ---
Turns out RISC OS doesn't support AF_UNIX hence the 'Protocol not supported
error'. Changing 'AF_UNIX' to 'AF_INET' makes it get further but returns an
EINPROGRESS error. It think this is due to the client socket being in
non-blocking connection mode. Removing this call seems to fix it. Below is a
patch to no longer set the client socket to non-blocking mode.

--- libunixlib/netlib/ul_socketpair.c.orig    2012-05-01 18:08:08.000000000
+0100
+++ libunixlib/netlib/ul_socketpair.c    2012-05-01 18:13:58.000000000 +0100
@@ -42,9 +42,6 @@
       return __set_errno (save_errno);
     }

-  /* Put the client socket in non-blocking connecting mode.  */
-  fcntl (fd[1], F_SETFL, fcntl(fd[1], F_GETFL, 0) | O_NDELAY);
-
   len = sizeof(s_in[1]);
   /* accept() : at the listen-side, accept the incoming connection we
generated */
   if (connect (fd[1], (const struct sockaddr *)&s_in[0], sizeof(s_in[0])) < 0
@@ -56,9 +53,6 @@
       return __set_errno (save_errno);
     }

-  /* Reset the client socket to blocking mode */
-  fcntl (fd[1], F_SETFL, fcntl(fd[1], F_GETFL, 0) & ~O_NDELAY);
-

-- 
Configure bugmail: http://www.riscos.info/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.




More information about the gcc mailing list