aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdio/stdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/stdio.c')
-rw-r--r--newlib/libc/stdio/stdio.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/newlib/libc/stdio/stdio.c b/newlib/libc/stdio/stdio.c
index 8bc7360..3cf3ea7 100644
--- a/newlib/libc/stdio/stdio.c
+++ b/newlib/libc/stdio/stdio.c
@@ -30,9 +30,10 @@
*/
_READ_WRITE_RETURN_TYPE
-_DEFUN(__sread, (cookie, buf, n),
- _PTR cookie _AND
- char *buf _AND
+_DEFUN(__sread, (ptr, cookie, buf, n),
+ struct _reent *ptr _AND
+ void *cookie _AND
+ char *buf _AND
int n)
{
register FILE *fp = (FILE *) cookie;
@@ -44,7 +45,7 @@ _DEFUN(__sread, (cookie, buf, n),
oldmode = setmode (fp->_file, O_BINARY);
#endif
- ret = _read_r (_REENT, fp->_file, buf, n);
+ ret = _read_r (ptr, fp->_file, buf, n);
#ifdef __SCLE
if (oldmode)
@@ -61,9 +62,10 @@ _DEFUN(__sread, (cookie, buf, n),
}
_READ_WRITE_RETURN_TYPE
-_DEFUN(__swrite, (cookie, buf, n),
- _PTR cookie _AND
- char _CONST *buf _AND
+_DEFUN(__swrite, (ptr, cookie, buf, n),
+ struct _reent *ptr _AND
+ void *cookie _AND
+ char const *buf _AND
int n)
{
register FILE *fp = (FILE *) cookie;
@@ -73,7 +75,7 @@ _DEFUN(__swrite, (cookie, buf, n),
#endif
if (fp->_flags & __SAPP)
- _CAST_VOID _lseek_r (_REENT, fp->_file, (_off_t) 0, SEEK_END);
+ _lseek_r (ptr, fp->_file, (_off_t) 0, SEEK_END);
fp->_flags &= ~__SOFF; /* in case O_APPEND mode is set */
#ifdef __SCLE
@@ -81,7 +83,7 @@ _DEFUN(__swrite, (cookie, buf, n),
oldmode = setmode (fp->_file, O_BINARY);
#endif
- w = _write_r (_REENT, fp->_file, buf, n);
+ w = _write_r (ptr, fp->_file, buf, n);
#ifdef __SCLE
if (oldmode)
@@ -92,15 +94,16 @@ _DEFUN(__swrite, (cookie, buf, n),
}
_fpos_t
-_DEFUN(__sseek, (cookie, offset, whence),
- _PTR cookie _AND
+_DEFUN(__sseek, (ptr, cookie, offset, whence),
+ struct _reent *ptr _AND
+ void *cookie _AND
_fpos_t offset _AND
int whence)
{
register FILE *fp = (FILE *) cookie;
register _off_t ret;
- ret = _lseek_r (_REENT, fp->_file, (_off_t) offset, whence);
+ ret = _lseek_r (ptr, fp->_file, (_off_t) offset, whence);
if (ret == -1L)
fp->_flags &= ~__SOFF;
else
@@ -112,20 +115,22 @@ _DEFUN(__sseek, (cookie, offset, whence),
}
int
-_DEFUN(__sclose, (cookie),
- _PTR cookie)
+_DEFUN(__sclose, (ptr, cookie),
+ struct _reent *ptr _AND
+ void *cookie)
{
FILE *fp = (FILE *) cookie;
- return _close_r (_REENT, fp->_file);
+ return _close_r (ptr, fp->_file);
}
#ifdef __SCLE
int
-_DEFUN(__stextmode, (fd),
+_DEFUN(__stextmode, (fd),
int fd)
{
#ifdef __CYGWIN__
+ extern int _cygwin_istext_for_stdio (int);
return _cygwin_istext_for_stdio (fd);
#else
return 0;