unereal
unereal
The example program in man page for stat(2) uses `sb.st_mode & S_IFMT == xyz` to check for xyz bits. Maybe this isn't what we want. `/dev/log`, for example, has multiple...
I too don't understand. This program uses both `stat.st_mode & libc::S_IFMT == XYZ` and `stat.st_mode & XYZ` ``` import std::io; import libc; // Build: c3c compile -o ~/bin/c3stat c3stat.c3 fn...
Okay, `stat`(2) follows symlinks by default. To retrieve information from the link itself, one should use `lstat`(2) instead.
It turns out that `stat.st_mode & libc::S_IFMT == XYZ` in the original patch was correct.
Yes, `(stat.st_mode & libc::S_IFBLK) == libc::S_IFBLK)` should work. Since `libc::S_IFMT` contains `libc::S_IFBLK`, `(stat.st_mode & libc::S_IFMT) == libc::S_IFBLK)` also works. That's how the `S_ISXYZ()` macros are defined in both musl and...
> Yes, `(stat.st_mode & libc::S_IFBLK) == libc::S_IFBLK)` should work. Looks like this style doesn't work with file '/dev/log'. It's a symbolic link but '(sb.st_mode & S_IFCHR) == S_IFCHR' passes. Anyway,...
I was testing various combinations of S_IFXYZ bits with and without the S_IFMT mask, with and without parenthesis around a & b == c in C code. I would convert...