Bug 16126

Summary: Implement openat2 intercept in pseudo
Product: [Yocto Project Subprojects] Pseudo Reporter: Khem Raj <raj.khem>
Component: pseudoAssignee: Mark Hatle <mark.hatle>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: ccasciato, meta.mr.watcher, meta.watcher, paul, randy.macleod, richard.purdie, yp.pseudo.watcher, yp.watcher
Version: unspecified   
Target Milestone: 6.0 M2   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Khem Raj 2026-01-07 07:45:09 UTC
openat2 in introduced in upcoming 2.43 release of glibc. Pseudo needs to be aware of this function and create an intercept for it.
Comment 1 Richard Purdie 2026-01-12 17:51:03 UTC
For tar on stream9 we need to intercept the syscall too:

https://git.yoctoproject.org/pseudo/tree/ports/linux/guts/syscall.c
https://git.yoctoproject.org/pseudo/tree/ports/linux/guts/syscall.c
Comment 3 Mark Hatle 2026-01-15 00:55:56 UTC
psseudo master has a syscall intercept for SYS_openat2 that returns ENOSYS.  This should unblock immediate users.

Additionally, I've adapted 'openat' as a possible 'openat2' implementation.

See: https://git.yoctoproject.org/pseudo/commit/?h=fray/master-wip&id=022e103f0b1223fb6557d730471196cb2223ac27

This is a first version.  Once the function (not syscall) is mainstream, we'll likely want to have 'openat' call 'openat2', as well and adjust it to pass through whatever openat2 interface glibc ends up with, but until then this SHOULD work and is good enough for testing purposes.
Comment 4 Randy MacLeod 2026-01-15 16:09:08 UTC
Lower to M+.

We've got a patch to return ENOSYS for now and
there is a plan for a proper implementation.
Comment 5 Paul Barker 2026-04-08 09:45:48 UTC
Based on Zoltan's testing, it looks like we'll need full openat2() handling to build on Fedora 44 [1].

[1]: https://lore.kernel.org/openembedded-core/1b979680925d535d3cd344a8b736b8f862d52498.camel@pbarker.dev/
Comment 6 Paul Barker 2026-04-13 15:45:51 UTC
We could use the gnulib openat2() implementation, relying on the fact that it calls openat() which we already handle.

https://gitweb.git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/openat2.c;h=2be62c921c5b90e8b0d528b33501ed3e1f2d7f92;hb=HEAD
Comment 7 Richard Purdie 2026-04-15 13:52:24 UTC
https://git.yoctoproject.org/pseudo/log/?h=rpurdie/openat2 has a one idea of how we could make it work, I found and worked around the issue in Mark's implementation. I am worried there may be chroot issues with that change though.
Comment 8 Richard Purdie 2026-04-30 20:58:30 UTC
https://git.yoctoproject.org/pseudo/commit/?id=6533a536f93a13ec39e5fd42e3385798729e093f and following commit.