From: <htd...@li...> - 2001-12-20 06:55:01
|
On Thu, Dec 20, 2001 at 01:37:22AM -0500, Geoff Hutchison wrote: > On Wed, 19 Dec 2001, Geoff Hutchison wrote: > > > I'll add a test for "Psocklen_t" to the list to loop through, joining > > 'size_t,' 'int,' 'unsigned int,' 'long unsigned int,' and 'socklen_t.' I'm > > Bah. I discovered that there are actually a few Solaris 8 machines that I > can use. So I can confirm that I can code a nicely-working configure test. > > The catch is to get working code. > > Basically I'm stuck because it seems like Sun is doing something > nonsensical. The third (namelen) parameter is supposed to be initialized > to the size. But you can't assign to a void! So I haven't the faintest > what Sun wants you to do. The man page for this claims that it's always a > 'socklen_t*' but that's not what's actually in the header file. > > At the moment, I don't have a good answer. If someone can find me examples > of calls to getpeername() that work on Solaris 8 in other code (Apache?), > please send them to the list and I'll get things working. BTW, HP-UX 11.00 has the same problem (when using the C++ compiler). From apache-1.3.22/src/main/http_main.c int sock_in; ... struct sockaddr sa_server, sa_client; ... sock_in = fileno(stdin); sock_out = fileno(stdout); ... l = sizeof(sa_client); if ((getpeername(sock_in, &sa_client, &l)) < 0) { /* get peername will fail if the input isn't a socket */ perror("getpeername"); memset(&sa_client, '\0', sizeof(sa_client)); } -- albert chin (ch...@th...) |