Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/stdio/fgets.3
Context not available. | |||||
.Ft char * | .Ft char * | ||||
.Fn fgets "char * restrict str" "int size" "FILE * restrict stream" | .Fn fgets "char * restrict str" "int size" "FILE * restrict stream" | ||||
.Ft char * | .Ft char * | ||||
.Fn gets_s "char *str" "rsize_t size" | |||||
.Ft char * | |||||
bjk: Please remember to update .Dd when committing. | |||||
cyAuthorUnsubmitted Not Done Inline ActionsI'll update it again just prior to commit. cy: I'll update it again just prior to commit. | |||||
emasteUnsubmitted Not Done Inline Actionsa post-commit comment: should gets_s also be in the title? .Sh NAME .Nm fgets , .Nm gets , .Nm gets_s .Nd get a line from a stream noticed while merging this to my working branch which has plain gets removed. emaste: a post-commit comment: should gets_s also be in the title?
```
.Sh NAME
.Nm fgets ,
.Nm gets ,
. | |||||
.Fn gets "char *str" | .Fn gets "char *str" | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
Context not available. | |||||
character is appended to end the string. | character is appended to end the string. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn gets_s | |||||
function | |||||
is equivalent to | |||||
.Fn fgets | |||||
with a | |||||
.Fa stream | |||||
of | |||||
.Dv stdin , | |||||
except that the newline character (if any) is not stored in the string. | |||||
.Pp | |||||
The | |||||
.Fn gets | .Fn gets | ||||
function | function | ||||
is equivalent to | is equivalent to | ||||
Context not available. | |||||
if any, is sufficiently short to fit in the string. | if any, is sufficiently short to fit in the string. | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
Upon successful completion, | Upon successful completion, | ||||
.Fn fgets | .Fn fgets , | ||||
.Fn gets_s | |||||
Not Done Inline Actions.Fn gets_s , wblock: [[ https://www.freebsd.org/doc/en_US.ISO8859-1/books/fdp-primer/writing-style-guidelines.html |… | |||||
and | and | ||||
.Fn gets | .Fn gets | ||||
return | return | ||||
Context not available. | |||||
.Dv NULL | .Dv NULL | ||||
and the buffer contents are indeterminate. | and the buffer contents are indeterminate. | ||||
The | The | ||||
.Fn fgets | .Fn fgets , | ||||
.Fn gets_s | |||||
Done Inline ActionsAs above: .Fn gets_s , wblock: As above:
```.Fn gets_s ,``` | |||||
and | and | ||||
.Fn gets | .Fn gets | ||||
functions | functions | ||||
Context not available. |
Please remember to update .Dd when committing.