Page 1 of 1

Misc problems in header files EE and IOP

Posted: Fri May 28, 2004 9:38 pm
by tjd
Folks;

Any good reason for O_RDONLY being 1 in PS2LIB-2.1 and 0 in newlib(1.11.0)? This causes some confusion for us poor filoe system driver writers.

And another thing, the prototype on the IOP side for lseek (api and driver call) is wrong. The offset is typed as an unsigned long. (huh, how do negative offsets work then... no mind) However, the IOP passes an int along from an api invocation through to an underlying driver. Messes up the register/stack calling sequence and oftentimes, whence (which appears to be checked by some low level IOMAN IOP code) becomes illegal, the driver version of lseek is then never called and an error is returned (which many applications dutifully ignore...)

Posted: Fri May 28, 2004 10:51 pm
by mrbrown
Blame SCE for O_RDONLY, they use 1 where POSIX is 0.

Any reason you're using ps2lib for IOP development vs. ps2drv? ps2drv's iop/include/iomanX.h has the correct prototype for lseek(). And the only whence check I know of (in the ROM IOMAN) does bounds checking on whence before passing off lseek to the low-level driver.