Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2007-05-02 03:03:36 +0400
committerEric Blake <eblake@redhat.com>2007-05-02 03:03:36 +0400
commitb4f095585f1e139cba8d2e078c807e384b3e102d (patch)
treee7ee261d556586898030b9ac5252c6a2ab3d5c1d /newlib/libc/stdio
parent2babeb3d94cb8a507ca12b46252995b453600290 (diff)
* libc/stdio64/local64.h: Delete, move contents to...
* libc/stdio/local.h: ...here. * libc/stdio64/fdopen64.c: Update includes. * libc/stdio64/fopen64.c: Likewise. * libc/stdio64/freopen64.c: Likewise. * libc/stdio64/fseeko64.c: Likewise. * libc/stdio64/ftello64.c: Likewise. * libc/stdio/findfp.c (std) [__LARGE64_FILES]: Open stdin, stdout, and stderr with 64-bit offset. * libc/stdio/fseek.c (_fseek_r): Avoid compile warning. * libc/stdio/makebuf.c (__smakebuf_r): Likewise. * libc/stdio/mktemp.c (_gettemp): Likewise.
Diffstat (limited to 'newlib/libc/stdio')
-rw-r--r--newlib/libc/stdio/findfp.c24
-rw-r--r--newlib/libc/stdio/fseek.c8
-rw-r--r--newlib/libc/stdio/local.h8
-rw-r--r--newlib/libc/stdio/makebuf.c4
-rw-r--r--newlib/libc/stdio/mktemp.c6
5 files changed, 38 insertions, 12 deletions
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c
index ac1354619..43f02ba5f 100644
--- a/newlib/libc/stdio/findfp.c
+++ b/newlib/libc/stdio/findfp.c
@@ -52,7 +52,13 @@ _DEFUN(std, (ptr, flags, file, data),
ptr->_lbfsize = 0;
ptr->_cookie = ptr;
ptr->_read = __sread;
+#ifndef __LARGE64_FILES
ptr->_write = __swrite;
+#else /* __LARGE64_FILES */
+ ptr->_write = __swrite64;
+ ptr->_seek64 = __sseek64;
+ ptr->_flags |= __SL64;
+#endif /* __LARGE64_FILES */
ptr->_seek = __sseek;
ptr->_close = __sclose;
#if !defined(__SINGLE_THREAD__) && !defined(_REENT_SMALL)
@@ -100,7 +106,7 @@ _DEFUN(__sfp, (d),
int n;
struct _glue *g;
- __sfp_lock_acquire ();
+ __sfp_lock_acquire ();
if (!_GLOBAL_REENT->__sdidinit)
__sinit (_GLOBAL_REENT);
@@ -113,7 +119,7 @@ _DEFUN(__sfp, (d),
(g->_next = __sfmoreglue (d, NDYNAMIC)) == NULL)
break;
}
- __sfp_lock_release ();
+ __sfp_lock_release ();
d->_errno = ENOMEM;
return NULL;
@@ -123,7 +129,7 @@ found:
#ifndef __SINGLE_THREAD__
__lock_init_recursive (fp->_lock);
#endif
- __sfp_lock_release ();
+ __sfp_lock_release ();
fp->_p = NULL; /* no current pointer */
fp->_w = 0; /* nothing to read or write */
@@ -198,7 +204,7 @@ _DEFUN(__sinit, (s),
std (s->_stdin, __SRD, 0, s);
- /* on platforms that have true file system I/O, we can verify whether stdout
+ /* on platforms that have true file system I/O, we can verify whether stdout
is an interactive terminal or not. For all other platforms, we will
default to line buffered mode here. */
#ifdef HAVE_FCNTL
@@ -220,25 +226,25 @@ __LOCK_INIT_RECURSIVE(static, __sinit_lock);
_VOID
_DEFUN_VOID(__sfp_lock_acquire)
{
- __lock_acquire_recursive (__sfp_lock);
+ __lock_acquire_recursive (__sfp_lock);
}
_VOID
_DEFUN_VOID(__sfp_lock_release)
{
- __lock_release_recursive (__sfp_lock);
+ __lock_release_recursive (__sfp_lock);
}
_VOID
_DEFUN_VOID(__sinit_lock_acquire)
{
- __lock_acquire_recursive (__sinit_lock);
+ __lock_acquire_recursive (__sinit_lock);
}
_VOID
_DEFUN_VOID(__sinit_lock_release)
{
- __lock_release_recursive (__sinit_lock);
+ __lock_release_recursive (__sinit_lock);
}
/* Walkable file locking routine. */
@@ -264,7 +270,7 @@ _DEFUN(__fp_unlock, (ptr),
_VOID
_DEFUN_VOID(__fp_lock_all)
{
- __sfp_lock_acquire ();
+ __sfp_lock_acquire ();
_CAST_VOID _fwalk (_REENT, __fp_lock);
}
diff --git a/newlib/libc/stdio/fseek.c b/newlib/libc/stdio/fseek.c
index 9ba9fac36..e1670e1a1 100644
--- a/newlib/libc/stdio/fseek.c
+++ b/newlib/libc/stdio/fseek.c
@@ -32,9 +32,9 @@ ANSI_SYNOPSIS
#include <stdio.h>
int fseek(FILE *<[fp]>, long <[offset]>, int <[whence]>)
int fseeko(FILE *<[fp]>, off_t <[offset]>, int <[whence]>)
- int _fseek_r(struct _reent *<[ptr]>, FILE *<[fp]>,
+ int _fseek_r(struct _reent *<[ptr]>, FILE *<[fp]>,
long <[offset]>, int <[whence]>)
- int _fseeko_r(struct _reent *<[ptr]>, FILE *<[fp]>,
+ int _fseeko_r(struct _reent *<[ptr]>, FILE *<[fp]>,
off_t <[offset]>, int <[whence]>)
TRAD_SYNOPSIS
@@ -126,7 +126,11 @@ _DEFUN(_fseek_r, (ptr, fp, offset, whence),
_fpos_t target;
_fpos_t curoff = 0;
size_t n;
+#ifdef __USE_INTERNAL_STAT64
+ struct stat64 st;
+#else
struct stat st;
+#endif
int havepos;
/* Make sure stdio is set up. */
diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h
index 4263a9de6..0dba774ae 100644
--- a/newlib/libc/stdio/local.h
+++ b/newlib/libc/stdio/local.h
@@ -46,6 +46,14 @@ extern int _EXFUN(_fwalk,(struct _reent *, int (*)(FILE *)));
extern int _EXFUN(_fwalk_reent,(struct _reent *, int (*)(struct _reent *, FILE *)));
struct _glue * _EXFUN(__sfmoreglue,(struct _reent *,int n));
+#ifdef __LARGE64_FILES
+extern _fpos64_t _EXFUN(__sseek64,(void *, _fpos64_t, int));
+extern _fpos64_t _EXFUN(__sseek64_r,(struct _reent *, void *, _fpos64_t, int));
+extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64,(void *, char const *, int));
+extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64_r,(struct _reent *, void *,
+ char const *, int));
+#endif
+
/* Called by the main entry point fns to ensure stdio has been initialized. */
#ifdef _REENT_SMALL
diff --git a/newlib/libc/stdio/makebuf.c b/newlib/libc/stdio/makebuf.c
index 340ea28c5..d13f162b2 100644
--- a/newlib/libc/stdio/makebuf.c
+++ b/newlib/libc/stdio/makebuf.c
@@ -41,7 +41,11 @@ _DEFUN(__smakebuf_r, (ptr, fp),
{
register size_t size, couldbetty;
register _PTR p;
+#ifdef __USE_INTERNAL_STAT64
+ struct stat64 st;
+#else
struct stat st;
+#endif
if (fp->_flags & __SNBF)
{
diff --git a/newlib/libc/stdio/mktemp.c b/newlib/libc/stdio/mktemp.c
index 59e7a5c66..e00228e15 100644
--- a/newlib/libc/stdio/mktemp.c
+++ b/newlib/libc/stdio/mktemp.c
@@ -60,7 +60,7 @@ TRAD_SYNOPSIS
DESCRIPTION
<<mktemp>> and <<mkstemp>> attempt to generate a file name that is not
-yet in use for any existing file. <<mkstemp>> creates the file and
+yet in use for any existing file. <<mkstemp>> creates the file and
opens it for reading and writing; <<mktemp>> simply generates the file name.
You supply a simple pattern for the generated file name, as the string
@@ -108,7 +108,11 @@ _DEFUN(_gettemp, (ptr, path, doopen),
register int *doopen)
{
register char *start, *trv;
+#ifdef __USE_INTERNAL_STAT64
+ struct stat64 sbuf;
+#else
struct stat sbuf;
+#endif
unsigned int pid;
pid = _getpid_r (ptr);