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

atarierr.h



Hi again!

A proposal for MiNT 1.15:

A thing I often get mad about with MiNT are the weird error codes
that the system calls return.  For example when I send a signal
to a non-existing process the error code is EFILNF which
means "file not found" instead of something like ESCRH (no
such process).

When I open a directory for reading with Fopen() the system
returns EFILNF instead of EISDIR ("is a directory").  

When I move a process into a non-existing process group
MiNT returns - guess what.

I think this strange behavior is for historic reasons only.
The error codes are taken from the original TOS, and the 
TOS error codes in turn originate from M$-DOG.

The MiNTLib usually just maps the system error codes to
standard error codes by multiplicating it with -1.  This
involves difficulties when porting software to MiNT.  Many
programs expect a distinct error number to detect certain
failures and they refuse to work if errno is set to some
bogus value.  Furthermore, the error messages produced
by some programs are often really misleading
("*** make: waiting for children to terminate: file not found ...").

My proposal:  We adapt atarierr.h to the MiNTLib's errno.h.
We could then define additional error values in order to be more
distinctive.  For example EFILNF should be devided into
ENOENT, ESRCH, EISDIR, ECHILD, EBADF etc.  The same applies
to EPERM and EACCESS which are actually not the same.  This would require
only minor changes in the MiNTLib (errno.h, strerror
and sys_errlist).  Additionally it would be a good idea
to make Kay Roemer's error numbers for MiNTNet "official",
too.  The MiNT sources could be modified step by step
to return something meaningful.  

What do you reckon?

Ciao

Guido
-- 
http://stud.uni-sb.de/~gufl0000
mailto:gufl0000@stud.uni-sb.de