2003-08-26 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Allow the io64 function prototypes for Cygwin when compiling newlib. * libc/include/sys/stat.h[__CYGWIN__]: Define stat64 as __stat64 to expose the Cygwin struct __stat64 type. * libc/stdio64/fseeko64.c: Use _fstat64_r and pass a struct stat64 pointer. * libc/stdio64/tmpfile64.c(_tmpfile64_r): Call _fopen64_r.
This commit is contained in:
parent
1ce25e2add
commit
0eca075074
|
@ -1,3 +1,13 @@
|
||||||
|
2003-08-26 Jeff Johnston <jjohnstn@redhat.com>
|
||||||
|
|
||||||
|
* libc/include/stdio.h: Allow the io64 function prototypes for
|
||||||
|
Cygwin when compiling newlib.
|
||||||
|
* libc/include/sys/stat.h[__CYGWIN__]: Define stat64 as __stat64
|
||||||
|
to expose the Cygwin struct __stat64 type.
|
||||||
|
* libc/stdio64/fseeko64.c: Use _fstat64_r and pass a struct stat64
|
||||||
|
pointer.
|
||||||
|
* libc/stdio64/tmpfile64.c(_tmpfile64_r): Call _fopen64_r.
|
||||||
|
|
||||||
2003-08-23 Christopher Faylor <cgf@redhat.com>
|
2003-08-23 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* libc/stdio64/fseeko64.c (fseeko64_r): Rename second fseeko64_r
|
* libc/stdio64/fseeko64.c (fseeko64_r): Rename second fseeko64_r
|
||||||
|
|
|
@ -308,7 +308,7 @@ ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *));
|
||||||
ssize_t _EXFUN(__getline, (char **, size_t *, FILE *));
|
ssize_t _EXFUN(__getline, (char **, size_t *, FILE *));
|
||||||
|
|
||||||
#ifdef __LARGE64_FILES
|
#ifdef __LARGE64_FILES
|
||||||
#ifndef __CYGWIN__
|
#if !defined(__CYGWIN__) || defined(_COMPILING_NEWLIB)
|
||||||
FILE * _EXFUN(fdopen64, (int, const char *));
|
FILE * _EXFUN(fdopen64, (int, const char *));
|
||||||
FILE * _EXFUN(fopen64, (const char *, const char *));
|
FILE * _EXFUN(fopen64, (const char *, const char *));
|
||||||
_off64_t _EXFUN(ftello64, (FILE *));
|
_off64_t _EXFUN(ftello64, (FILE *));
|
||||||
|
|
|
@ -24,6 +24,7 @@ extern "C" {
|
||||||
|
|
||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
#include <cygwin/stat.h>
|
#include <cygwin/stat.h>
|
||||||
|
#define stat64 __stat64
|
||||||
#else
|
#else
|
||||||
struct stat
|
struct stat
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,8 +108,7 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence),
|
||||||
_fpos64_t target, curoff;
|
_fpos64_t target, curoff;
|
||||||
size_t n;
|
size_t n;
|
||||||
|
|
||||||
/* FIXME: this should be stat64. */
|
struct stat64 st;
|
||||||
struct stat st;
|
|
||||||
int havepos;
|
int havepos;
|
||||||
|
|
||||||
_flockfile(fp);
|
_flockfile(fp);
|
||||||
|
@ -205,7 +204,7 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence),
|
||||||
{
|
{
|
||||||
if (seekfn != __sseek64
|
if (seekfn != __sseek64
|
||||||
|| fp->_file < 0
|
|| fp->_file < 0
|
||||||
|| _fstat_r (ptr, fp->_file, &st)
|
|| _fstat64_r (ptr, fp->_file, &st)
|
||||||
|| (st.st_mode & S_IFMT) != S_IFREG)
|
|| (st.st_mode & S_IFMT) != S_IFREG)
|
||||||
{
|
{
|
||||||
fp->_flags |= __SNPT;
|
fp->_flags |= __SNPT;
|
||||||
|
|
|
@ -63,9 +63,9 @@ _DEFUN (_tmpfile64_r, (ptr),
|
||||||
|
|
||||||
if ((f = _tmpnam_r (ptr, buf)) == NULL)
|
if ((f = _tmpnam_r (ptr, buf)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
fp = fopen64 (f, "wb+");
|
fp = _fopen64_r (ptr, (const char *)f, "wb+");
|
||||||
e = ptr->_errno;
|
e = ptr->_errno;
|
||||||
_CAST_VOID remove (f);
|
_CAST_VOID _remove_r (ptr, f);
|
||||||
ptr->_errno = e;
|
ptr->_errno = e;
|
||||||
return fp;
|
return fp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue