On Thursday 18 October 2001 16:33, Brian S. Julin wrote:
> On Thu, 18 Oct 2001, Ulhas Samant wrote:
> > We could build the GGI on Solaris
> > However we get the following errors while building GGI demos.
...
> > "wrap.c", line 59: undefined symbol: socklen_t
> > "wrap.c", line 59: syntax error before or at: len
Not that one again. Apologies to all using a FREE os already and so
wouldn't need mail to read the quoted version of accept(2):
NOTE
The third argument of accept was originally declared as an `int *'
(and is that under libc4 and libc5 and on many other systems like BSD
4.*, SunOS 4, SGI); a POSIX 1003.1g draft standard wanted to change it
into a `size_t *', and that is what it is for SunOS 5. Later POSIX
drafts have `socklen_t *', and so do the Single Unix Specification and
glibc2. Quoting Linus Torvalds: _Any_ sane library _must_ have
"socklen_t" be the same size as int. Anything else breaks any BSD
socket layer stuff. POSIX initially _did_ make it a size_t, and I (and
hopefully others, but obviously not too many) complained to them very
loudly indeed. Making it a size_t is completely broken, exactly because
size_t very seldom is the same size as "int" on 64-bit architectures,
for example. And it _has_ to be the same size as "int" because that's
what the BSD socket interface is. Anyway, the POSIX people eventually
got a clue, and created "socklen_t". They shouldn't have touched it in
the first place, but once they did they felt it had to have a named
type for some unfathomable reason (probably somebody didn't like losing
face over having done the original stupid thing, so they silently just
renamed their blunder).
Here's how i 'did to' cthugha once:
configure.in:
AC_EGREP_HEADER(socklen_t, bits/socket.h, AC_DEFINE(HAVE_SOCKLEN_T))
acconfig.h:
/* silly socklen_t instead of int is used */
#undef HAVE_SOCKLEN_T
src/cthugha.h:
#include "../config.h"
...
#if HAVE_SOCKLEN_T
# define SOCKLEN_TYPE socklen_t
#else
# define SOCKLEN_TYPE int
#endif
> > "wrap.c", line 75: warning: argument #2 is incompatible with
> > prototype: prototype: pointer to struct sockaddr {ushort sa_family,
> > array[14] of char sa_data} : "/usr/include /sys/socket.h", line 295
> > argument : pointer to const struct sockaddr {ushort
> > sa_family, array[14] of char sa_data} "wrap.c", line 83: undefined
> > symbol: bufsize
This one is ugly. Bash had problems at some 4.anything versions, don't
know about the solution. Usually i'm not, but bits/socket.h makes me
afraid. ;) so i forgot what i did ...
> > "wrap.c", line 126: cannot recover from previous errors
This should have come earlier, at least before
> > "wrap.c", line 91: undefined symbol: text
What a nice plug: Dear Aunt aGGI, would you once consider to install
the demos of libggi2 again? I would really like to show them to all my
friends at Debian, they are so nice! But i guess that you have a reason
that you don't install them and so i don't include them in my package.
You know that i've got only that boring old i386 and not the money to
buy another machine so that i might test other archs - i really wish i
could - but here they work just fine.
Truely yours, martin