Re: problem with GNU C
On Wed, Aug 01, 2001 at 11:53:36AM +0600, Ilya Teterin wrote:
> From: "Martijn van Oosterhout" <firstname.lastname@example.org>
> > The only thing I can think of (since you didn't indicate what the
> > differences were between the two boxes) is the first argument you passed
> > select(). I'm pretty sure you'll never have 31000 descriptors open and I'm
> > not even sure if the default fd_set can hold that many, leading to your
> > stack being trashed.
> > Other things: you should use snprintf, not sprintf and setting the 100th
> > byte to null is a waste of time.
> The real reason of termination: program receives SIGPIPE on send(). Select()
> says that socket is writeable alredy. Removing fcntl will resolve problem.
> Any ideas?
Oh, that's easy then. The socket is marked writable because the other end
has closed. You receive a SIGPIPE because you're writing to a closed socket.
Are you checking the return codes from write?
Martijn van Oosterhout <email@example.com>
> It would be nice if someone came up with a certification system that
> actually separated those who can barely regurgitate what they crammed over
> the last few weeks from those who command secret ninja networking powers.