bgets(3G) bgets(3G)
NAME
bgets() - read stream up to next delimiter
SYNOPSIS
DESCRIPTION
reads characters from stream into buffer until either count is exhausted or one of the characters in breakstring is encountered in the
stream. The read data is terminated with a null byte and a pointer to the trailing null is returned. If a breakstring character is
encountered, the last nonnull is the delimiter character that terminated the scan.
Note that, except for the fact that the returned value points to the of the read string rather than to the beginning, the call
is identical to
There is always enough room reserved in the buffer for the trailing null.
If breakstring is a null pointer, the value of breakstring from the previous call is used. If breakstring is null at the first call, no
characters will be used to delimit the string.
To use this interface, link in the libgen library by specifying For example:
RETURN VALUE
NULL is returned on error or end-of-file. Reporting the condition is delayed to the next call if any characters were read but not yet
returned.
EXAMPLES
SEE ALSO
gets(3S), thread_safety(5).
bgets(3G)