[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bind problem on SunOS4 (was: SU for group admin)



At 10:54 PM 7/1/97 +0300, Peter Lorand Peres wrote:
>Totally out of line but I'm desperate:
>
>I wrote a server for Linux some time ago and now I ported (am porting) it
>to SUN4. It's plain old ANSI C, compiled with gcc. Now I have a problem:
>
>The SUN manuals don't say what the prototype of the address must be for
>bind to work with inet streams. I suppose it's sockaddr_in but nowhere in
>include/sys/socket.h is that described.
>
>So I use this line:
>
>if( bind(s, (struct sockaddr*)&(sa), (int)sizeof(sa) ) < 0)) /* scream...
>
>sa is a sockaddr_in and initialized (port and other stuff) and works
>directly under Linux. Here (SUN4) it compiles without complaint and then
>does a SIGSEGV on run. The weird thing is that I got this working at least
>twice on this machine today and I don't know why it does not work anymore
>?! Because I logged in with telnet into my own server to test and it
>worked !

Well, it's a wild shot in the dark, but I think that the Sun Machine
believes that the address is still occupied by a socket. Maybe one of the
previous instances of the server, didn't manage to clean the binded socket
entry too well, and it was left as occupied in the computer's IP ports table. 

Try to reboot the Sun system, and see if it will work again. Did the
previous runs exit smoothly or did they terminate in an abnormal way?

It is possible that there is a difference in the processes-IP ports
management of Linux and SunOS.

	Shlomi Fish



----------------------------------------------------------
Shlomi Fish                                Smart Link Ltd.
Home: shlomif@ibm.net
Work: shlomi@slink.co.il

The Bible dictates that "Thou shalt not seethe [=cook] a kid [= young goat]
in his mother's milk." To avoid possibility of breaking that regulation,
the Jewish tradition ruled that it also applies to female goats, to mature
goats, and to the meat and milk of two completely unrelated goats. It is
also forbidden to eat the meat with fresh milk, and it applies to beef and
mutten as well (including mixing the milk and meat of two different
beasts). Finally, chicken, which are incapable of milk production, may not
be eaten along with any mammal's milk either. 

We are fortunate that most mathematicians were not Jewish. Otherwise, it
would have been forbidden to divide by all numbers between -1 and 1.
----------------------------------------------------------


Follow-Ups: References: