Re: [coders] libexplain vs fork

2008-11-18 Thread Peter Miller
On Tue, 2008-11-18 at 20:55 +1100, Martin Pool wrote: > Almost. For a couple of APIs, including readdir, you *must* assign 0 > to errno before calling the function Been there, stepped in that. libexplain_readdir_or_die gets it right. Regards Peter Miller <[EMAIL PROTECTED]> /\/\*http:

Re: [coders] libexplain vs fork

2008-11-18 Thread Martin Pool
On Tue, Nov 18, 2008 at 3:52 PM, Peter Miller <[EMAIL PROTECTED]> wrote: > Trying to explain the causes of obscure values is like a > riddle-based mystery tour of Asymmetric Api Land. "Yes, that error > happened; yes, the system knows why; no, the system will not tell you > your crime. Guilty!

Re: [coders] libexplain vs fork

2008-11-18 Thread Jamie Wilkinson
2008/11/18 Ben Leslie <[EMAIL PROTECTED]>: > Oh yeah, it would be really nice if each place that can throw an error > returned a unique code. Have fun with mmap. There appears to be about > 50 different cases where mmap can fail and most of them appear to > simply return EINVAL. I'm not sure how li

Re: [coders] libexplain vs fork

2008-11-17 Thread Ben Leslie
On Tue, Nov 18, 2008 at 3:52 PM, Peter Miller <[EMAIL PROTECTED]> wrote: > On Tue, 2008-11-18 at 14:15 +1100, Matthew Hannigan wrote: >> On Tue, Nov 18, 2008 at 08:54:47AM +1100, Peter Miller wrote: >> > Ho Folks, >> > >> > yet another puzzle for you. >> > >> > fork(2) can fail and report EAGAIN if

Re: [coders] libexplain vs fork

2008-11-17 Thread Peter Miller
On Tue, 2008-11-18 at 14:15 +1100, Matthew Hannigan wrote: > On Tue, Nov 18, 2008 at 08:54:47AM +1100, Peter Miller wrote: > > Ho Folks, > > > > yet another puzzle for you. > > > > fork(2) can fail and report EAGAIN if > > a. run out of a resource other than memory > > b. too many processes on th

Re: [coders] libexplain vs fork

2008-11-17 Thread Matthew Hannigan
On Tue, Nov 18, 2008 at 08:54:47AM +1100, Peter Miller wrote: > Ho Folks, > > yet another puzzle for you. > > fork(2) can fail and report EAGAIN if > a. run out of a resource other than memory > b. too many processes on the system > c. too many processes per uid > d. too many child processes per

[coders] libexplain vs fork

2008-11-17 Thread Peter Miller
Ho Folks, yet another puzzle for you. fork(2) can fail and report EAGAIN if a. run out of a resource other than memory b. too many processes on the system c. too many processes per uid d. too many child processes per process for each of the above, on linux, how the heck do you 1. obtain current