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

Side by Side Diff: sysdeps/nacl/xstat.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: fixing comments, spacing and some other minor stuff. Created 9 years, 11 months 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
OLDNEW
1 1
2 #include <errno.h> 2 #include <errno.h>
3 #include <sys/stat.h> 3 #include <sys/stat.h>
4 4
5 #include <nacl_stat.h> 5 #include <nacl_stat.h>
6 #include <nacl_syscalls.h> 6 #include <nacl_syscalls.h>
7 7
8 int __xstat (int version, const char *path, struct stat *buf) 8 int __xstat (int version, const char *path, struct stat *buf)
9 { 9 {
10 if (buf == NULL || path == NULL) 10 if (buf == NULL || path == NULL)
11 { 11 {
12 errno = EFAULT; 12 errno = EFAULT;
13 return -1; 13 return -1;
14 } 14 }
15 struct nacl_abi_stat st; 15 struct nacl_abi_stat st;
16 int result = NACL_SYSCALL (stat) (path, &st); 16 int result = NACL_SYSCALL (stat) (path, &st);
17 if (result < 0) 17 if (result < 0)
18 { 18 {
19 errno = -result; 19 errno = -result;
20 return -1; 20 return -1;
21 } 21 }
22 else 22 else
23 { 23 {
24 buf->st_dev = st.nacl_abi_st_dev; 24 __nacl_abi_stat_to_stat (&st, buf);
25 #ifdef _HAVE_STAT___PAD1
26 buf->__pad1 = 0;
27 #endif
28 buf->st_ino = st.nacl_abi_st_ino;
29 buf->st_mode = st.nacl_abi_st_mode;
30 buf->st_nlink = st.nacl_abi_st_nlink;
31 buf->st_uid = st.nacl_abi_st_uid;
32 buf->st_gid = st.nacl_abi_st_gid;
33 buf->st_rdev = st.nacl_abi_st_rdev;
34 #ifdef _HAVE_STAT___PAD2
35 buf->__pad2 = 0;
36 #endif
37 buf->st_size = st.nacl_abi_st_size;
38 buf->st_blksize = st.nacl_abi_st_blksize;
39 buf->st_blocks = st.nacl_abi_st_blocks;
40 buf->st_atime = st.nacl_abi_st_atime;
41 buf->st_mtime = st.nacl_abi_st_mtime;
42 buf->st_ctime = st.nacl_abi_st_ctime;
43 return 0; 25 return 0;
44 } 26 }
45 } 27 }
46 libc_hidden_def (__xstat) 28 libc_hidden_def (__xstat)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698