Files created by my programs running under sim65 had really weird permissions:
--w-r--r-x 1 ppelleti staff 19 Aug 16 23:22 json.test.print.tmp
So, for example, my program running under sim65 was not able to read
the file it had just written.
This is because the third argument to open (mode) was not being
specified in paravirt.c, so it was just picking up random crud off the
stack to use as the mode.
I added a mode of 0666, and now my program runs correctly.
/* Avoid gcc warning */
(void) Mode;
- RetVal = open (Path, OFlag);
+ RetVal = open (Path, OFlag, (mode_t) 0666);
SetAX (Regs, RetVal);
}