sceNetErrnoLoc

This commit is contained in:
red-prig 2022-12-16 21:00:32 +03:00
parent 0d3d3394f0
commit bcf34a5b02
2 changed files with 34 additions and 0 deletions

View File

@ -12,6 +12,9 @@ uses
implementation
uses
sys_pthread;
type
SceNetInAddr_t=DWORD;
@ -30,6 +33,35 @@ type
data:array[0..SCE_NET_ETHER_ADDR_LEN-1] of Byte;
end;
function _set_net_errno(r:Integer):Integer;
var
t:pthread;
begin
Result:=0;
t:=tcb_thread;
if (t<>nil) then t^.net_errno:=r;
if (r<>0) then
begin
Result:=-1;
end;
end;
function _net_error:Pointer;
var
t:pthread;
begin
Result:=nil;
t:=tcb_thread;
if (t<>nil) then Result:=@t^.net_errno;
end;
function ps4_sceNetErrnoLoc:Pointer; SysV_ABI_CDecl;
begin
Result:=_net_error;
end;
function ps4_sceNetInit:Integer; SysV_ABI_CDecl;
begin
Result:=0;
@ -378,6 +410,7 @@ begin
Result:=TElf_node.Create;
Result.pFileName:=name;
lib:=Result._add_lib('libSceNet');
lib^.set_proc($1D03B09DF3068A94,@ps4_sceNetErrnoLoc);
lib^.set_proc($3657AFECB83C9370,@ps4_sceNetInit);
lib^.set_proc($7131A473AFD30652,@ps4_sceNetTerm);
lib^.set_proc($76024169E2671A9A,@ps4_sceNetPoolCreate);

View File

@ -150,6 +150,7 @@ type
name:array[0..31] of AnsiChar;
//
errno:QWORD;
net_errno:QWORD;
//
cleanup:p_pthread_cleanup;
//