Rework tail plateform module to tackle #2873
For the moment, these are just performance improvements (using the right name, not checking if the fd is negative as that can't be in rust, using the libc value)
The goal of this is to tackle #2873 more easily later on.
@sylvestre trying to use isatty on stdin to do the stdin in is_pipe_or_fifo check results in a not implemented error on occasions. I had to use fstat is this a known phenomenon or not ? @tertsdiepraam
I haven't seen that before. Which isatty were you using? libc, nix or the atty crate?
The problem is at the libc level, I've tried all three
When piping in /dev/null (or stdin was closed), the problem occurred.
Interesting, I can't check for myself right now, but what was the exact error?
Interesting, I can't check for myself right now, but what was the exact error?
It panics with a not yet implemented, which I don't get as we're using it for other utils.
@sylvestre failures are unrelated, so we can merge this, I'll change it to use atty when this will be sorted out or we can just leave this open
Interesting, I can't check for myself right now, but what was the exact error?
@tertsdiepraam @jhscheer This error was due to the not inplemented handling of block devices, it turns out isatty mistakenly reports that stdin is a terminal because rust reopens stdin as /dev/null which is a block device
@jhscheer here's an in-depth post on how to implement this case, which I put here for reference.
https://superuser.com/a/1267407