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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libc/] [reent/] [stat64r.c] - Blame information for rev 326

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

Line No. Rev Author Line
1 148 jeremybenn
/* Reentrant versions of stat64 system call.  This implementation just
2
   calls the stat64 system call.  */
3
 
4
#include <reent.h>
5
#include <unistd.h>
6
#include <sys/stat.h>
7
#include <_syslist.h>
8
 
9
/* Some targets provides their own versions of these functions.  Those
10
   targets should define REENTRANT_SYSCALLS_PROVIDED in
11
   TARGET_CFLAGS.  */
12
 
13
#ifdef _REENT_ONLY
14
#ifndef REENTRANT_SYSCALLS_PROVIDED
15
#define REENTRANT_SYSCALLS_PROVIDED
16
#endif
17
#endif
18
 
19
#ifdef REENTRANT_SYSCALLS_PROVIDED
20
 
21
int _dummy_stat64_syscalls = 1;
22
 
23
#else
24
 
25
/* We use the errno variable used by the system dependent layer.  */
26
#undef errno
27
extern int errno;
28
 
29
/*
30
FUNCTION
31
        <<_stat64_r>>---Reentrant version of stat64
32
 
33
INDEX
34
        _stat64_r
35
 
36
ANSI_SYNOPSIS
37
        #include <reent.h>
38
        int _stat64_r(struct _reent *<[ptr]>,
39
                    const char *<[file]>, struct stat64 *<[pstat]>);
40
 
41
TRAD_SYNOPSIS
42
        #include <reent.h>
43
        int _stat64_r(<[ptr]>, <[file]>, <[pstat]>)
44
        struct _reent *<[ptr]>;
45
        char *<[file]>;
46
        struct stat64 *<[pstat]>;
47
 
48
DESCRIPTION
49
        This is a reentrant version of <<stat64>>.  It
50
        takes a pointer to the global data block, which holds
51
        <<errno>>.
52
*/
53
 
54
int
55
_DEFUN (_stat64_r, (ptr, file, pstat),
56
     struct _reent *ptr _AND
57
     _CONST char *file _AND
58
     struct stat64 *pstat)
59
{
60
  int ret;
61
 
62
  errno = 0;
63
  if ((ret = _stat64 (file, pstat)) == -1 && errno != 0)
64
    ptr->_errno = errno;
65
  return ret;
66
}
67
 
68
#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */

powered by: WebSVN 2.1.0

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