On 11/1/07, Marco van de Voort <[EMAIL PROTECTED]> wrote:
> > On 11/1/07, Marc Santhoff <[EMAIL PROTECTED]> wrote:
> > > Something like
> > >
> > >         fcntl(fileno(stderr), F_GETFL) & O_NONBLOCK
> > >
> > > or the pascal equivalent should do.
> >
> > I'm getting -1 from fpWrite for a "long" period of time, like 6-7 loop
> > returns before it can continue getting the my next content, only to
> > have the same problem repeated...
>
> Check errno, an if it is EAGAIN, try... again :-)
>
> Maybe some libc versions do this in their libc (as opposed to kernel) 
> read/write
> versions already.

I found a scary thing with fpOpen after using strace:
It adds me the flag O_LARGEFILE. Another issue that was not the same
as the C code, and now it seems to solve the problem completely was
that I opened a device as a non blocking, while the C was blocking.
removing the O_NONBLOCK solved the problem completely.
And yes strace showed me the EAGAIN flag :(

BTW it is a C vs Pascal thingy... Linux and libc are written in C... ;)


Thank you all for the help,

Ido
-- 
http://ik.homelinux.org/
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to