Closed cazfi closed 1 year ago
So you are saying yuo have a system where this fails with ENOSYS
? But why does the first g_open() succeed then? That's precisely what the else
branch is meant to do.. How does it fail exactly? the g_assert_cmpint
should print the actual value.
EOPNOTSUPP, I think:
assertion failed (errno == 0): (95 == 0)
OK, so your kernel supports O_TMPFILE
in general (in /tmp/
, and the mocked /dev
usually lives in /tmp/. So I can't make sense of this yet...
Or it means that the redirection is not working and it opened the real /dev
? e.g. LD_PRELOAD not having kicked in?
Possibly, but I'd expect an EPERM/EACCESS then, as the user is hopefully not allowed to write into /dev
❱❱❱ strace -e openat touch /etc/foo
openat(AT_FDCWD, "/etc/foo", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = -1 EACCES (Permission denied)
Either way, @cazfi please let me know some details here --- OS, build environment, how you built, and please run the whole thing through strace -fvvs1024 -o /tmp/trace
. Thanks!
the mocked
/dev
usually lives in /tmp/.
It might be that "usually" is the key word here. This is a NixOS build, so things might live in unusual places.
Ah, NixOS! Do you have $TMPDIR
or $TEMPDIR
set in that environment? Could you try a build with replacing the "/tmp"
with g_get_tmp_dir()
?
I don't have that particular setup any more, and on other kind of setups I have everything works.
OK, thanks for reporting back. I'll commit the g_get_tmpdir() thing, can't hurt.
I have O_TMPFILE test failing. More precisely, it's the "errno == 0" assert that fails. Likely the problem is that you don't have as strict checks for whether it's even supposed to work as actual tests are: