forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Argument diffs for 'Ioctl' in "ioman.h" and "

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
dlanor



Joined: 28 Oct 2004
Posts: 269
Location: Stockholm, Sweden

PostPosted: Sat Feb 18, 2006 10:02 am    Post subject: Argument diffs for 'Ioctl' in "ioman.h" and " Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group