[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: errno.h in MiNTlibs pl 46



Chris Herborth writes:
> I'm just working on a port of GNU readline 2.0, and I've noticed
> something weird...  MiNTlibs errno.h doesn't define EAGAIN.

Well the reason is actually pretty simple, a tty on MiNT simply
won't give you a EAGAIN...  we don't have interruptable syscalls (yet?).

 i.e. the only way to interrupt a blocking read is a longjmp out of a
signal handler, like on early BSD...
> 
> According to my handy-dandy POSIX.1 Standard: A Programmer's Guide,
> EAGAIN is _required_ for anything that wants to claim POSIX conformance.

 but like someone already posted MiNT-net has EWOULDBLOCK and you can
#define that to get your source compile.  (and i guess thats also
what should be done in errno.h...)
> 
> A quick check of our QNX development systems tells me that WATCOM
> defines EAGAIN as "11", as does the EMX port of gcc and whatnot under
> OS/2.

 half-an-OS has interruptable syscalls? :)
> 
> I even checked the MiNTlibs source (for example, read.c) which has
> sections that look like:
> 
> #ifdef EAGAIN
> ...
> #endif
> 
> This leads me to believe that it _was_ there are some point, and it's
> vanished.

 if i remember right there was some discussion about putting some sort of
emulation in the library, but thats pretty hard if not impossible if you
want something that actually _works_.  the right place to `fix' this is
the kernel...

 hope this helps
	Juergen