I am currently modifying the HOST interface for uLaunchELF, and have successfully implemented the new functions of current ps2client and ps2link sources (Remove, Mkdir, Rmdir). But I also want to implement a way to rename files/folders on HOST.
The only 'correct' way of doing this for a fileio driver is of course to use the Ioctl function, as it is intended to allow new features to be added to a driver, beyond what the basic function set implements. My intended usage of this would be as follows.
1: PS2 program calls fioOpen or fioDopen, naming the object to be renamed.
2: PC client opens the file/folder as normal, and memorizes its name and descriptor.
3: PS2 program calls fioIoctl for the file/folder just opened, using my IOCTL_RENAME constant as Ioctl function request argument, and the new name for the file/folder indicated by the Ioctl data pointer argument
4: PC client checks if the Ioctl call is valid (by several criteria), and if so it first closes the file/folder (using memorized descriptor) and then renames it (using memorized old_name and new_name in Ioctl data block).
5: PS2 program calls fioClose or fioDclose, to free the IOMAN descriptor used for the file or folder, but the modified HOST interface does NOT pass this call to the PC, as it remembers that the file/folder was closed there before renaming.
All of this should work fine, but I have one problem, which is due to the conflicting definitions of "ioman.h" and "fileio.h".
In "iop/include/ioman.h" the driver entry for Ioctl is declared as:
int (*ioctl)(iop_file_t *, unsigned long, void *);
But in "ee/include/fileio.h" the filesystem call for Ioctl is declared as:
int fioIoctl(int fd, int request, void *data);
My problem is of course the different declarations of the request code, being an "unsigned long" for IOP, but merely a normal "int" for EE.
Doesn't "long" mean the same thing for IOP and EE (a 64-bit unit, right?) ???
Or is this some argument change imposed by IOMAN.IRX, and if so, how do I get around it...?
Btw: There is a similar diff for the Lseek function as well.
I'm going to go ahead and try anyhow, but I'd like to have the "official word" on this issue, so I know WHY the declarations differ.
Edit:
I have now implemented my Ioctl function as outlined above, and it works fine, but I still want to know why the declarations for Ioctl arguments are inconsistent.
Best regards: dlanor