Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1521)

Side by Side Diff: sysdeps/nacl/fxstat.c

Issue 6026005: Fix __fxstat which is called from fstat. Remove obsolete fstat64. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-glibc.git@master
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sysdeps/nacl/nacl_stat.h » ('j') | sysdeps/nacl/nacl_stat.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include <errno.h>
2 #include <stddef.h>
3 #include <sys/stat.h>
4
5 #include <kernel_stat.h>
6 #include <nacl_stat.h>
7 #include <nacl_syscalls.h>
8
9 void __nacl_abi_stat_to_stat (struct nacl_abi_stat *nacl_st,
10 struct stat *st)
11 {
12 st->st_dev = nacl_st->nacl_abi_st_dev;
13 #ifdef _HAVE_STAT___PAD1
14 st->__pad1 = 0;
15 #endif
16 #ifdef _HAVE_STAT___ST_INO
17 st->__st_ino = nacl_st->nacl_abi_st_ino;
18 #endif
19 st->st_mode = nacl_st->nacl_abi_st_mode;
20 st->st_nlink = nacl_st->nacl_abi_st_nlink;
21 st->st_uid = nacl_st->nacl_abi_st_uid;
22 st->st_gid = nacl_st->nacl_abi_st_gid;
23 st->st_rdev = nacl_st->nacl_abi_st_rdev;
24 #ifdef _HAVE_STAT___PAD2
25 st->__pad2 = 0;
26 #endif
27 st->st_size = nacl_st->nacl_abi_st_size;
28 st->st_blksize = nacl_st->nacl_abi_st_blksize;
29 st->st_blocks = nacl_st->nacl_abi_st_blocks;
30 st->st_atim.tv_sec = nacl_st->nacl_abi_st_atime;
31 st->st_atim.tv_nsec = 0;
32 st->st_mtim.tv_sec = nacl_st->nacl_abi_st_mtime;
33 st->st_mtim.tv_nsec = 0;
34 st->st_ctim.tv_sec = nacl_st->nacl_abi_st_ctime;
35 st->st_ctim.tv_nsec = 0;
36 st->st_ino = nacl_st->nacl_abi_st_ino;
37 }
38
39 int __fxstat (int vers, int fd, struct stat *buf)
40 {
41 if (buf == NULL) {
42 errno = EFAULT;
43 return -1;
44 }
45 struct nacl_abi_stat nacl_buf;
46 int result = NACL_SYSCALL (fstat) (fd, &nacl_buf);
47 if (result < 0) {
48 errno = -result;
49 return -1;
50 }
51 __nacl_abi_stat_to_stat (&nacl_buf, buf);
52 return result;
53 }
54 hidden_def (__fxstat)
OLDNEW
« no previous file with comments | « no previous file | sysdeps/nacl/nacl_stat.h » ('j') | sysdeps/nacl/nacl_stat.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698