Skip to content

feat(libkernel): export POSIX pthread_attr_setstack - #1453

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
mrk1987:fix/posix-pthread-setstack
Oct 8, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
mrk1987:fix/posix-pthread-setstack

Conversation

@mrk1987

@mrk1987 mrk1987 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What

Add the missing POSIX pthread_attr_setstack export using the existing scePthreadAttrSetstack implementation. Validate the attribute, stack pointer and 16 KiB minimum before forwarding so invalid arguments return guest EINVAL rather than a host exception.

Tested

Windows, MinGW-w64, Release build on upstream main 6b573862. guest_pthread_attr passes, including set/get round-trip and invalid null, uninitialized, destroyed and undersized arguments. The test also retains its existing thread-attribute/thread-creation checks. tools/check_conventions.py and git diff --check pass.

The export resolved a missing import during local startup testing with a retail title; no playable-game claim.

The test additions are positioned separately from #1404; git merge-tree --write-tree confirms a clean merge with its current head. The relevant test and conventions checks pass after relocating the additions.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes (OpenAI Codex)

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#1498 core/libs/prx/libkernel/Pthread/Posix/Attr.cpp L11, L112-115

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Progress report (1e1e139 → 05e9a50)

➖ System libraries: 85.24% (+0.0%, +1 implemented functions)

✅ 1 implemented
Library Name
libkernel pthread_attr_setstack_nid_postfix

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked build + full ctest (459/459, guest_pthread_attr included); the new test fails without the Attr.cpp change. Behaviour matches shadPS4 posix_pthread_attr_setstack and fpPS4 ps4_pthread_attr_setstack (null attr / *attr / addr, size < 16 KiB → EINVAL). Merging once CI is green.

@adriadam10
adriadam10 merged commit f7e98da into boykopovar:main Oct 8, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants