why does reading a line of input from devzero make my computer unresponsive?

/dev/zero is a never-ending stream of NUL bytes. read_line stops when it reads a newline symbol. So, this function will never return and will try to infinitely expand the buffer. The reason your computer becomes unresponsive is likely because it starts swapping heavily, in order to accommodate the ever-growing buffer.

read_line() is definitely not what you want. Try reading a fixed amount of bytes instead?

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top