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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [reent/] [open64r.c] - Blame information for rev 345

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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