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/] [lseek64r.c] - Blame information for rev 437

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

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

powered by: WebSVN 2.1.0

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