Jarkko Hietaniemi wrote:
> Jarkko Hietaniemi wrote:
> 
>>>io/io_unix.c does not compile because socklen_t is not defined.
>>>
>>>According to the standards, <sys/socket.h> is needed to get socklen_t.
>>>
>>>One could try including that the right way into io/io_unix.c, but I do
>>>not know enough of Parrot conventions.  Instead, the below patch helps:
>>>
>>>--- io/io_unix.c.dist   2005-10-03 20:54:25.000000000 +0300
>>>+++ io/io_unix.c        2005-10-03 20:56:51.000000000 +0300
>>>@@ -832,7 +832,7 @@
>>>    newio = PIO_new(interpreter, PIO_F_SOCKET, 0, PIO_F_READ|PIO_F_WRITE);
>>>
>>>    if ((newsock = accept(io->fd, (struct sockaddr *)&newio->remote,
>>>-                                  (socklen_t *)&newsize)) == -1)
>>>+                          &newsize)) == -1)
>>>    {
>>>        fprintf(stderr, "accept: errno=%d", errno);
>>>        /* Didn't get far enough, free the io */
>>>
>>
>>
>>Please ignore that patch, it doesn't work since socklen_t is a long,
>>not an int, and in Tru64 one shall not mix those.
> 
> 
> Please ignore the ignore :-)  It seems that "it depends" how long the
> socklen_t is in Tru64, and with cxx (the C++ compiler) and the flags
> Parrot compilation uses, int is fine.  So the above patch is fine for
> now.  In the long run the newsize really should be socklen_t.  Getting
> that to be defined seems to be little tricky with cxx, so please don't
> change that right now... in the meanwhile, I found another bug in the
> IO code, bug report coming soon.

The culprit seems to be that for tru64 cxx not all the POSIX APIs and
types are visible by default as they are for cc, and one of those
missing with -D_XOPEN_SOURCE=500 is the socklen_t.

--- config/init/hints/dec_osf.pl.dist   2005-10-05 20:29:30.000000000 +0300
+++ config/init/hints/dec_osf.pl        2005-10-05 20:31:25.000000000 +0300
@@ -6,6 +6,10 @@
 if ( $ccflags !~ /-pthread/ ) {
     $ccflags .= ' -pthread';
 }
+if ( $ccflags !~ /-D_XOPEN_SOURCE=/ ) {
+    # Request all POSIX visible (not automatic for cxx, as with cc)
+    $ccflags .= ' -D_XOPEN_SOURCE=500';
+}
 Configure::Data->set(
     ccflags => $ccflags,
 );


> 
> 
>>
>>
> 
> 

Reply via email to