On a Thursday in 2025, Michal Privoznik via Devel wrote:
From: Michal Privoznik <mpriv...@redhat.com>In some cases (well, majority), open() is either rewritten to open64(), either by plain '#define open open64') or at assembly level (using __REDIRECT macro). See <fcntl.h> for more info. This didn't really matter to us, because we do not chain load two mocks that would need to reimplement open() at the same time. But this is soon going to change. The problem is, that VIR_MOCK_REAL_INIT(open) glances over aforementioned rewrite and initializes real_open pointer to open() from the standard C library. But it needs to point to open() (well, open64()) from the next mock on the list. Therefore, init real_open to open64().
I cannot find it in the git history. Did we use to mock open64 separately? Or was that one of the other open's glibc might expand it to? Jano
But of course, this is all glibc specific and for example musl does the oposite (#define open64 open). Signed-off-by: Michal Privoznik <mpriv...@redhat.com> --- tests/nssmock.c | 4 ++++ tests/qemusecuritymock.c | 4 ++++ tests/vircgroupmock.c | 4 ++++ tests/virfilewrapper.c | 4 ++++ tests/virpcimock.c | 4 ++++ tests/virtestmock.c | 4 ++++ tests/virusbmock.c | 4 ++++ 7 files changed, 28 insertions(+)
signature.asc
Description: PGP signature