Re: [fpc-devel] Weird output from fpGetErrNo

2013-01-31 Thread Ewald
Once upon a time, on 01/30/2013 11:38 PM to be precise, Tomas Hajny said: >> If the above is right, than errno (without the `C`) contains a leftover >> error from somewhere before in the program. What bothers me is: what (and >> why) created the contition? (I know it is not some garbage data in the

Re: [fpc-devel] Weird output from fpGetErrNo

2013-01-31 Thread Ewald
Once upon a time, on 01/30/2013 11:34 PM to be precise, Marco van de Voort said: >> The function that seemingly doesn't work is the native >> fpGetErrNo (with native I mean the function that is available in unit >> baseunix without any modification). > > That only works for routines that call the

Re: [fpc-devel] Weird output from fpGetErrNo

2013-01-30 Thread Tomas Hajny
On Wed, January 30, 2013 23:18, Ewald wrote: > On 30 Jan 2013, at 21:52, Marco van de Voort wrote: >> In our previous episode, Ewald said: . . >> fpcerrno is always linking to libc's errno. >> >> On platforms where FPC uses libc to acces the kernel, errno=cerrno. > > Thus on linux fpc does its ow

Re: [fpc-devel] Weird output from fpGetErrNo

2013-01-30 Thread Marco van de Voort
In our previous episode, Ewald said: > > Well, the surprise is that initc worked, and yours not. From a quick glance > > I believe it to be correct too. > > I believe there is a bit of confusion: Ok, cler. > The function that seemingly doesn't work is the native > fpGetErrNo (with native I mean

Re: [fpc-devel] Weird output from fpGetErrNo

2013-01-30 Thread Ewald
On 30 Jan 2013, at 21:52, Marco van de Voort wrote: > In our previous episode, Ewald said: >> fpgetcerrno from initc gives me the correct results as well; and by >> looking at the code I see it implements it by using `__errno_location` >> under linux, so no surprise there. > > Well, the surprise

Re: [fpc-devel] Weird output from fpGetErrNo

2013-01-30 Thread Marco van de Voort
In our previous episode, Ewald said: > fpgetcerrno from initc gives me the correct results as well; and by > looking at the code I see it implements it by using `__errno_location` > under linux, so no surprise there. Well, the surprise is that initc worked, and yours not. From a quick glance I bel

Re: [fpc-devel] Weird output from fpGetErrNo

2013-01-30 Thread Ewald
Once upon a time, on 01/30/2013 08:17 PM to be precise, Marco van de Voort said: > In our previous episode, Ewald said: >> I was just writing a little mmapped (that's two `m`'s -- no typo ;-) ) >> file stream and thought to do it properly just in case I might fork(). >> So I thought to give some ad

Re: [fpc-devel] Weird output from fpGetErrNo

2013-01-30 Thread Marco van de Voort
In our previous episode, Ewald said: > I was just writing a little mmapped (that's two `m`'s -- no typo ;-) ) > file stream and thought to do it properly just in case I might fork(). > So I thought to give some advise about memory: Why not simply use fpgetcerrnp in unit initc? > I get the most am

[fpc-devel] Weird output from fpGetErrNo

2013-01-30 Thread Ewald
Hello, I was just writing a little mmapped (that's two `m`'s -- no typo ;-) ) file stream and thought to do it properly just in case I might fork(). So I thought to give some advise about memory: madvise(daBuffer, FileSize, MADV_DONTFORK); Now if I check the result value and, if <> 0, print