Misc problems in header files EE and IOP

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
tjd
Posts: 23
Joined: Thu May 27, 2004 1:54 am
Location: Austin, TX
Contact:

Misc problems in header files EE and IOP

Post 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...)
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post 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.
Post Reply