4 ms·
No I don't think it's the "Read" call, but rather your program doesn't see any input in stdin until an enter is pressed. (In cooked mode).
by Tyr42 9y ago
No I don't think it's the "Read" call, but rather your program doesn't see any input in stdin until an enter is pressed. (In cooked mode).
- int0x80 9y agoI think I didn't explain myself. What you say is true, but even if your program doesn't see any input, you can (the kernel n_tty line discipline) edit the input (delete it). So if I do print() read() print() read() the reads will only be able to edit what has been input since that particular syscall.