| // NACL MOD TRACK "third_party/nacl-glibc/sysdeps/nacl/fxstat.c" | |
| #include <errno.h> | |
| #include <stddef.h> | |
| #include <sys/stat.h> | |
| // NACL MOD BEGIN | |
| // Remove unnecessary include. | |
| // NACL MOD END | |
| #include <nacl_stat.h> | |
| #include <irt_syscalls.h> | |
| int fstat(int fd, struct stat *buf) | |
| { | |
| if (buf == NULL) { | |
| errno = EFAULT; | |
| return -1; | |
| } | |
| struct nacl_abi_stat nacl_buf; | |
| int result = __nacl_irt_fstat (fd, &nacl_buf); | |
| if (result != 0) { | |
| errno = result; | |
| return -1; | |
| } | |
| __nacl_abi_stat_to_stat (&nacl_buf, buf); | |
| return 0; | |
| } |