| Main index | Section 3 | Options |
#include <stdio.h>
The fdclose() function is equivalent to fclose() except that it does not close the underlying file descriptor. If fdp is not NULL, the file descriptor will be written to it. If the fdp argument will be different then NULL the file descriptor will be returned in it, If the stream does not have an associated file descriptor, fdp will be set to -1. This type of stream is created with functions such as fmemopen(3), funopen(3), or open_memstream(3).
The fcloseall() function calls fclose() on all open streams.
Upon successful completion the fclose() and fdclose() functions return 0. Otherwise, EOF is returned and the global variable errno is set to indicate the error.
| [EOPNOTSUPP] | |
| The stream does not have an associated file descriptor. | |
The fclose() and fdclose() functions may also fail and set errno for any of the errors specified for fflush(3).
The fclose() function may also fail and set errno for any of the errors specified for close(2).
The fdclose() function first appeared in FreeBSD 11.0 .
| FCLOSE (3) | July 4, 2015 |
| Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | Our grievance is not just against Unix itself, but against the cult of Unix zealots who defend and nurture it. They take the heat, disease, and pestilence as givens, and, as ancient shamans did, display their wounds, some self-inflicted, as proof of their power and wizardry. We aim, through bluntness and humor, to show them that they pray to a tin god, and that science, not religion, is the path to useful and friendly technology. | ” |
| — The Unix Haters' handbook | ||