Socket fixes

Peter Naulls peter at chocky.org
Fri Aug 2 14:55:06 PDT 2002


Socket_Ioctl takes the address as the 3rd parameter, not the value:

Index: unixlib/source/unix/fcntl.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/unix/fcntl.c,v
retrieving revision 1.2.2.3
diff -u -r1.2.2.3 fcntl.c
--- unixlib/source/unix/fcntl.c 26 Jul 2002 09:34:41 -0000      1.2.2.3
+++ unixlib/source/unix/fcntl.c 2 Aug 2002 21:54:16 -0000
@@ -86,13 +86,19 @@
 
         if (file_desc->device == DEV_SOCKET)
           {
+            int arg;
+
             if ((file_desc->fflag ^ newfflag) & O_NONBLOCK)
-              _sioctl((int)file_desc->handle, FIONBIO,
-                     (void *)((newfflag & O_NONBLOCK) ? 1 : 0));
+              {
+                arg = (newfflag & O_NONBLOCK) ? 1 : 0;
+                _sioctl((int)file_desc->handle, FIONBIO, &arg);
+              }
 
             if ((file_desc->fflag ^ newfflag) & O_ASYNC)
-              _sioctl((int)file_desc->handle, FIOASYNC,
-                     (void *)((newfflag & O_ASYNC) ? 1 : 0));
+              {
+                arg = (newfflag & O_ASYNC) ? 1 : 0;
+                _sioctl((int)file_desc->handle, FIOASYNC, &arg);
+              }
           }
 
         file_desc->fflag = (file_desc->fflag & ~modify) | (newfflag & modify);




Slightly optimistic hoping this code would have worked :-) Hopefully
there's no more like it from the name additions to the assembler.

Index: unixlib/source/netlib/_net_error.s
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/netlib/_net_error.s,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 _net_error.s
--- unixlib/source/netlib/_net_error.s  19 Jul 2002 13:12:30 -0000      1.2.2.1
+++ unixlib/source/netlib/_net_error.s  2 Aug 2002 21:55:42 -0000
@@ -25,6 +25,7 @@
        NAME    __net_error_simple_entry
 |__net_error_simple_entry|
        MOV     lr, ip          ; restore normality
+       B       __net_error
 ;
 ; continue through into standard net_error code
 ; standard net_error entered in SVC with BLVS immediately after SWI


Finally, updated debugging:

Index: unixlib/source/netlib/connect.c
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/netlib/connect.c,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 connect.c
--- unixlib/source/netlib/connect.c     4 Sep 2001 16:32:04 -0000       1.2.2.1
+++ unixlib/source/netlib/connect.c     2 Aug 2002 21:56:46 -0000
@@ -24,6 +24,7 @@
   if (__socket_valid (s) == -1)
     return -1;
 
-  /* printf("U! connect: fd=%d, realsocket=%d\n",s,(__u->file+s)->r[0]); */
+/*  printf("U! connect: fd=%d, realsocket=%d\n",s,__u->fd[s].handle); */
+
   return _connect ((int)__u->fd[s].handle, name, namelen);
 }






-- 
------------------------------------------------------------------------
 Peter Naulls - peter at chocky.org
 Homepage                     -  http://www.chocky.org/
 RISC OS C Programming        -  http://www.riscos.info/
 Unix Programs on RISC OS     -  http://www.chocky.org/unix/
------------------------------------------------------------------------



More information about the gcc mailing list