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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [reent/] [fstat64r.c] - Blame information for rev 258

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

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

powered by: WebSVN 2.1.0

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