[fpc-pascal] Translating from error numbers to symbolic name

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Sat Aug 4 09:17:37 CEST 2012


waldo kitty wrote:
> On 8/3/2012 18:24, Marco van de Voort wrote:
> 
>> EAGAIN generally means that you should try again. So repeat until
>>
>>    repeat
>>      res:=dofunc;
>>      err:=geterrno;
>>    until (res<>-1) or ((err<>ESysEINTR) and (err<>ESysEAgain));
>>
>> it is a workaround against potential deadlock between userland and kernel
>> iirc. Retrying means it can simple work.
> 
> should there be some sort of retry count or timing period in which to 
> decide to give up so that one doesn't retry forever? if yes, how might 
> that be accomplished? ;)
> 
> admittedly, i may have missed something in the ESysEINTR and ESysAgain 
> portion since i'm a new babe with regards to signaling like that... but 
> i just had to ask, ya know? ;)

In my case I've set the sockets non-blocking and am polling 
non-destructively until a complete request has arrived (I'm writing a 
custom finger daemon, so expect \r\n). After a minute the socket gets 
moved to a different list to be tarpitted, or if that can't be done to 
be held open for a few minutes to discourage casual hackers. Detail 
debugging continues, but I'm trying to be very aggressive against 
abusers since it will be giving out temporary passwords for database 
connection.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list