From 0077bfb258f479615e9fb8025d688567b1441b7d Mon Sep 17 00:00:00 2001 From: red-prig Date: Thu, 5 Jan 2023 19:52:47 +0300 Subject: [PATCH] pthread_attr_getstacksize --- kernel/ps4_libkernel.pas | 3 +++ kernel/ps4_pthread_attr.pas | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/kernel/ps4_libkernel.pas b/kernel/ps4_libkernel.pas index 4707b37..4da3af7 100644 --- a/kernel/ps4_libkernel.pas +++ b/kernel/ps4_libkernel.pas @@ -1236,7 +1236,10 @@ begin lib^.set_proc($B711ED9E027E7B27,@ps4_scePthreadAttrGetguardsize); lib^.set_proc($46EDFA7E24ED2730,@ps4_scePthreadAttrGetstackaddr); + + lib^.set_proc($D2A3AD091FD91DC9,@ps4_pthread_attr_getstacksize); lib^.set_proc($FDF03EED99460D0B,@ps4_scePthreadAttrGetstacksize); + lib^.set_proc($FEAB8F6B8484254C,@ps4_scePthreadAttrGetstack); lib^.set_proc($5544F5652AC74F42,@ps4_pthread_attr_getdetachstate); diff --git a/kernel/ps4_pthread_attr.pas b/kernel/ps4_pthread_attr.pas index 704a588..fe6ca61 100644 --- a/kernel/ps4_pthread_attr.pas +++ b/kernel/ps4_pthread_attr.pas @@ -62,7 +62,10 @@ function ps4_scePthreadAttrGetaffinity(pAttr:p_pthread_attr_t;mask:PQWORD):Inte function ps4_scePthreadAttrGetguardsize(pAttr:p_pthread_attr_t;guardSize:PQWORD):Integer; SysV_ABI_CDecl; function ps4_scePthreadAttrGetstackaddr(pAttr:p_pthread_attr_t;stackAddr:PPointer):Integer; SysV_ABI_CDecl; + +function ps4_pthread_attr_getstacksize(pAttr:p_pthread_attr_t;stackSize:PQWORD):Integer; SysV_ABI_CDecl; function ps4_scePthreadAttrGetstacksize(pAttr:p_pthread_attr_t;stackSize:PQWORD):Integer; SysV_ABI_CDecl; + function ps4_scePthreadAttrGetstack(pAttr:p_pthread_attr_t;stackAddr:PPointer;stackSize:PQWORD):Integer; SysV_ABI_CDecl; function ps4_pthread_attr_getdetachstate(pAttr:p_pthread_attr_t;detachstate:Pinteger):Integer; SysV_ABI_CDecl; @@ -272,14 +275,19 @@ begin Result:=0; end; -function ps4_scePthreadAttrGetstacksize(pAttr:p_pthread_attr_t;stackSize:PQWORD):Integer; SysV_ABI_CDecl; +function ps4_pthread_attr_getstacksize(pAttr:p_pthread_attr_t;stackSize:PQWORD):Integer; SysV_ABI_CDecl; begin - if (pAttr=nil) or (stackSize=nil) then Exit(SCE_KERNEL_ERROR_EINVAL); - if (pAttr^=nil) then Exit(SCE_KERNEL_ERROR_EINVAL); + if (pAttr=nil) or (stackSize=nil) then Exit(EINVAL); + if (pAttr^=nil) then Exit(EINVAL); stackSize^:=pAttr^^.stacksize_attr; Result:=0; end; +function ps4_scePthreadAttrGetstacksize(pAttr:p_pthread_attr_t;stackSize:PQWORD):Integer; SysV_ABI_CDecl; +begin + Result:=px2sce(ps4_pthread_attr_getstacksize(pAttr,stackSize)); +end; + function ps4_scePthreadAttrGetstack(pAttr:p_pthread_attr_t;stackAddr:PPointer;stackSize:PQWORD):Integer; SysV_ABI_CDecl; begin if (pAttr=nil) or (stackAddr=nil) or (stackSize=nil) then Exit(SCE_KERNEL_ERROR_EINVAL);