[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] C rutine til exec + pipe til og fra



On Thu, 20 May 2004 00:20:41 +0200, Hans-Christian Stadler wrote:

> Du husker forkert, se kode nedenfor.

Jep.

>> Præcis, nemlig i den klasse af fejl som brugeren aldrig opdager med
>> mindre vi snakker om en long-running daemon. Derimod opdager brugeren med
>> sikkerhed et uendeligt loop.
> Vil brugeren ikke opdage en fejl, der er så alvorligt, at en fildeskriptor
> ikke kan lukkes efter et par retries?

close() må fejle af 3 grunde (se manpage'n og POSIX):

EINTR: Denne jo nem at loope rundt om.

EBADF: Kan opstå ved en programmeringsfejl, fx hvis man glemmer at tjekke
returværdien af open, pipe, dup el. lign., eller hvis man kommer til at
close() en fil to gange. Her hjælper det ikke noget at forværre den fejl
ved at dø i et uendeligt loop.

EIO: Kan opstå hvis man løber tør for diskplads, fx på et RAM-baseret
/tmp filsystem. Hvor vidt fd'en stadig er gyldig siger Linux manualen ikke
noget om, men POSIX siger "If an I/O error occurred while reading from or
writing to the file system during close(), it may return -1 with errno set
to [EIO]; if this error is returned, the state of fildes is unspecified.",
så det er sandsynligt at man lander i et EBADF loop her.
Om brugeren opdager out-of-space situationen kan afhænge af flere ting,
men det tjener i hvert fald ikke noget formål at loope uendeligt omkring
fejlen.

Mvh. Jonas


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *