1 2 3 4 5 6 7 8 9 10 11 12
#include "reent.h" #include "errno.h" #include <fio.h> int close(int fd) { if (!fio_is_open(fd)) { _impure_ptr->_errno = EBADF; return -1; } return fio_close(fd); }