Function that allows the user to read line by line from a file descriptor a.k.a. fd. It reads a defined size buffer from fd and analyzes if there is a new line character. If there is any, it returns all the line until the new line is found. Else it will return the entire line. If executed more than one time, the program reads first from the static variable to see if there are any characters left from the last execution.
We have "This is a \nnewline."
First execution -> "This is a \n"
Second execution -> "new line."