cat: strange ioctl call (no need for the case without arg?)
Open
Beginner friendly
Nobody has claimed this yet.
U - cat
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
$ strace -c -e ioctl cat /lib/chromium/chromium >/dev/null
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
0.00 0.000000 0 1 1 ioctl
GNU does not call it while both of cat -A call it.
I guess https://github.com/uutils/coreutils/blob/a3ae2c4f4dcaa6747704cc387c29edf45e6f50aa/src/uu/cat/src/cat.rs#L377 is unnecessary for the case no arg (thus, not buffered).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/uu/cat/src/cat.rs around line 377 and reproduce the supplied strace command with cat invoked without arguments. Compare the ioctl behavior with GNU cat and cat -A, then verify whether the no-argument path should avoid that call; done means the behavior matches the intended comparison.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100