Mail Archives: djgpp-workers/2001/04/15/09:16:40
It has been hammered into me that unsupported INT21 functions do not
set the carry flag and only set AL to 0. Well, if that is so
_creatnew() is broken:
int
_creatnew(const char* filename, int attrib, int flags)
{
...
if (_osmajor > 3)
r.x.ax = 0x6c00;
else
{
r.h.ah = 0x5b;
r.x.bx = 0; /* lose support for fancy flags in DOS
3.x */
r.x.dx = __tb_offset;
r.x.si = 0;
}
}
r.x.cx = attrib & 0xffff;
r.x.ds = __tb_segment;
__dpmi_int(0x21, &r);
if(r.x.flags & 1)
{
errno = __doserr_to_errno(r.x.ax);
return -1;
}
...
FreeDOS claims to be DOZE 5.0 but it does not support INT21,
AX=0x6c00. So this _creatnew() happily thinks is has successfully
opened/created the file in question.
On the other hand it could be argued that a DOZE of version 5.0 must
support INT21, AX=0x6c00...
Right,
MartinS
- Raw text -