Replace deprecated pthread functions (#290)

pthread_attr_(set,get)stackaddr are deprecated and don't exist anymore on musl libc
This commit is contained in:
jas0n098 2024-07-15 00:55:58 +00:00 committed by GitHub
parent b4df90d8e4
commit 6ec4a3d1b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -318,7 +318,8 @@ int PS4_SYSV_ABI scePthreadAttrGetstackaddr(const ScePthreadAttr* attr, void** s
return SCE_KERNEL_ERROR_EINVAL;
}
int result = pthread_attr_getstackaddr(&(*attr)->pth_attr, stack_addr);
size_t stack_size = 0;
int result = pthread_attr_getstack(&(*attr)->pth_attr, stack_addr, &stack_size);
return result == 0 ? SCE_OK : SCE_KERNEL_ERROR_EINVAL;
}
@ -340,7 +341,10 @@ int PS4_SYSV_ABI scePthreadAttrSetstackaddr(ScePthreadAttr* attr, void* addr) {
return SCE_KERNEL_ERROR_EINVAL;
}
int result = pthread_attr_setstackaddr(&(*attr)->pth_attr, addr);
size_t stack_size = 0;
pthread_attr_getstacksize(&(*attr)->pth_attr, &stack_size);
int result = pthread_attr_setstack(&(*attr)->pth_attr, addr, stack_size);
return result == 0 ? SCE_OK : SCE_KERNEL_ERROR_EINVAL;
}