Tuesday, 1 May 2012

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

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

--- Comment #1 from Chris Gransden <chrisg@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.

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment