6 #include <kernel_stat.h>
8 #include <nacl_syscalls.h>
11 int __fxstat(int vers
, int fd
, struct stat
*buf
)
13 int (*nacl_fstat
)(int fd
, struct nacl_abi_stat
*buf
) =
14 NACL_SYSCALL_ADDR(NACL_sys_fstat
);
16 struct nacl_abi_stat nacl_buf
;
17 int result
= nacl_fstat(fd
, &nacl_buf
);
22 buf
->st_dev
= nacl_buf
.nacl_abi_st_dev
;
23 #ifdef _HAVE_STAT___PAD1
26 buf
->st_ino
= nacl_buf
.nacl_abi_st_ino
;
27 buf
->st_mode
= nacl_buf
.nacl_abi_st_mode
;
28 buf
->st_nlink
= nacl_buf
.nacl_abi_st_nlink
;
29 buf
->st_uid
= nacl_buf
.nacl_abi_st_uid
;
30 buf
->st_gid
= nacl_buf
.nacl_abi_st_gid
;
31 buf
->st_rdev
= nacl_buf
.nacl_abi_st_rdev
;
32 #ifdef _HAVE_STAT___PAD2
35 buf
->st_size
= nacl_buf
.nacl_abi_st_size
;
36 buf
->st_blksize
= nacl_buf
.nacl_abi_st_blksize
;
37 buf
->st_blocks
= nacl_buf
.nacl_abi_st_blocks
;
38 buf
->st_atim
.tv_sec
= nacl_buf
.nacl_abi_st_atime
;
39 buf
->st_atim
.tv_nsec
= 0;
40 buf
->st_mtim
.tv_sec
= nacl_buf
.nacl_abi_st_mtime
;
41 buf
->st_mtim
.tv_nsec
= 0;
42 buf
->st_ctim
.tv_sec
= nacl_buf
.nacl_abi_st_ctime
;
43 buf
->st_ctim
.tv_nsec
= 0;
44 #ifdef _HAVE_STAT___UNUSED4
47 #ifdef _HAVE_STAT___UNUSED5
53 weak_alias (__fxstat
, _fxstat
)