diff options
Diffstat (limited to 'io/fstat.c')
-rw-r--r-- | io/fstat.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -16,10 +16,16 @@ <https://www.gnu.org/licenses/>. */ #include <sys/stat.h> +#include <errno.h> int __fstat (int fd, struct stat *buf) { + if (fd < 0) + { + __set_errno (EBADF); + return -1; + } return __fstatat (fd, "", buf, AT_EMPTY_PATH); } |