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

2012-08-03 Thread Mark Morgan Lloyd
When using a function like fpAccept on a non-blocking socket, in some cases -1 is returned with a documented (Linux kernel) error code of EAGAIN. Should I be looking for this in errno or SocketError? When I've retrieved a numeric code from errno or SocketError, is there a way of converting it

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

2012-08-03 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said: > When using a function like fpAccept on a non-blocking socket, in some > cases -1 is returned with a documented (Linux kernel) error code of > EAGAIN. Should I be looking for this in errno or SocketError? Socketerror is more portable, but on *nix

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

2012-08-03 Thread Mark Morgan Lloyd
Marco van de Voort wrote: In our previous episode, Mark Morgan Lloyd said: When using a function like fpAccept on a non-blocking socket, in some cases -1 is returned with a documented (Linux kernel) error code of EAGAIN. Should I be looking for this in errno or SocketError? Socketerror is mor

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

2012-08-03 Thread waldo kitty
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 kern