4
* Copyright 1987, 1988 by the Massachusetts Institute of Technology.
6
* For copying and distribution information, please see the file
10
#include "mit-copyright.h"
19
* getst() takes a file descriptor, a string and a count. It reads
20
* from the file until either it has read "count" characters, or until
21
* it reads a null byte. When finished, what has been read exists in
22
* the given string "s". If "count" characters were actually read, the
23
* last is changed to a null, so the returned string is always null-
24
* terminated. getst() returns the number of characters read, including
25
* the null terminator.
34
register int count = n;
35
while (read(fd, s, 1) > 0 && --count)