RE: accept

From: Richard B. Johnson (
Date: Mon Feb 05 2001 - 07:59:59 EST

On Sun, 4 Feb 2001, Mathieu Dube wrote:

> Ok, but fd 0 cant be a valid socket since its the stdin
Sure it can:

        fd = socket(....);
        dup....etc, for stdout and stderr.

That said, never, never, ever, check the value of the errno global
unless a function call returned an error. Many/most/all C runtime
procedures don't touch that variable unless an error occurred.
So, reading its value will show the results of something that
happened hours ago (line an interrupted system call).

> I posted that on this mailing list coz I thought that this might be a scaling
> problem since it happens when theres already several clients connected to the
> server

Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Feb 07 2001 - 21:00:21 EST