mirror of https://github.com/red-prig/fpPS4.git
ioctl
This commit is contained in:
parent
51009e606b
commit
da297c899d
|
@ -61,6 +61,8 @@ function ps4_sceKernelFsync(fd:Integer):Integer; SysV_ABI_CDecl;
|
|||
function ps4_fcntl(fd,cmd:Integer;param1:ptruint):Integer; SysV_ABI_CDecl;
|
||||
function ps4_sceKernelFcntl(fd,cmd:Integer;param1:ptruint):Integer; SysV_ABI_CDecl;
|
||||
|
||||
function ps4_ioctl(fd,cmd:Integer;param1:ptruint):Integer; SysV_ABI_CDecl;
|
||||
|
||||
function ps4_stat(path:PChar;stat:PSceKernelStat):Integer; SysV_ABI_CDecl;
|
||||
function ps4_sceKernelStat(path:PChar;stat:PSceKernelStat):Integer; SysV_ABI_CDecl;
|
||||
|
||||
|
@ -583,6 +585,13 @@ begin
|
|||
Result:=px2sce(Result);
|
||||
end;
|
||||
|
||||
function ps4_ioctl(fd,cmd:Integer;param1:ptruint):Integer; SysV_ABI_CDecl;
|
||||
begin
|
||||
_sig_lock;
|
||||
Result:=_set_errno(_sys_ioctl(fd,cmd,param1));
|
||||
_sig_unlock;
|
||||
end;
|
||||
|
||||
function _sys_stat(path:PChar;stat:PSceKernelStat):Integer;
|
||||
var
|
||||
rp:RawByteString;
|
||||
|
|
|
@ -1525,6 +1525,8 @@ begin
|
|||
|
||||
lib^.set_proc($F27635F5B2A88999,@ps4_fcntl);
|
||||
|
||||
lib^.set_proc($3DF71C4FBA944581,@ps4_ioctl);
|
||||
|
||||
lib^.set_proc($13A6A8DF8C0FC3E5,@ps4_stat);
|
||||
lib^.set_proc($795F70003DAB8880,@ps4_sceKernelStat);
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ type
|
|||
function write (data:Pointer;size:Int64):Int64; override;
|
||||
function pwrite(data:Pointer;size,offset:Int64):Int64; override;
|
||||
function writev(vector:p_iovec;count:Integer):Int64; override;
|
||||
function ioctl(cmd:Integer;param1:ptruint):Integer; override;
|
||||
end;
|
||||
|
||||
procedure _sys_dev_init;
|
||||
|
@ -313,6 +314,12 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
function TDevStd.ioctl(cmd:Integer;param1:ptruint):Integer;
|
||||
begin
|
||||
Assert(false,'TODO:ioctl:'+HexStr(cmd,8));
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
//
|
||||
|
||||
end.
|
||||
|
|
|
@ -212,6 +212,7 @@ type
|
|||
function fstat (stat:PSceKernelStat):Integer; virtual;
|
||||
function fsync ():Integer; virtual;
|
||||
function fcntl (cmd:Integer;param1:ptruint):Integer; virtual;
|
||||
function ioctl (cmd:Integer;param1:ptruint):Integer; virtual;
|
||||
function getdirentries(buf:Pointer;nbytes:Int64;basep:PInt64):Int64; virtual;
|
||||
end;
|
||||
|
||||
|
@ -232,6 +233,7 @@ function _sys_fstat(fd:Integer;stat:PSceKernelStat):Integer;
|
|||
function _sys_getdirentries(fd:Integer;buf:Pointer;nbytes:Int64;basep:PInt64):Int64;
|
||||
function _sys_fsync(fd:Integer):Integer;
|
||||
function _sys_fcntl(fd,cmd:Integer;param1:ptruint):Integer;
|
||||
function _sys_ioctl(fd,cmd:Integer;param1:ptruint):Integer;
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -314,6 +316,11 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
function TCustomFile.ioctl(cmd:Integer;param1:ptruint):Integer;
|
||||
begin
|
||||
Result:=ENOTTY;
|
||||
end;
|
||||
|
||||
function TCustomFile.getdirentries(buf:Pointer;nbytes:Int64;basep:PInt64):Int64;
|
||||
begin
|
||||
Result:=-EINVAL;
|
||||
|
@ -626,6 +633,20 @@ begin
|
|||
f.Release;
|
||||
end;
|
||||
|
||||
function _sys_ioctl(fd,cmd:Integer;param1:ptruint):Integer;
|
||||
var
|
||||
f:TCustomFile;
|
||||
begin
|
||||
if (fd<0) then Exit(EINVAL);
|
||||
|
||||
f:=_sys_acqure_fd(fd);
|
||||
if (f=nil) then Exit(EBADF);
|
||||
|
||||
Result:=f.ioctl(cmd,param1);
|
||||
|
||||
f.Release;
|
||||
end;
|
||||
|
||||
//
|
||||
|
||||
initialization
|
||||
|
|
Loading…
Reference in New Issue