fclose.c (220B)
1 #include <stdio.h> 2 #include <string.h> 3 #include <errno.h> 4 #include <unistd.h> 5 #include <stdlib.h> 6 #include "ioprivate.h" 7 8 int fclose(FILE *fin) 9 { 10 if (fin == NULL) 11 return -1; 12 close(fin->fd); 13 free(fin); 14 return 0; 15 } 16