OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [sysdeps/] [_xstat.c] - Blame information for rev 1775

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
#include <syscall.h>
2
#include <errno.h>
3
#include <sys/stat.h>
4
#include <asm/stat.h>
5
 
6
static inline
7
_syscall2(int,prev_stat,const char *,path, struct stat *,statbuf)
8
 
9
int
10
_xstat(int version, const char * path, struct stat * statbuf)
11
{
12
  int result;
13
  struct new_stat kbuf;
14
  struct stat *buf = (struct stat *) statbuf;
15
 
16
  switch(version)
17
  {
18
  case 1:
19
    result = prev_stat (path, statbuf);
20
    break;
21
 
22
#if 0
23
  case LINUX_STAT_VERSION:
24
    result = oldstat (path, &kbuf);
25
    if (result == 0)
26
    {
27
      /* Convert to current kernel version of `struct stat'.  */
28
      buf->st_dev = kbuf.st_dev;
29
      buf->__pad1 = 0;
30
      buf->st_ino = kbuf.st_ino;
31
      buf->st_mode = kbuf.st_mode;
32
      buf->st_nlink = kbuf.st_nlink;
33
      buf->st_uid = kbuf.st_uid;
34
      buf->st_gid = kbuf.st_gid;
35
      buf->st_rdev = kbuf.st_rdev;
36
      buf->__pad2 = 0;
37
      buf->st_size = kbuf.st_size;
38
      buf->st_blksize = kbuf.st_blksize;
39
      buf->st_blocks = kbuf.st_blocks;
40
      buf->st_atime = kbuf.st_atime;
41
      buf->__unused1 = 0;
42
      buf->st_mtime = kbuf.st_mtime;
43
      buf->__unused2 = 0;
44
      buf->st_ctime = kbuf.st_ctime;
45
      buf->__unused3 = 0;
46
      buf->__unused4 = 0;
47
      buf->__unused5 = 0;
48
    }
49
    break;
50
#endif
51
  default:
52
    errno = EINVAL;
53
    result = -1;
54
    break;
55
  }
56
 
57
  return result;
58
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.