Re: File descriptor suddenly goes bad
From: Dan Mills (dmills_at_spamblock.demon.co.uk)
Date: 10/02/04
- Previous message: John Hasler: "Re: Fortran vs. C"
- In reply to: Kasper Dupont: "Re: File descriptor suddenly goes bad"
- Next in thread: Kasper Dupont: "Re: File descriptor suddenly goes bad"
- Reply: Kasper Dupont: "Re: File descriptor suddenly goes bad"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 02 Oct 2004 21:12:18 +0100
Kasper Dupont wrote:
> Dan Mills wrote:
>>
>> Just a guess but do you fork and does the child then either exit or close
>> the fd. There are IIRC some subtle issues involved here.
>
> That shouldn't cause any trouble. A shutdown call
> on the socket might explain the problem.
I had thought that there was some requirement to use _exit() in the child?
<Reaches for APUE>
If you open a file descriptor then fork the child inherits the open FD.
Now closing it in one process is not a problem but some other socket
operations may be.
Does exit() shutdown any open sockets? How about _exit() which does less....
Note that returning from main implies exit().
Just guessing here.
-- ** The email address *IS* valid, do NOT remove the spamblock And on the evening of the first day the lord said........... .... LX 1, GO!; and there was light.
- Previous message: John Hasler: "Re: Fortran vs. C"
- In reply to: Kasper Dupont: "Re: File descriptor suddenly goes bad"
- Next in thread: Kasper Dupont: "Re: File descriptor suddenly goes bad"
- Reply: Kasper Dupont: "Re: File descriptor suddenly goes bad"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|