[PATCH 4/6] newlib: document the reentrancy context argument type
H. Peter Anvin
hpa@zytor.com
Thu Dec 3 22:01:39 GMT 2026
Describe __reent_ptr_t and update documented function signatures to use
it. Explain the optional empty TLS representation, the use of _REENT
rather than literal NULL arguments, and the requirement that callers
and platform implementations agree on the configured ABI.
Keep these documentation changes separate from the mechanical source
conversion and the implementation of empty contexts.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
libgloss/epiphany/sbrk.c | 6 +++---
newlib/README | 6 ++++++
newlib/libc/iconv/ces/table.c | 2 +-
newlib/libc/iconv/lib/aliasesi.c | 6 +++---
newlib/libc/iconv/lib/conv.h | 6 +++---
newlib/libc/iconv/lib/iconv.c | 6 +++---
newlib/libc/iconv/lib/iconvnls.c | 4 ++--
newlib/libc/iconv/lib/ucsconv.h | 4 ++--
newlib/libc/reent/closer.c | 2 +-
newlib/libc/reent/execr.c | 6 +++---
newlib/libc/reent/fcntlr.c | 2 +-
newlib/libc/reent/fstat64r.c | 2 +-
newlib/libc/reent/fstatr.c | 2 +-
newlib/libc/reent/getentropyr.c | 2 +-
newlib/libc/reent/gettimeofdayr.c | 2 +-
newlib/libc/reent/isattyr.c | 2 +-
newlib/libc/reent/linkr.c | 2 +-
newlib/libc/reent/lseek64r.c | 2 +-
newlib/libc/reent/lseekr.c | 2 +-
newlib/libc/reent/mkdirr.c | 2 +-
newlib/libc/reent/open64r.c | 2 +-
newlib/libc/reent/openr.c | 2 +-
newlib/libc/reent/readr.c | 2 +-
newlib/libc/reent/reent.tex | 10 ++++++++++
newlib/libc/reent/renamer.c | 2 +-
newlib/libc/reent/sbrkr.c | 2 +-
newlib/libc/reent/signalr.c | 4 ++--
newlib/libc/reent/stat64r.c | 2 +-
newlib/libc/reent/statr.c | 2 +-
newlib/libc/reent/timesr.c | 2 +-
newlib/libc/reent/unlinkr.c | 2 +-
newlib/libc/reent/writer.c | 2 +-
newlib/libc/stdio/diprintf.c | 4 ++--
newlib/libc/stdio/dprintf.c | 4 ++--
newlib/libc/stdio/fclose.c | 2 +-
newlib/libc/stdio/fcloseall.c | 2 +-
newlib/libc/stdio/fdopen.c | 2 +-
newlib/libc/stdio/fflush.c | 4 ++--
newlib/libc/stdio/fgetc.c | 4 ++--
newlib/libc/stdio/fgetpos.c | 2 +-
newlib/libc/stdio/fgets.c | 4 ++--
newlib/libc/stdio/fgetwc.c | 8 ++++----
newlib/libc/stdio/fgetws.c | 4 ++--
newlib/libc/stdio/fopen.c | 2 +-
newlib/libc/stdio/fpurge.c | 2 +-
newlib/libc/stdio/fputs.c | 4 ++--
newlib/libc/stdio/fputwc.c | 8 ++++----
newlib/libc/stdio/fputws.c | 4 ++--
newlib/libc/stdio/fread.c | 4 ++--
newlib/libc/stdio/freopen.c | 2 +-
newlib/libc/stdio/fseek.c | 4 ++--
newlib/libc/stdio/fseeko.c | 4 ++--
newlib/libc/stdio/fsetpos.c | 2 +-
newlib/libc/stdio/ftell.c | 4 ++--
newlib/libc/stdio/ftello.c | 4 ++--
newlib/libc/stdio/fwide.c | 2 +-
newlib/libc/stdio/fwrite.c | 4 ++--
newlib/libc/stdio/getc.c | 2 +-
newlib/libc/stdio/getchar.c | 2 +-
newlib/libc/stdio/getchar_u.c | 2 +-
newlib/libc/stdio/gets.c | 2 +-
newlib/libc/stdio/getwchar.c | 4 ++--
newlib/libc/stdio/mktemp.c | 12 ++++++------
newlib/libc/stdio/nano-vfprintf.c | 12 ++++++------
newlib/libc/stdio/nano-vfscanf.c | 6 +++---
newlib/libc/stdio/perror.c | 2 +-
newlib/libc/stdio/putc.c | 2 +-
newlib/libc/stdio/putc_u.c | 2 +-
newlib/libc/stdio/putchar.c | 2 +-
newlib/libc/stdio/puts.c | 2 +-
newlib/libc/stdio/putwchar.c | 4 ++--
newlib/libc/stdio/remove.c | 2 +-
newlib/libc/stdio/rewind.c | 2 +-
newlib/libc/stdio/siprintf.c | 12 ++++++------
newlib/libc/stdio/siscanf.c | 6 +++---
newlib/libc/stdio/sprintf.c | 12 ++++++------
newlib/libc/stdio/sscanf.c | 6 +++---
newlib/libc/stdio/swprintf.c | 6 +++---
newlib/libc/stdio/swscanf.c | 6 +++---
newlib/libc/stdio/tmpfile.c | 2 +-
newlib/libc/stdio/tmpnam.c | 4 ++--
newlib/libc/stdio/ungetc.c | 2 +-
newlib/libc/stdio/ungetwc.c | 2 +-
newlib/libc/stdio/vfprintf.c | 12 ++++++------
newlib/libc/stdio/vfscanf.c | 6 +++---
newlib/libc/stdio/vfwprintf.c | 6 +++---
newlib/libc/stdio/vfwscanf.c | 6 +++---
newlib/libc/stdio/viprintf.c | 12 ++++++------
newlib/libc/stdio/viscanf.c | 6 +++---
newlib/libc/stdio64/fgetpos64.c | 2 +-
newlib/libc/stdio64/freopen64.c | 2 +-
newlib/libc/stdio64/fseeko64.c | 2 +-
newlib/libc/stdio64/fsetpos64.c | 2 +-
newlib/libc/stdio64/ftello64.c | 2 +-
newlib/libc/stdlib/atoi.c | 4 ++--
newlib/libc/stdlib/atoll.c | 2 +-
newlib/libc/stdlib/envlock.c | 4 ++--
newlib/libc/stdlib/getenv_r.c | 2 +-
newlib/libc/stdlib/mblen_r.c | 2 +-
newlib/libc/stdlib/mbsnrtowcs.c | 4 ++--
newlib/libc/stdlib/mlock.c | 4 ++--
newlib/libc/stdlib/wcsnrtombs.c | 4 ++--
newlib/libc/string/wcsdup.c | 2 +-
newlib/libc/time/tzset.c | 2 +-
newlib/libc/unix/pread.c | 2 +-
newlib/libc/unix/pwrite.c | 2 +-
107 files changed, 213 insertions(+), 195 deletions(-)
diff --git a/libgloss/epiphany/sbrk.c b/libgloss/epiphany/sbrk.c
index 4880c0f8cccb..e07459094fd3 100644
--- a/libgloss/epiphany/sbrk.c
+++ b/libgloss/epiphany/sbrk.c
@@ -97,7 +97,7 @@ _sbrk (int incr)
//caddr_t sbrk_loc asm ("sbrk_loc");
//extern char end; /* Defined by linker. */
//
-///*caddr_t _sbrk_r (struct _reent *, size_t) asm ("__sbrk_r");*/
+///*caddr_t _sbrk_r (__reent_ptr_t, size_t) asm ("__sbrk_r");*/
//
//
///* This symbol can be defined with the --defsym linker option. */
@@ -107,7 +107,7 @@ _sbrk (int incr)
///* FIXME: We need a semaphore here. */
//
//caddr_t
-//_sbrk_r (struct _reent *r, size_t nbytes)
+//_sbrk_r (__reent_ptr_t r, size_t nbytes)
//{
// extern char end; /* Defined by linker. */
// static char *heap_end; /* Previous end of heap or 0 if none */
@@ -138,7 +138,7 @@ _sbrk (int incr)
//caddr_t
-//_sbrk_r (struct _reent *r, size_t nbytes)
+//_sbrk_r (__reent_ptr_t r, size_t nbytes)
//{
// caddr_t result;
//
diff --git a/newlib/README b/newlib/README
index 2f9ab13d1048..8872236503d9 100644
--- a/newlib/README
+++ b/newlib/README
@@ -310,6 +310,12 @@ One feature can be enabled by specifying `--enable-FEATURE=yes' or
thread-local storage objects are provided for each member of the default
struct _reent. For statically linked executables only the objects
required by the application are linked in.
+ Reentrant function arguments use __reent_ptr_t. If the C compiler
+ supports zero-sized empty structures, this type is an empty structure
+ and no reentrancy pointer needs to be passed. Otherwise it remains
+ struct _reent * and the thread-local argument is NULL. Use _REENT
+ rather than a literal NULL when calling reentrant functions in this
+ configuration. Libraries and callers must agree on this argument ABI.
Disabled by default.
`--disable-newlib-fvwrite-in-streamio'
diff --git a/newlib/libc/iconv/ces/table.c b/newlib/libc/iconv/ces/table.c
index bf7bc6887811..64ee04b3e26d 100644
--- a/newlib/libc/iconv/ces/table.c
+++ b/newlib/libc/iconv/ces/table.c
@@ -437,7 +437,7 @@ find_code_size (ucs2_t code,
* iconv_ccs_desc_t object.
*
* PARAMETERS:
- * struct _reent *rptr - reent structure of current thread/process.
+ * __reent_ptr_t rptr - reent structure of current thread/process.
* const char *name - encoding name.
* int direction - conversion direction.
*
diff --git a/newlib/libc/iconv/lib/aliasesi.c b/newlib/libc/iconv/lib/aliasesi.c
index f83946c2c849..7576fef7afda 100644
--- a/newlib/libc/iconv/lib/aliasesi.c
+++ b/newlib/libc/iconv/lib/aliasesi.c
@@ -37,7 +37,7 @@
* canonical_form - canonize 'str'.
*
* PARAMETERS:
- * struct _reent *rptr - reent structure of current thread/process.
+ * __reent_ptr_t rptr - reent structure of current thread/process.
* const char *str - string to canonize.
*
* DESCRIPTION:
@@ -71,7 +71,7 @@ canonical_form (__reent_ptr_t rptr,
* find_alias - find encoding name name by it's alias.
*
* PARAMETERS:
- * struct _reent *rptr - reent structure of current thread/process.
+ * __reent_ptr_t rptr - reent structure of current thread/process.
* const char *alias - alias by which "official" name should be found.
* const char *table - aliases table.
* int len - aliases table length.
@@ -133,7 +133,7 @@ search_again:
* _iconv_resolve_encoding_name - resolves encoding's name by given alias.
*
* PARAMETERS:
- * struct _reent *rptr - reent structure of current thread/process.
+ * __reent_ptr_t rptr - reent structure of current thread/process.
* const char *ca - encoding alias to resolve.
*
* DESCRIPTION:
diff --git a/newlib/libc/iconv/lib/conv.h b/newlib/libc/iconv/lib/conv.h
index 8eb506390f3a..d7d7a979570d 100644
--- a/newlib/libc/iconv/lib/conv.h
+++ b/newlib/libc/iconv/lib/conv.h
@@ -51,7 +51,7 @@ typedef struct
* open - open and initialize conversion.
*
* PARAMETERS:
- * struct _reent *rptr - reent structure of current thread/process;
+ * __reent_ptr_t rptr - reent structure of current thread/process;
* const char *to - output encoding's normalized name;
* const char *from - input encoding's normalized name.
*
@@ -71,7 +71,7 @@ typedef struct
* close - close conversion.
*
* PARAMETRS:
- * struct _reent *rptr - reent structure of current thread/process;
+ * __reent_ptr_t rptr - reent structure of current thread/process;
* void *data - conversion-specific data.
*
* DESCRIPTION:
@@ -87,7 +87,7 @@ typedef struct
/* convert - perform encoding conversion.
*
* PARAMETERS:
- * struct _reent *rptr - reent structure of current thread/process.
+ * __reent_ptr_t rptr - reent structure of current thread/process.
* void *data - conversion-specific data;
* const unsigned char **inbuf - input data buffer;
* size_t *inbytesleft - input buffer's length;
diff --git a/newlib/libc/iconv/lib/iconv.c b/newlib/libc/iconv/lib/iconv.c
index aed584b88388..dd5c708414fb 100644
--- a/newlib/libc/iconv/lib/iconv.c
+++ b/newlib/libc/iconv/lib/iconv.c
@@ -50,10 +50,10 @@ SYNOPSIS
char **restrict <[outbuf]>,
size_t *restrict <[outbytesleft]>);
- iconv_t _iconv_open_r (struct _reent *<[rptr]>,
+ iconv_t _iconv_open_r (__reent_ptr_t <[rptr]>,
const char *<[to]>, const char *<[from]>);
- int _iconv_close_r (struct _reent *<[rptr]>, iconv_t <[cd]>);
- size_t _iconv_r (struct _reent *<[rptr]>,
+ int _iconv_close_r (__reent_ptr_t <[rptr]>, iconv_t <[cd]>);
+ size_t _iconv_r (__reent_ptr_t <[rptr]>,
iconv_t <[cd]>, const char **<[inbuf]>,
size_t *<[inbytesleft]>,
char **<[outbuf]>, size_t *<[outbytesleft]>);
diff --git a/newlib/libc/iconv/lib/iconvnls.c b/newlib/libc/iconv/lib/iconvnls.c
index f2d4ce1f370c..22d2a0d289ea 100644
--- a/newlib/libc/iconv/lib/iconvnls.c
+++ b/newlib/libc/iconv/lib/iconvnls.c
@@ -45,7 +45,7 @@
* _iconv_nls_construct_filename -- constructs full file name.
*
* PARAMETERS:
- * struct _reent *rptr - reent structure of current thread/process.
+ * __reent_ptr_t rptr - reent structure of current thread/process.
* const char *file - the name of file.
* const char *dir - the name of subdirectory;
* const char *ext - file extension.
@@ -293,7 +293,7 @@ iconv_open1 (__reent_ptr_t rptr,
* _iconv_nls_open - open iconv descriptors for NLS.
*
* PARAMETERS:
- * struct _reent *rptr - process's reent structure;
+ * __reent_ptr_t rptr - process's reent structure;
* const char *encoding - encoding name;
* iconv_t *tomb - wchar -> encoding iconv descriptor pointer;
* iconv_t *towc - encoding -> wchar iconv descriptor pointer;
diff --git a/newlib/libc/iconv/lib/ucsconv.h b/newlib/libc/iconv/lib/ucsconv.h
index d0143d416b56..3dfd5e046fdf 100644
--- a/newlib/libc/iconv/lib/ucsconv.h
+++ b/newlib/libc/iconv/lib/ucsconv.h
@@ -56,7 +56,7 @@ typedef struct
* init - initialize CES converter.
*
* PARAMETERS:
- * struct _reent *rptr - reent structure of current thread/process;
+ * __reent_ptr_t rptr - reent structure of current thread/process;
* const char *encoding - encoding name.
*
* DESCRIPTION:
@@ -75,7 +75,7 @@ typedef struct
* close - close CES converter.
*
* PARAMETERS:
- * struct _reent *rptr - reent structure of current thread/process;
+ * __reent_ptr_t rptr - reent structure of current thread/process;
* void *data - CES converter-specific data.
*
* DESCRIPTION:
diff --git a/newlib/libc/reent/closer.c b/newlib/libc/reent/closer.c
index cfb25d6b2f52..426170aeab26 100644
--- a/newlib/libc/reent/closer.c
+++ b/newlib/libc/reent/closer.c
@@ -28,7 +28,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _close_r(struct _reent *<[ptr]>, int <[fd]>);
+ int _close_r(__reent_ptr_t <[ptr]>, int <[fd]>);
DESCRIPTION
This is a reentrant version of <<close>>. It
diff --git a/newlib/libc/reent/execr.c b/newlib/libc/reent/execr.c
index 3af88235375e..a1b59638f9cc 100644
--- a/newlib/libc/reent/execr.c
+++ b/newlib/libc/reent/execr.c
@@ -35,7 +35,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _execve_r(struct _reent *<[ptr]>, const char *<[name]>,
+ int _execve_r(__reent_ptr_t <[ptr]>, const char *<[name]>,
char *const <[argv]>[], char *const <[env]>[]);
DESCRIPTION
@@ -69,7 +69,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _fork_r(struct _reent *<[ptr]>);
+ int _fork_r(__reent_ptr_t <[ptr]>);
DESCRIPTION
This is a reentrant version of <<fork>>. It
@@ -102,7 +102,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _wait_r(struct _reent *<[ptr]>, int *<[status]>);
+ int _wait_r(__reent_ptr_t <[ptr]>, int *<[status]>);
DESCRIPTION
This is a reentrant version of <<wait>>. It
diff --git a/newlib/libc/reent/fcntlr.c b/newlib/libc/reent/fcntlr.c
index 0fbdc02489af..2d4856ef4f4b 100644
--- a/newlib/libc/reent/fcntlr.c
+++ b/newlib/libc/reent/fcntlr.c
@@ -30,7 +30,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _fcntl_r(struct _reent *<[ptr]>,
+ int _fcntl_r(__reent_ptr_t <[ptr]>,
int <[fd]>, int <[cmd]>, <[arg]>);
DESCRIPTION
diff --git a/newlib/libc/reent/fstat64r.c b/newlib/libc/reent/fstat64r.c
index 56867eba7943..64a9db6517d2 100644
--- a/newlib/libc/reent/fstat64r.c
+++ b/newlib/libc/reent/fstat64r.c
@@ -36,7 +36,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _fstat64_r(struct _reent *<[ptr]>,
+ int _fstat64_r(__reent_ptr_t <[ptr]>,
int <[fd]>, struct stat64 *<[pstat]>);
DESCRIPTION
diff --git a/newlib/libc/reent/fstatr.c b/newlib/libc/reent/fstatr.c
index ad5dc4745b01..578f1a4ddc40 100644
--- a/newlib/libc/reent/fstatr.c
+++ b/newlib/libc/reent/fstatr.c
@@ -34,7 +34,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _fstat_r(struct _reent *<[ptr]>,
+ int _fstat_r(__reent_ptr_t <[ptr]>,
int <[fd]>, struct stat *<[pstat]>);
DESCRIPTION
diff --git a/newlib/libc/reent/getentropyr.c b/newlib/libc/reent/getentropyr.c
index ba3bfd84d77d..71b56f996c99 100644
--- a/newlib/libc/reent/getentropyr.c
+++ b/newlib/libc/reent/getentropyr.c
@@ -28,7 +28,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _getentropy_r(struct _reent *<[ptr]>,
+ int _getentropy_r(__reent_ptr_t <[ptr]>,
void *<[buf]>, size_t <[buflen]>);
DESCRIPTION
diff --git a/newlib/libc/reent/gettimeofdayr.c b/newlib/libc/reent/gettimeofdayr.c
index ebba04b7bef4..17d5ec17ecc9 100644
--- a/newlib/libc/reent/gettimeofdayr.c
+++ b/newlib/libc/reent/gettimeofdayr.c
@@ -38,7 +38,7 @@ INDEX
SYNOPSIS
#include <reent.h>
#include <time.h>
- int _gettimeofday_r(struct _reent *<[ptr]>,
+ int _gettimeofday_r(__reent_ptr_t <[ptr]>,
struct timeval *<[ptimeval]>,
void *<[ptimezone]>);
diff --git a/newlib/libc/reent/isattyr.c b/newlib/libc/reent/isattyr.c
index c7a5a5539c7d..9165318bf569 100644
--- a/newlib/libc/reent/isattyr.c
+++ b/newlib/libc/reent/isattyr.c
@@ -32,7 +32,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _isatty_r(struct _reent *<[ptr]>,
+ int _isatty_r(__reent_ptr_t <[ptr]>,
int <[fd]>);
DESCRIPTION
diff --git a/newlib/libc/reent/linkr.c b/newlib/libc/reent/linkr.c
index 07ed18b0044e..c78c87614c0b 100644
--- a/newlib/libc/reent/linkr.c
+++ b/newlib/libc/reent/linkr.c
@@ -33,7 +33,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _link_r(struct _reent *<[ptr]>,
+ int _link_r(__reent_ptr_t <[ptr]>,
const char *<[old]>, const char *<[new]>);
DESCRIPTION
diff --git a/newlib/libc/reent/lseek64r.c b/newlib/libc/reent/lseek64r.c
index 4ab2e6882eff..0cfc587d29fb 100644
--- a/newlib/libc/reent/lseek64r.c
+++ b/newlib/libc/reent/lseek64r.c
@@ -30,7 +30,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- off64_t _lseek64_r(struct _reent *<[ptr]>,
+ off64_t _lseek64_r(__reent_ptr_t <[ptr]>,
int <[fd]>, off64_t <[pos]>, int <[whence]>);
DESCRIPTION
diff --git a/newlib/libc/reent/lseekr.c b/newlib/libc/reent/lseekr.c
index e0a7f328f1b0..c913801b4e7b 100644
--- a/newlib/libc/reent/lseekr.c
+++ b/newlib/libc/reent/lseekr.c
@@ -28,7 +28,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- off_t _lseek_r(struct _reent *<[ptr]>,
+ off_t _lseek_r(__reent_ptr_t <[ptr]>,
int <[fd]>, off_t <[pos]>, int <[whence]>);
DESCRIPTION
diff --git a/newlib/libc/reent/mkdirr.c b/newlib/libc/reent/mkdirr.c
index 313648811a4c..6aa6bffa1eb4 100644
--- a/newlib/libc/reent/mkdirr.c
+++ b/newlib/libc/reent/mkdirr.c
@@ -28,7 +28,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _mkdir_r(struct _reent *<[ptr]>,
+ int _mkdir_r(__reent_ptr_t <[ptr]>,
const char *<[path]>, int <[mode]>);
DESCRIPTION
diff --git a/newlib/libc/reent/open64r.c b/newlib/libc/reent/open64r.c
index 8f46e313d35d..9752c59fefa7 100644
--- a/newlib/libc/reent/open64r.c
+++ b/newlib/libc/reent/open64r.c
@@ -31,7 +31,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _open64_r(struct _reent *<[ptr]>,
+ int _open64_r(__reent_ptr_t <[ptr]>,
const char *<[file]>, int <[flags]>, int <[mode]>);
DESCRIPTION
diff --git a/newlib/libc/reent/openr.c b/newlib/libc/reent/openr.c
index 09cc4501aaf6..35f2ca2fe599 100644
--- a/newlib/libc/reent/openr.c
+++ b/newlib/libc/reent/openr.c
@@ -29,7 +29,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _open_r(struct _reent *<[ptr]>,
+ int _open_r(__reent_ptr_t <[ptr]>,
const char *<[file]>, int <[flags]>, int <[mode]>);
DESCRIPTION
diff --git a/newlib/libc/reent/readr.c b/newlib/libc/reent/readr.c
index 385d2254d8d2..e64dcc036136 100644
--- a/newlib/libc/reent/readr.c
+++ b/newlib/libc/reent/readr.c
@@ -28,7 +28,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- _ssize_t _read_r(struct _reent *<[ptr]>,
+ _ssize_t _read_r(__reent_ptr_t <[ptr]>,
int <[fd]>, void *<[buf]>, size_t <[cnt]>);
DESCRIPTION
diff --git a/newlib/libc/reent/reent.tex b/newlib/libc/reent/reent.tex
index 881c572c61a0..f5de9b2e885e 100644
--- a/newlib/libc/reent/reent.tex
+++ b/newlib/libc/reent/reent.tex
@@ -23,6 +23,16 @@ has a different name, normally formed by prepending @samp{_} and
appending @samp{_r}, and takes a pointer to the particular reentrancy
structure to use.
+The argument type is @code{__reent_ptr_t}, normally a typedef for
+@code{struct _reent *}. With @code{_REENT_THREAD_LOCAL}, state is instead
+stored in dedicated thread-local objects. If the configured C compiler
+supports zero-sized empty structures, @code{__reent_ptr_t} is such a
+structure, allowing the unused argument to be omitted by the calling
+convention. Otherwise the type remains a pointer. Use @code{_REENT} for
+the current context in either configuration, rather than passing a literal
+@code{NULL}. All callers and platform implementations of reentrant
+functions must use the same configured argument type.
+
For example, the function @code{fopen} takes two arguments, @var{file}
and @var{mode}, and uses the global reentrancy structure. The function
@code{_fopen_r} takes the arguments, @var{struct_reent}, which is a
diff --git a/newlib/libc/reent/renamer.c b/newlib/libc/reent/renamer.c
index e3b3119174d2..a34709f888f8 100644
--- a/newlib/libc/reent/renamer.c
+++ b/newlib/libc/reent/renamer.c
@@ -30,7 +30,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _rename_r(struct _reent *<[ptr]>,
+ int _rename_r(__reent_ptr_t <[ptr]>,
const char *<[old]>, const char *<[new]>);
DESCRIPTION
diff --git a/newlib/libc/reent/sbrkr.c b/newlib/libc/reent/sbrkr.c
index 5a38e9b1eda6..faa7a2aeca4b 100644
--- a/newlib/libc/reent/sbrkr.c
+++ b/newlib/libc/reent/sbrkr.c
@@ -32,7 +32,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- void *_sbrk_r(struct _reent *<[ptr]>, ptrdiff_t <[incr]>);
+ void *_sbrk_r(__reent_ptr_t <[ptr]>, ptrdiff_t <[incr]>);
DESCRIPTION
This is a reentrant version of <<sbrk>>. It
diff --git a/newlib/libc/reent/signalr.c b/newlib/libc/reent/signalr.c
index 7834413eff17..b15800584850 100644
--- a/newlib/libc/reent/signalr.c
+++ b/newlib/libc/reent/signalr.c
@@ -34,7 +34,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _kill_r(struct _reent *<[ptr]>, int <[pid]>, int <[sig]>);
+ int _kill_r(__reent_ptr_t <[ptr]>, int <[pid]>, int <[sig]>);
DESCRIPTION
This is a reentrant version of <<kill>>. It
@@ -65,7 +65,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _getpid_r(struct _reent *<[ptr]>);
+ int _getpid_r(__reent_ptr_t <[ptr]>);
DESCRIPTION
This is a reentrant version of <<getpid>>. It
diff --git a/newlib/libc/reent/stat64r.c b/newlib/libc/reent/stat64r.c
index fc56421fcbc4..7ec3ecc30806 100644
--- a/newlib/libc/reent/stat64r.c
+++ b/newlib/libc/reent/stat64r.c
@@ -35,7 +35,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _stat64_r(struct _reent *<[ptr]>,
+ int _stat64_r(__reent_ptr_t <[ptr]>,
const char *<[file]>, struct stat64 *<[pstat]>);
DESCRIPTION
diff --git a/newlib/libc/reent/statr.c b/newlib/libc/reent/statr.c
index bbcaf83f51f9..02298f22fbb4 100644
--- a/newlib/libc/reent/statr.c
+++ b/newlib/libc/reent/statr.c
@@ -35,7 +35,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _stat_r(struct _reent *<[ptr]>,
+ int _stat_r(__reent_ptr_t <[ptr]>,
const char *<[file]>, struct stat *<[pstat]>);
DESCRIPTION
diff --git a/newlib/libc/reent/timesr.c b/newlib/libc/reent/timesr.c
index 1f076486f8ad..99d8c1901293 100644
--- a/newlib/libc/reent/timesr.c
+++ b/newlib/libc/reent/timesr.c
@@ -35,7 +35,7 @@ INDEX
SYNOPSIS
#include <reent.h>
#include <sys/times.h>
- clock_t _times_r(struct _reent *<[ptr]>, struct tms *<[ptms]>);
+ clock_t _times_r(__reent_ptr_t <[ptr]>, struct tms *<[ptms]>);
DESCRIPTION
This is a reentrant version of <<times>>. It
diff --git a/newlib/libc/reent/unlinkr.c b/newlib/libc/reent/unlinkr.c
index 5e13a0740452..476af24685a7 100644
--- a/newlib/libc/reent/unlinkr.c
+++ b/newlib/libc/reent/unlinkr.c
@@ -29,7 +29,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- int _unlink_r(struct _reent *<[ptr]>, const char *<[file]>);
+ int _unlink_r(__reent_ptr_t <[ptr]>, const char *<[file]>);
DESCRIPTION
This is a reentrant version of <<unlink>>. It
diff --git a/newlib/libc/reent/writer.c b/newlib/libc/reent/writer.c
index 3393274c6ada..77028a5a8811 100644
--- a/newlib/libc/reent/writer.c
+++ b/newlib/libc/reent/writer.c
@@ -28,7 +28,7 @@ INDEX
SYNOPSIS
#include <reent.h>
- _ssize_t _write_r(struct _reent *<[ptr]>,
+ _ssize_t _write_r(__reent_ptr_t <[ptr]>,
int <[fd]>, const void *<[buf]>, size_t <[cnt]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/diprintf.c b/newlib/libc/stdio/diprintf.c
index 9e294ad49494..ff006b1194ea 100644
--- a/newlib/libc/stdio/diprintf.c
+++ b/newlib/libc/stdio/diprintf.c
@@ -21,9 +21,9 @@ SYNOPSIS
#include <stdarg.h>
int diprintf(int <[fd]>, const char *<[format]>, ...);
int vdiprintf(int <[fd]>, const char *<[format]>, va_list <[ap]>);
- int _diprintf_r(struct _reent *<[ptr]>, int <[fd]>,
+ int _diprintf_r(__reent_ptr_t <[ptr]>, int <[fd]>,
const char *<[format]>, ...);
- int _vdiprintf_r(struct _reent *<[ptr]>, int <[fd]>,
+ int _vdiprintf_r(__reent_ptr_t <[ptr]>, int <[fd]>,
const char *<[format]>, va_list <[ap]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/dprintf.c b/newlib/libc/stdio/dprintf.c
index dc1eb4a5d009..7b46c84c61d5 100644
--- a/newlib/libc/stdio/dprintf.c
+++ b/newlib/libc/stdio/dprintf.c
@@ -22,9 +22,9 @@ SYNOPSIS
int dprintf(int <[fd]>, const char *restrict <[format]>, ...);
int vdprintf(int <[fd]>, const char *restrict <[format]>,
va_list <[ap]>);
- int _dprintf_r(struct _reent *<[ptr]>, int <[fd]>,
+ int _dprintf_r(__reent_ptr_t <[ptr]>, int <[fd]>,
const char *restrict <[format]>, ...);
- int _vdprintf_r(struct _reent *<[ptr]>, int <[fd]>,
+ int _vdprintf_r(__reent_ptr_t <[ptr]>, int <[fd]>,
const char *restrict <[format]>, va_list <[ap]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/fclose.c b/newlib/libc/stdio/fclose.c
index 23ed406a5954..29eb015f8323 100644
--- a/newlib/libc/stdio/fclose.c
+++ b/newlib/libc/stdio/fclose.c
@@ -27,7 +27,7 @@ INDEX
SYNOPSIS
#include <stdio.h>
int fclose(FILE *<[fp]>);
- int _fclose_r(struct _reent *<[reent]>, FILE *<[fp]>);
+ int _fclose_r(__reent_ptr_t <[reent]>, FILE *<[fp]>);
DESCRIPTION
If the file or stream identified by <[fp]> is open, <<fclose>> closes
diff --git a/newlib/libc/stdio/fcloseall.c b/newlib/libc/stdio/fcloseall.c
index 777e13fceaba..85524a5fba18 100644
--- a/newlib/libc/stdio/fcloseall.c
+++ b/newlib/libc/stdio/fcloseall.c
@@ -27,7 +27,7 @@ INDEX
SYNOPSIS
#include <stdio.h>
int fcloseall(void);
- int _fcloseall_r (struct _reent *<[ptr]>);
+ int _fcloseall_r (__reent_ptr_t <[ptr]>);
DESCRIPTION
<<fcloseall>> closes all files in the current reentrancy struct's domain.
diff --git a/newlib/libc/stdio/fdopen.c b/newlib/libc/stdio/fdopen.c
index d14b22e935fc..f45a8883bd2a 100644
--- a/newlib/libc/stdio/fdopen.c
+++ b/newlib/libc/stdio/fdopen.c
@@ -27,7 +27,7 @@ INDEX
SYNOPSIS
#include <stdio.h>
FILE *fdopen(int <[fd]>, const char *<[mode]>);
- FILE *_fdopen_r(struct _reent *<[reent]>,
+ FILE *_fdopen_r(__reent_ptr_t <[reent]>,
int <[fd]>, const char *<[mode]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/fflush.c b/newlib/libc/stdio/fflush.c
index 5accc93d5b3b..b7e85526be7f 100644
--- a/newlib/libc/stdio/fflush.c
+++ b/newlib/libc/stdio/fflush.c
@@ -37,11 +37,11 @@ SYNOPSIS
int fflush_unlocked(FILE *<[fp]>);
#include <stdio.h>
- int _fflush_r(struct _reent *<[reent]>, FILE *<[fp]>);
+ int _fflush_r(__reent_ptr_t <[reent]>, FILE *<[fp]>);
#define _BSD_SOURCE
#include <stdio.h>
- int _fflush_unlocked_r(struct _reent *<[reent]>, FILE *<[fp]>);
+ int _fflush_unlocked_r(__reent_ptr_t <[reent]>, FILE *<[fp]>);
DESCRIPTION
The <<stdio>> output functions can buffer output before delivering it
diff --git a/newlib/libc/stdio/fgetc.c b/newlib/libc/stdio/fgetc.c
index 54ae655b3fc0..13ba9b9cd4da 100644
--- a/newlib/libc/stdio/fgetc.c
+++ b/newlib/libc/stdio/fgetc.c
@@ -37,11 +37,11 @@ SYNOPSIS
int fgetc_unlocked(FILE *<[fp]>);
#include <stdio.h>
- int _fgetc_r(struct _reent *<[ptr]>, FILE *<[fp]>);
+ int _fgetc_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
#define _BSD_SOURCE
#include <stdio.h>
- int _fgetc_unlocked_r(struct _reent *<[ptr]>, FILE *<[fp]>);
+ int _fgetc_unlocked_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
DESCRIPTION
Use <<fgetc>> to get the next single character from the file or stream
diff --git a/newlib/libc/stdio/fgetpos.c b/newlib/libc/stdio/fgetpos.c
index f58cc2c1ad54..ad24fc5ba4bd 100644
--- a/newlib/libc/stdio/fgetpos.c
+++ b/newlib/libc/stdio/fgetpos.c
@@ -27,7 +27,7 @@ INDEX
SYNOPSIS
#include <stdio.h>
int fgetpos(FILE *restrict <[fp]>, fpos_t *restrict <[pos]>);
- int _fgetpos_r(struct _reent *<[ptr]>, FILE *restrict <[fp]>, fpos_t *restrict <[pos]>);
+ int _fgetpos_r(__reent_ptr_t <[ptr]>, FILE *restrict <[fp]>, fpos_t *restrict <[pos]>);
DESCRIPTION
Objects of type <<FILE>> can have a ``position'' that records how much
diff --git a/newlib/libc/stdio/fgets.c b/newlib/libc/stdio/fgets.c
index d86e6b6a3649..0adf4e78b1cf 100644
--- a/newlib/libc/stdio/fgets.c
+++ b/newlib/libc/stdio/fgets.c
@@ -37,10 +37,10 @@ SYNOPSIS
char *fgets_unlocked(char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>);
#include <stdio.h>
- char *_fgets_r(struct _reent *<[ptr]>, char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>);
+ char *_fgets_r(__reent_ptr_t <[ptr]>, char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>);
#include <stdio.h>
- char *_fgets_unlocked_r(struct _reent *<[ptr]>, char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>);
+ char *_fgets_unlocked_r(__reent_ptr_t <[ptr]>, char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>);
DESCRIPTION
Reads at most <[n-1]> characters from <[fp]> until a newline
diff --git a/newlib/libc/stdio/fgetwc.c b/newlib/libc/stdio/fgetwc.c
index 38e7b1fd9277..d223e802a786 100644
--- a/newlib/libc/stdio/fgetwc.c
+++ b/newlib/libc/stdio/fgetwc.c
@@ -57,11 +57,11 @@ SYNOPSIS
#include <stdio.h>
#include <wchar.h>
- wint_t _fgetwc_r(struct _reent *<[ptr]>, FILE *<[fp]>);
+ wint_t _fgetwc_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
#include <stdio.h>
#include <wchar.h>
- wint_t _fgetwc_unlocked_r(struct _reent *<[ptr]>, FILE *<[fp]>);
+ wint_t _fgetwc_unlocked_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
#include <stdio.h>
#include <wchar.h>
@@ -74,11 +74,11 @@ SYNOPSIS
#include <stdio.h>
#include <wchar.h>
- wint_t _getwc_r(struct _reent *<[ptr]>, FILE *<[fp]>);
+ wint_t _getwc_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
#include <stdio.h>
#include <wchar.h>
- wint_t _getwc_unlocked_r(struct _reent *<[ptr]>, FILE *<[fp]>);
+ wint_t _getwc_unlocked_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
DESCRIPTION
Use <<fgetwc>> to get the next wide character from the file or stream
diff --git a/newlib/libc/stdio/fgetws.c b/newlib/libc/stdio/fgetws.c
index ded524cf4c52..342c7c7aa727 100644
--- a/newlib/libc/stdio/fgetws.c
+++ b/newlib/libc/stdio/fgetws.c
@@ -48,11 +48,11 @@ SYNOPSIS
FILE *__restrict <[fp]>);
#include <wchar.h>
- wchar_t *_fgetws_r(struct _reent *<[ptr]>, wchar_t *<[ws]>,
+ wchar_t *_fgetws_r(__reent_ptr_t <[ptr]>, wchar_t *<[ws]>,
int <[n]>, FILE *<[fp]>);
#include <wchar.h>
- wchar_t *_fgetws_unlocked_r(struct _reent *<[ptr]>, wchar_t *<[ws]>,
+ wchar_t *_fgetws_unlocked_r(__reent_ptr_t <[ptr]>, wchar_t *<[ws]>,
int <[n]>, FILE *<[fp]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/fopen.c b/newlib/libc/stdio/fopen.c
index ee6d0c5439a0..c023c62d87c9 100644
--- a/newlib/libc/stdio/fopen.c
+++ b/newlib/libc/stdio/fopen.c
@@ -28,7 +28,7 @@ SYNOPSIS
#include <stdio.h>
FILE *fopen(const char *<[file]>, const char *<[mode]>);
- FILE *_fopen_r(struct _reent *<[reent]>,
+ FILE *_fopen_r(__reent_ptr_t <[reent]>,
const char *<[file]>, const char *<[mode]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/fpurge.c b/newlib/libc/stdio/fpurge.c
index 00ec194bb2de..27bafd4df1b7 100644
--- a/newlib/libc/stdio/fpurge.c
+++ b/newlib/libc/stdio/fpurge.c
@@ -18,7 +18,7 @@ SYNOPSIS
#include <stdio.h>
int fpurge(FILE *<[fp]>);
- int _fpurge_r(struct _reent *<[reent]>, FILE *<[fp]>);
+ int _fpurge_r(__reent_ptr_t <[reent]>, FILE *<[fp]>);
#include <stdio.h>
#include <stdio_ext.h>
diff --git a/newlib/libc/stdio/fputs.c b/newlib/libc/stdio/fputs.c
index 11b36c327add..2f5d39526484 100644
--- a/newlib/libc/stdio/fputs.c
+++ b/newlib/libc/stdio/fputs.c
@@ -37,10 +37,10 @@ SYNOPSIS
int fputs_unlocked(const char *restrict <[s]>, FILE *restrict <[fp]>);
#include <stdio.h>
- int _fputs_r(struct _reent *<[ptr]>, const char *restrict <[s]>, FILE *restrict <[fp]>);
+ int _fputs_r(__reent_ptr_t <[ptr]>, const char *restrict <[s]>, FILE *restrict <[fp]>);
#include <stdio.h>
- int _fputs_unlocked_r(struct _reent *<[ptr]>, const char *restrict <[s]>, FILE *restrict <[fp]>);
+ int _fputs_unlocked_r(__reent_ptr_t <[ptr]>, const char *restrict <[s]>, FILE *restrict <[fp]>);
DESCRIPTION
<<fputs>> writes the string at <[s]> (but without the trailing null)
diff --git a/newlib/libc/stdio/fputwc.c b/newlib/libc/stdio/fputwc.c
index 05395810aa06..542c72c0c96f 100644
--- a/newlib/libc/stdio/fputwc.c
+++ b/newlib/libc/stdio/fputwc.c
@@ -57,11 +57,11 @@ SYNOPSIS
#include <stdio.h>
#include <wchar.h>
- wint_t _fputwc_r(struct _reent *<[ptr]>, wchar_t <[wc]>, FILE *<[fp]>);
+ wint_t _fputwc_r(__reent_ptr_t <[ptr]>, wchar_t <[wc]>, FILE *<[fp]>);
#include <stdio.h>
#include <wchar.h>
- wint_t _fputwc_unlocked_r(struct _reent *<[ptr]>, wchar_t <[wc]>, FILE *<[fp]>);
+ wint_t _fputwc_unlocked_r(__reent_ptr_t <[ptr]>, wchar_t <[wc]>, FILE *<[fp]>);
#include <stdio.h>
#include <wchar.h>
@@ -74,11 +74,11 @@ SYNOPSIS
#include <stdio.h>
#include <wchar.h>
- wint_t _putwc_r(struct _reent *<[ptr]>, wchar_t <[wc]>, FILE *<[fp]>);
+ wint_t _putwc_r(__reent_ptr_t <[ptr]>, wchar_t <[wc]>, FILE *<[fp]>);
#include <stdio.h>
#include <wchar.h>
- wint_t _putwc_unlocked_r(struct _reent *<[ptr]>, wchar_t <[wc]>, FILE *<[fp]>);
+ wint_t _putwc_unlocked_r(__reent_ptr_t <[ptr]>, wchar_t <[wc]>, FILE *<[fp]>);
DESCRIPTION
<<fputwc>> writes the wide character argument <[wc]> to the file or
diff --git a/newlib/libc/stdio/fputws.c b/newlib/libc/stdio/fputws.c
index 76127478a6af..af13006733a5 100644
--- a/newlib/libc/stdio/fputws.c
+++ b/newlib/libc/stdio/fputws.c
@@ -46,11 +46,11 @@ SYNOPSIS
int fputws_unlocked(const wchar_t *__restrict <[ws]>, FILE *__restrict <[fp]>);
#include <wchar.h>
- int _fputws_r(struct _reent *<[ptr]>, const wchar_t *<[ws]>,
+ int _fputws_r(__reent_ptr_t <[ptr]>, const wchar_t *<[ws]>,
FILE *<[fp]>);
#include <wchar.h>
- int _fputws_unlocked_r(struct _reent *<[ptr]>, const wchar_t *<[ws]>,
+ int _fputws_unlocked_r(__reent_ptr_t <[ptr]>, const wchar_t *<[ws]>,
FILE *<[fp]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/fread.c b/newlib/libc/stdio/fread.c
index 161a0ae434c0..ca294074da06 100644
--- a/newlib/libc/stdio/fread.c
+++ b/newlib/libc/stdio/fread.c
@@ -39,11 +39,11 @@ SYNOPSIS
FILE *restrict <[fp]>);
#include <stdio.h>
- size_t _fread_r(struct _reent *<[ptr]>, void *restrict <[buf]>,
+ size_t _fread_r(__reent_ptr_t <[ptr]>, void *restrict <[buf]>,
size_t <[size]>, size_t <[count]>, FILE *restrict <[fp]>);
#include <stdio.h>
- size_t _fread_unlocked_r(struct _reent *<[ptr]>, void *restrict <[buf]>,
+ size_t _fread_unlocked_r(__reent_ptr_t <[ptr]>, void *restrict <[buf]>,
size_t <[size]>, size_t <[count]>, FILE *restrict <[fp]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c
index 44350de77442..f1af546bb937 100644
--- a/newlib/libc/stdio/freopen.c
+++ b/newlib/libc/stdio/freopen.c
@@ -28,7 +28,7 @@ SYNOPSIS
#include <stdio.h>
FILE *freopen(const char *restrict <[file]>, const char *restrict <[mode]>,
FILE *restrict <[fp]>);
- FILE *_freopen_r(struct _reent *<[ptr]>, const char *restrict <[file]>,
+ FILE *_freopen_r(__reent_ptr_t <[ptr]>, const char *restrict <[file]>,
const char *restrict <[mode]>, FILE *restrict <[fp]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/fseek.c b/newlib/libc/stdio/fseek.c
index 4d469f8d9c03..dcb4d066b516 100644
--- a/newlib/libc/stdio/fseek.c
+++ b/newlib/libc/stdio/fseek.c
@@ -32,9 +32,9 @@ 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(__reent_ptr_t <[ptr]>, FILE *<[fp]>,
long <[offset]>, int <[whence]>);
- int _fseeko_r(struct _reent *<[ptr]>, FILE *<[fp]>,
+ int _fseeko_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>,
off_t <[offset]>, int <[whence]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/fseeko.c b/newlib/libc/stdio/fseeko.c
index aa0fc27020cd..5c1ed94baa15 100644
--- a/newlib/libc/stdio/fseeko.c
+++ b/newlib/libc/stdio/fseeko.c
@@ -32,9 +32,9 @@ 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(__reent_ptr_t <[ptr]>, FILE *<[fp]>,
long <[offset]>, int <[whence]>)
- int _fseeko_r(struct _reent *<[ptr]>, FILE *<[fp]>,
+ int _fseeko_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>,
off_t <[offset]>, int <[whence]>)
DESCRIPTION
diff --git a/newlib/libc/stdio/fsetpos.c b/newlib/libc/stdio/fsetpos.c
index 1a711819c0d4..a4cb20748fe1 100644
--- a/newlib/libc/stdio/fsetpos.c
+++ b/newlib/libc/stdio/fsetpos.c
@@ -27,7 +27,7 @@ INDEX
SYNOPSIS
#include <stdio.h>
int fsetpos(FILE *<[fp]>, const fpos_t *<[pos]>);
- int _fsetpos_r(struct _reent *<[ptr]>, FILE *<[fp]>,
+ int _fsetpos_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>,
const fpos_t *<[pos]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/ftell.c b/newlib/libc/stdio/ftell.c
index 7fe4a993631d..2630d5d5d758 100644
--- a/newlib/libc/stdio/ftell.c
+++ b/newlib/libc/stdio/ftell.c
@@ -32,8 +32,8 @@ SYNOPSIS
#include <stdio.h>
long ftell(FILE *<[fp]>);
off_t ftello(FILE *<[fp]>);
- long _ftell_r(struct _reent *<[ptr]>, FILE *<[fp]>);
- off_t _ftello_r(struct _reent *<[ptr]>, FILE *<[fp]>);
+ long _ftell_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
+ off_t _ftello_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
DESCRIPTION
Objects of type <<FILE>> can have a ``position'' that records how much
diff --git a/newlib/libc/stdio/ftello.c b/newlib/libc/stdio/ftello.c
index d10b7ce91c59..7bdf6e8a1e03 100644
--- a/newlib/libc/stdio/ftello.c
+++ b/newlib/libc/stdio/ftello.c
@@ -32,8 +32,8 @@ SYNOPSIS
#include <stdio.h>
long ftell(FILE *<[fp]>);
off_t ftello(FILE *<[fp]>);
- long _ftell_r(struct _reent *<[ptr]>, FILE *<[fp]>);
- off_t _ftello_r(struct _reent *<[ptr]>, FILE *<[fp]>);
+ long _ftell_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
+ off_t _ftello_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
DESCRIPTION
Objects of type <<FILE>> can have a ``position'' that records how much
diff --git a/newlib/libc/stdio/fwide.c b/newlib/libc/stdio/fwide.c
index 107bda51e6e5..d16e45a7d60e 100644
--- a/newlib/libc/stdio/fwide.c
+++ b/newlib/libc/stdio/fwide.c
@@ -11,7 +11,7 @@ SYNOPSIS
#include <wchar.h>
int fwide(FILE *<[fp]>, int <[mode]>);
- int _fwide_r(struct _reent *<[ptr]>, FILE *<[fp]>, int <[mode]>);
+ int _fwide_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>, int <[mode]>);
DESCRIPTION
When <[mode]> is zero, the <<fwide>> function determines the current
diff --git a/newlib/libc/stdio/fwrite.c b/newlib/libc/stdio/fwrite.c
index f67c5e4b0faa..17336702c794 100644
--- a/newlib/libc/stdio/fwrite.c
+++ b/newlib/libc/stdio/fwrite.c
@@ -39,11 +39,11 @@ SYNOPSIS
size_t <[count]>, FILE *restrict <[fp]>);
#include <stdio.h>
- size_t _fwrite_r(struct _reent *<[ptr]>, const void *restrict <[buf]>, size_t <[size]>,
+ size_t _fwrite_r(__reent_ptr_t <[ptr]>, const void *restrict <[buf]>, size_t <[size]>,
size_t <[count]>, FILE *restrict <[fp]>);
#include <stdio.h>
- size_t _fwrite_unlocked_r(struct _reent *<[ptr]>, const void *restrict <[buf]>, size_t <[size]>,
+ size_t _fwrite_unlocked_r(__reent_ptr_t <[ptr]>, const void *restrict <[buf]>, size_t <[size]>,
size_t <[count]>, FILE *restrict <[fp]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/getc.c b/newlib/libc/stdio/getc.c
index 14427a63584e..be94b3b5ad1f 100644
--- a/newlib/libc/stdio/getc.c
+++ b/newlib/libc/stdio/getc.c
@@ -29,7 +29,7 @@ SYNOPSIS
int getc(FILE *<[fp]>);
#include <stdio.h>
- int _getc_r(struct _reent *<[ptr]>, FILE *<[fp]>);
+ int _getc_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
DESCRIPTION
<<getc>> is a macro, defined in <<stdio.h>>. You can use <<getc>>
diff --git a/newlib/libc/stdio/getchar.c b/newlib/libc/stdio/getchar.c
index b10d0218dd49..d8c6b394c4f5 100644
--- a/newlib/libc/stdio/getchar.c
+++ b/newlib/libc/stdio/getchar.c
@@ -28,7 +28,7 @@ SYNOPSIS
#include <stdio.h>
int getchar(void);
- int _getchar_r(struct _reent *<[reent]>);
+ int _getchar_r(__reent_ptr_t <[reent]>);
DESCRIPTION
<<getchar>> is a macro, defined in <<stdio.h>>. You can use <<getchar>>
diff --git a/newlib/libc/stdio/getchar_u.c b/newlib/libc/stdio/getchar_u.c
index 97540ef294b4..65d4296a91c9 100644
--- a/newlib/libc/stdio/getchar_u.c
+++ b/newlib/libc/stdio/getchar_u.c
@@ -29,7 +29,7 @@ SYNOPSIS
int getchar_unlocked(void);
#include <stdio.h>
- int _getchar_unlocked_r(struct _reent *<[ptr]>);
+ int _getchar_unlocked_r(__reent_ptr_t <[ptr]>);
DESCRIPTION
<<getchar_unlocked>> is a non-thread-safe version of <<getchar>>
diff --git a/newlib/libc/stdio/gets.c b/newlib/libc/stdio/gets.c
index df4eceef02a3..c2fed62bd6e1 100644
--- a/newlib/libc/stdio/gets.c
+++ b/newlib/libc/stdio/gets.c
@@ -29,7 +29,7 @@ SYNOPSIS
char *gets(char *<[buf]>);
- char *_gets_r(struct _reent *<[reent]>, char *<[buf]>);
+ char *_gets_r(__reent_ptr_t <[reent]>, char *<[buf]>);
DESCRIPTION
Reads characters from standard input until a newline is found.
diff --git a/newlib/libc/stdio/getwchar.c b/newlib/libc/stdio/getwchar.c
index 140c02aada25..2e1c1454c0eb 100644
--- a/newlib/libc/stdio/getwchar.c
+++ b/newlib/libc/stdio/getwchar.c
@@ -46,10 +46,10 @@ SYNOPSIS
wint_t getwchar_unlocked(void);
#include <wchar.h>
- wint_t _getwchar_r(struct _reent *<[reent]>);
+ wint_t _getwchar_r(__reent_ptr_t <[reent]>);
#include <wchar.h>
- wint_t _getwchar_unlocked_r(struct _reent *<[reent]>);
+ wint_t _getwchar_unlocked_r(__reent_ptr_t <[reent]>);
DESCRIPTION
<<getwchar>> function or macro is the wide character equivalent of
diff --git a/newlib/libc/stdio/mktemp.c b/newlib/libc/stdio/mktemp.c
index 1780f7ce95d8..ae07642cd0f8 100644
--- a/newlib/libc/stdio/mktemp.c
+++ b/newlib/libc/stdio/mktemp.c
@@ -60,13 +60,13 @@ SYNOPSIS
int mkostemp(char *<[path]>, int <[flags]>);
int mkostemps(char *<[path]>, int <[suffixlen]>, int <[flags]>);
- char *_mktemp_r(struct _reent *<[reent]>, char *<[path]>);
- char *_mkdtemp_r(struct _reent *<[reent]>, char *<[path]>);
- int *_mkstemp_r(struct _reent *<[reent]>, char *<[path]>);
- int *_mkstemps_r(struct _reent *<[reent]>, char *<[path]>, int <[len]>);
- int *_mkostemp_r(struct _reent *<[reent]>, char *<[path]>,
+ char *_mktemp_r(__reent_ptr_t <[reent]>, char *<[path]>);
+ char *_mkdtemp_r(__reent_ptr_t <[reent]>, char *<[path]>);
+ int *_mkstemp_r(__reent_ptr_t <[reent]>, char *<[path]>);
+ int *_mkstemps_r(__reent_ptr_t <[reent]>, char *<[path]>, int <[len]>);
+ int *_mkostemp_r(__reent_ptr_t <[reent]>, char *<[path]>,
int <[flags]>);
- int *_mkostemps_r(struct _reent *<[reent]>, char *<[path]>, int <[len]>,
+ int *_mkostemps_r(__reent_ptr_t <[reent]>, char *<[path]>, int <[len]>,
int <[flags]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/nano-vfprintf.c b/newlib/libc/stdio/nano-vfprintf.c
index 00350d478d95..79e171fc72c6 100644
--- a/newlib/libc/stdio/nano-vfprintf.c
+++ b/newlib/libc/stdio/nano-vfprintf.c
@@ -99,17 +99,17 @@ SYNOPSIS
char *vasnprintf(char *<[str]>, size_t *<[size]>, const char *<[fmt]>,
va_list <[list]>);
- int _vprintf_r(struct _reent *<[reent]>, const char *<[fmt]>,
+ int _vprintf_r(__reent_ptr_t <[reent]>, const char *<[fmt]>,
va_list <[list]>);
- int _vfprintf_r(struct _reent *<[reent]>, FILE *<[fp]>,
+ int _vfprintf_r(__reent_ptr_t <[reent]>, FILE *<[fp]>,
const char *<[fmt]>, va_list <[list]>);
- int _vsprintf_r(struct _reent *<[reent]>, char *<[str]>,
+ int _vsprintf_r(__reent_ptr_t <[reent]>, char *<[str]>,
const char *<[fmt]>, va_list <[list]>);
- int _vasprintf_r(struct _reent *<[reent]>, char **<[str]>,
+ int _vasprintf_r(__reent_ptr_t <[reent]>, char **<[str]>,
const char *<[fmt]>, va_list <[list]>);
- int _vsnprintf_r(struct _reent *<[reent]>, char *<[str]>,
+ int _vsnprintf_r(__reent_ptr_t <[reent]>, char *<[str]>,
size_t <[size]>, const char *<[fmt]>, va_list <[list]>);
- char *_vasnprintf_r(struct _reent *<[reent]>, char *<[str]>,
+ char *_vasnprintf_r(__reent_ptr_t <[reent]>, char *<[str]>,
size_t *<[size]>, const char *<[fmt]>, va_list <[list]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/nano-vfscanf.c b/newlib/libc/stdio/nano-vfscanf.c
index e9d898cfe539..209ac8a6a18f 100644
--- a/newlib/libc/stdio/nano-vfscanf.c
+++ b/newlib/libc/stdio/nano-vfscanf.c
@@ -67,11 +67,11 @@ SYNOPSIS
int vfscanf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>);
int vsscanf(const char *<[str]>, const char *<[fmt]>, va_list <[list]>);
- int _vscanf_r(struct _reent *<[reent]>, const char *<[fmt]>,
+ int _vscanf_r(__reent_ptr_t <[reent]>, const char *<[fmt]>,
va_list <[list]>);
- int _vfscanf_r(struct _reent *<[reent]>, FILE *<[fp]>, const char *<[fmt]>,
+ int _vfscanf_r(__reent_ptr_t <[reent]>, FILE *<[fp]>, const char *<[fmt]>,
va_list <[list]>);
- int _vsscanf_r(struct _reent *<[reent]>, const char *<[str]>,
+ int _vsscanf_r(__reent_ptr_t <[reent]>, const char *<[str]>,
const char *<[fmt]>, va_list <[list]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/perror.c b/newlib/libc/stdio/perror.c
index 82d2028cf640..d59552e52590 100644
--- a/newlib/libc/stdio/perror.c
+++ b/newlib/libc/stdio/perror.c
@@ -28,7 +28,7 @@ SYNOPSIS
#include <stdio.h>
void perror(char *<[prefix]>);
- void _perror_r(struct _reent *<[reent]>, char *<[prefix]>);
+ void _perror_r(__reent_ptr_t <[reent]>, char *<[prefix]>);
DESCRIPTION
Use <<perror>> to print (on standard error) an error message
diff --git a/newlib/libc/stdio/putc.c b/newlib/libc/stdio/putc.c
index 7b53c48cb8ce..65a4007a318c 100644
--- a/newlib/libc/stdio/putc.c
+++ b/newlib/libc/stdio/putc.c
@@ -29,7 +29,7 @@ SYNOPSIS
int putc(int <[ch]>, FILE *<[fp]>);
#include <stdio.h>
- int _putc_r(struct _reent *<[ptr]>, int <[ch]>, FILE *<[fp]>);
+ int _putc_r(__reent_ptr_t <[ptr]>, int <[ch]>, FILE *<[fp]>);
DESCRIPTION
<<putc>> is a macro, defined in <<stdio.h>>. <<putc>>
diff --git a/newlib/libc/stdio/putc_u.c b/newlib/libc/stdio/putc_u.c
index 1a82a152fdc5..3e8a16f32153 100644
--- a/newlib/libc/stdio/putc_u.c
+++ b/newlib/libc/stdio/putc_u.c
@@ -29,7 +29,7 @@ SYNOPSIS
int putc_unlocked(int <[ch]>, FILE *<[fp]>);
#include <stdio.h>
- int _putc_unlocked_r(struct _reent *<[ptr]>, int <[ch]>, FILE *<[fp]>);
+ int _putc_unlocked_r(__reent_ptr_t <[ptr]>, int <[ch]>, FILE *<[fp]>);
DESCRIPTION
<<putc_unlocked>> is a non-thread-safe version of <<putc>> declared in
diff --git a/newlib/libc/stdio/putchar.c b/newlib/libc/stdio/putchar.c
index b228b23cd52a..a067d6eb4573 100644
--- a/newlib/libc/stdio/putchar.c
+++ b/newlib/libc/stdio/putchar.c
@@ -28,7 +28,7 @@ SYNOPSIS
#include <stdio.h>
int putchar(int <[ch]>);
- int _putchar_r(struct _reent *<[reent]>, int <[ch]>);
+ int _putchar_r(__reent_ptr_t <[reent]>, int <[ch]>);
DESCRIPTION
<<putchar>> is a macro, defined in <<stdio.h>>. <<putchar>>
diff --git a/newlib/libc/stdio/puts.c b/newlib/libc/stdio/puts.c
index 89e3d059a179..bdda15c8647e 100644
--- a/newlib/libc/stdio/puts.c
+++ b/newlib/libc/stdio/puts.c
@@ -28,7 +28,7 @@ SYNOPSIS
#include <stdio.h>
int puts(const char *<[s]>);
- int _puts_r(struct _reent *<[reent]>, const char *<[s]>);
+ int _puts_r(__reent_ptr_t <[reent]>, const char *<[s]>);
DESCRIPTION
<<puts>> writes the string at <[s]> (followed by a newline, instead of
diff --git a/newlib/libc/stdio/putwchar.c b/newlib/libc/stdio/putwchar.c
index 386085f94320..86bb94560385 100644
--- a/newlib/libc/stdio/putwchar.c
+++ b/newlib/libc/stdio/putwchar.c
@@ -45,10 +45,10 @@ SYNOPSIS
wint_t putwchar_unlocked(wchar_t <[wc]>);
#include <wchar.h>
- wint_t _putwchar_r(struct _reent *<[reent]>, wchar_t <[wc]>);
+ wint_t _putwchar_r(__reent_ptr_t <[reent]>, wchar_t <[wc]>);
#include <wchar.h>
- wint_t _putwchar_unlocked_r(struct _reent *<[reent]>, wchar_t <[wc]>);
+ wint_t _putwchar_unlocked_r(__reent_ptr_t <[reent]>, wchar_t <[wc]>);
DESCRIPTION
The <<putwchar>> function or macro is the wide-character equivalent of
diff --git a/newlib/libc/stdio/remove.c b/newlib/libc/stdio/remove.c
index a7243c3ac070..c347e754e5d4 100644
--- a/newlib/libc/stdio/remove.c
+++ b/newlib/libc/stdio/remove.c
@@ -28,7 +28,7 @@ SYNOPSIS
#include <stdio.h>
int remove(char *<[filename]>);
- int _remove_r(struct _reent *<[reent]>, char *<[filename]>);
+ int _remove_r(__reent_ptr_t <[reent]>, char *<[filename]>);
DESCRIPTION
Use <<remove>> to dissolve the association between a particular
diff --git a/newlib/libc/stdio/rewind.c b/newlib/libc/stdio/rewind.c
index 083f05bec453..529f01ecb983 100644
--- a/newlib/libc/stdio/rewind.c
+++ b/newlib/libc/stdio/rewind.c
@@ -27,7 +27,7 @@ INDEX
SYNOPSIS
#include <stdio.h>
void rewind(FILE *<[fp]>);
- void _rewind_r(struct _reent *<[ptr]>, FILE *<[fp]>);
+ void _rewind_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
DESCRIPTION
<<rewind>> returns the file position indicator (if any) for the file
diff --git a/newlib/libc/stdio/siprintf.c b/newlib/libc/stdio/siprintf.c
index 82bd87099430..ae39536524b1 100644
--- a/newlib/libc/stdio/siprintf.c
+++ b/newlib/libc/stdio/siprintf.c
@@ -56,16 +56,16 @@ SYNOPSIS
char *asniprintf(char *<[str]>, size_t *<[size]>,
const char *<[format]>, ...);
- int _iprintf_r(struct _reent *<[ptr]>, const char *<[format]>, ...);
- int _fiprintf_r(struct _reent *<[ptr]>, FILE *<[fd]>,
+ int _iprintf_r(__reent_ptr_t <[ptr]>, const char *<[format]>, ...);
+ int _fiprintf_r(__reent_ptr_t <[ptr]>, FILE *<[fd]>,
const char *<[format]>, ...);
- int _siprintf_r(struct _reent *<[ptr]>, char *<[str]>,
+ int _siprintf_r(__reent_ptr_t <[ptr]>, char *<[str]>,
const char *<[format]>, ...);
- int _sniprintf_r(struct _reent *<[ptr]>, char *<[str]>, size_t <[size]>,
+ int _sniprintf_r(__reent_ptr_t <[ptr]>, char *<[str]>, size_t <[size]>,
const char *<[format]>, ...);
- int _asiprintf_r(struct _reent *<[ptr]>, char **<[strp]>,
+ int _asiprintf_r(__reent_ptr_t <[ptr]>, char **<[strp]>,
const char *<[format]>, ...);
- char *_asniprintf_r(struct _reent *<[ptr]>, char *<[str]>,
+ char *_asniprintf_r(__reent_ptr_t <[ptr]>, char *<[str]>,
size_t *<[size]>, const char *<[format]>, ...);
DESCRIPTION
diff --git a/newlib/libc/stdio/siscanf.c b/newlib/libc/stdio/siscanf.c
index 98bd7718a7a4..dedc6c5059ab 100644
--- a/newlib/libc/stdio/siscanf.c
+++ b/newlib/libc/stdio/siscanf.c
@@ -39,10 +39,10 @@ SYNOPSIS
int fiscanf(FILE *<[fd]>, const char *<[format]>, ...);
int siscanf(const char *<[str]>, const char *<[format]>, ...);
- int _iscanf_r(struct _reent *<[ptr]>, const char *<[format]>, ...);
- int _fiscanf_r(struct _reent *<[ptr]>, FILE *<[fd]>,
+ int _iscanf_r(__reent_ptr_t <[ptr]>, const char *<[format]>, ...);
+ int _fiscanf_r(__reent_ptr_t <[ptr]>, FILE *<[fd]>,
const char *<[format]>, ...);
- int _siscanf_r(struct _reent *<[ptr]>, const char *<[str]>,
+ int _siscanf_r(__reent_ptr_t <[ptr]>, const char *<[str]>,
const char *<[format]>, ...);
DESCRIPTION
diff --git a/newlib/libc/stdio/sprintf.c b/newlib/libc/stdio/sprintf.c
index 085ad4fe0744..b45b85e937a1 100644
--- a/newlib/libc/stdio/sprintf.c
+++ b/newlib/libc/stdio/sprintf.c
@@ -56,16 +56,16 @@ SYNOPSIS
char *asnprintf(char *restrict <[str]>, size_t *restrict <[size]>, const char *restrict <[format]>,
...);
- int _printf_r(struct _reent *<[ptr]>, const char *restrict <[format]>, ...);
- int _fprintf_r(struct _reent *<[ptr]>, FILE *restrict <[fd]>,
+ int _printf_r(__reent_ptr_t <[ptr]>, const char *restrict <[format]>, ...);
+ int _fprintf_r(__reent_ptr_t <[ptr]>, FILE *restrict <[fd]>,
const char *restrict <[format]>, ...);
- int _sprintf_r(struct _reent *<[ptr]>, char *restrict <[str]>,
+ int _sprintf_r(__reent_ptr_t <[ptr]>, char *restrict <[str]>,
const char *restrict <[format]>, ...);
- int _snprintf_r(struct _reent *<[ptr]>, char *restrict <[str]>, size_t <[size]>,
+ int _snprintf_r(__reent_ptr_t <[ptr]>, char *restrict <[str]>, size_t <[size]>,
const char *restrict <[format]>, ...);
- int _asprintf_r(struct _reent *<[ptr]>, char **restrict <[strp]>,
+ int _asprintf_r(__reent_ptr_t <[ptr]>, char **restrict <[strp]>,
const char *restrict <[format]>, ...);
- char *_asnprintf_r(struct _reent *<[ptr]>, char *restrict <[str]>,
+ char *_asnprintf_r(__reent_ptr_t <[ptr]>, char *restrict <[str]>,
size_t *restrict <[size]>, const char *restrict <[format]>, ...);
DESCRIPTION
diff --git a/newlib/libc/stdio/sscanf.c b/newlib/libc/stdio/sscanf.c
index ff50f1661a64..a9383d558435 100644
--- a/newlib/libc/stdio/sscanf.c
+++ b/newlib/libc/stdio/sscanf.c
@@ -39,10 +39,10 @@ SYNOPSIS
int fscanf(FILE *restrict <[fd]>, const char *restrict <[format]>, ...);
int sscanf(const char *restrict <[str]>, const char *restrict <[format]>, ...);
- int _scanf_r(struct _reent *<[ptr]>, const char *restrict <[format]>, ...);
- int _fscanf_r(struct _reent *<[ptr]>, FILE *restrict <[fd]>,
+ int _scanf_r(__reent_ptr_t <[ptr]>, const char *restrict <[format]>, ...);
+ int _fscanf_r(__reent_ptr_t <[ptr]>, FILE *restrict <[fd]>,
const char *restrict <[format]>, ...);
- int _sscanf_r(struct _reent *<[ptr]>, const char *restrict <[str]>,
+ int _sscanf_r(__reent_ptr_t <[ptr]>, const char *restrict <[str]>,
const char *restrict <[format]>, ...);
DESCRIPTION
diff --git a/newlib/libc/stdio/swprintf.c b/newlib/libc/stdio/swprintf.c
index 73410b93e180..8e306df35353 100644
--- a/newlib/libc/stdio/swprintf.c
+++ b/newlib/libc/stdio/swprintf.c
@@ -41,10 +41,10 @@ SYNOPSIS
int swprintf(wchar_t *__restrict <[str]>, size_t <[size]>,
const wchar_t *__restrict <[format]>, ...);
- int _wprintf_r(struct _reent *<[ptr]>, const wchar_t *<[format]>, ...);
- int _fwprintf_r(struct _reent *<[ptr]>, FILE *<[fd]>,
+ int _wprintf_r(__reent_ptr_t <[ptr]>, const wchar_t *<[format]>, ...);
+ int _fwprintf_r(__reent_ptr_t <[ptr]>, FILE *<[fd]>,
const wchar_t *<[format]>, ...);
- int _swprintf_r(struct _reent *<[ptr]>, wchar_t *<[str]>,
+ int _swprintf_r(__reent_ptr_t <[ptr]>, wchar_t *<[str]>,
size_t <[size]>, const wchar_t *<[format]>, ...);
DESCRIPTION
diff --git a/newlib/libc/stdio/swscanf.c b/newlib/libc/stdio/swscanf.c
index d07f6c275f64..bf6d05d4830f 100644
--- a/newlib/libc/stdio/swscanf.c
+++ b/newlib/libc/stdio/swscanf.c
@@ -41,10 +41,10 @@ SYNOPSIS
int swscanf(const wchar_t *__restrict <[str]>,
const wchar_t *__restrict <[format]>, ...);
- int _wscanf_r(struct _reent *<[ptr]>, const wchar_t *<[format]>, ...);
- int _fwscanf_r(struct _reent *<[ptr]>, FILE *<[fd]>,
+ int _wscanf_r(__reent_ptr_t <[ptr]>, const wchar_t *<[format]>, ...);
+ int _fwscanf_r(__reent_ptr_t <[ptr]>, FILE *<[fd]>,
const wchar_t *<[format]>, ...);
- int _swscanf_r(struct _reent *<[ptr]>, const wchar_t *<[str]>,
+ int _swscanf_r(__reent_ptr_t <[ptr]>, const wchar_t *<[str]>,
const wchar_t *<[format]>, ...);
DESCRIPTION
diff --git a/newlib/libc/stdio/tmpfile.c b/newlib/libc/stdio/tmpfile.c
index 90fb5e29f1b7..89578cd1e40e 100644
--- a/newlib/libc/stdio/tmpfile.c
+++ b/newlib/libc/stdio/tmpfile.c
@@ -11,7 +11,7 @@ SYNOPSIS
#include <stdio.h>
FILE *tmpfile(void);
- FILE *_tmpfile_r(struct _reent *<[reent]>);
+ FILE *_tmpfile_r(__reent_ptr_t <[reent]>);
DESCRIPTION
Create a temporary file (a file which will be deleted automatically),
diff --git a/newlib/libc/stdio/tmpnam.c b/newlib/libc/stdio/tmpnam.c
index ab097de86436..88f1ae94566b 100644
--- a/newlib/libc/stdio/tmpnam.c
+++ b/newlib/libc/stdio/tmpnam.c
@@ -19,8 +19,8 @@ SYNOPSIS
#include <stdio.h>
char *tmpnam(char *<[s]>);
char *tempnam(char *<[dir]>, char *<[pfx]>);
- char *_tmpnam_r(struct _reent *<[reent]>, char *<[s]>);
- char *_tempnam_r(struct _reent *<[reent]>, char *<[dir]>, char *<[pfx]>);
+ char *_tmpnam_r(__reent_ptr_t <[reent]>, char *<[s]>);
+ char *_tempnam_r(__reent_ptr_t <[reent]>, char *<[dir]>, char *<[pfx]>);
DESCRIPTION
Use either of these functions to generate a name for a temporary file.
diff --git a/newlib/libc/stdio/ungetc.c b/newlib/libc/stdio/ungetc.c
index efc0bfb09e75..adced652c23c 100644
--- a/newlib/libc/stdio/ungetc.c
+++ b/newlib/libc/stdio/ungetc.c
@@ -27,7 +27,7 @@ SYNOPSIS
#include <stdio.h>
int ungetc(int <[c]>, FILE *<[stream]>);
- int _ungetc_r(struct _reent *<[reent]>, int <[c]>, FILE *<[stream]>);
+ int _ungetc_r(__reent_ptr_t <[reent]>, int <[c]>, FILE *<[stream]>);
DESCRIPTION
<<ungetc>> is used to return bytes back to <[stream]> to be read again.
diff --git a/newlib/libc/stdio/ungetwc.c b/newlib/libc/stdio/ungetwc.c
index 3dc1416b62e0..4db0b922ebe9 100644
--- a/newlib/libc/stdio/ungetwc.c
+++ b/newlib/libc/stdio/ungetwc.c
@@ -38,7 +38,7 @@ SYNOPSIS
#include <wchar.h>
wint_t ungetwc(wint_t <[wc]>, FILE *<[stream]>);
- wint_t _ungetwc_r(struct _reent *<[reent]>, wint_t <[wc]>, FILE *<[stream]>);
+ wint_t _ungetwc_r(__reent_ptr_t <[reent]>, wint_t <[wc]>, FILE *<[stream]>);
DESCRIPTION
<<ungetwc>> is used to return wide characters back to <[stream]> to be
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index e6d078cc44a4..a674967efff8 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -71,17 +71,17 @@ SYNOPSIS
char *vasnprintf(char *<[str]>, size_t *<[size]>, const char *<[fmt]>,
va_list <[list]>);
- int _vprintf_r(struct _reent *<[reent]>, const char *<[fmt]>,
+ int _vprintf_r(__reent_ptr_t <[reent]>, const char *<[fmt]>,
va_list <[list]>);
- int _vfprintf_r(struct _reent *<[reent]>, FILE *<[fp]>,
+ int _vfprintf_r(__reent_ptr_t <[reent]>, FILE *<[fp]>,
const char *<[fmt]>, va_list <[list]>);
- int _vsprintf_r(struct _reent *<[reent]>, char *<[str]>,
+ int _vsprintf_r(__reent_ptr_t <[reent]>, char *<[str]>,
const char *<[fmt]>, va_list <[list]>);
- int _vasprintf_r(struct _reent *<[reent]>, char **<[str]>,
+ int _vasprintf_r(__reent_ptr_t <[reent]>, char **<[str]>,
const char *<[fmt]>, va_list <[list]>);
- int _vsnprintf_r(struct _reent *<[reent]>, char *<[str]>,
+ int _vsnprintf_r(__reent_ptr_t <[reent]>, char *<[str]>,
size_t <[size]>, const char *<[fmt]>, va_list <[list]>);
- char *_vasnprintf_r(struct _reent *<[reent]>, char *<[str]>,
+ char *_vasnprintf_r(__reent_ptr_t <[reent]>, char *<[str]>,
size_t *<[size]>, const char *<[fmt]>, va_list <[list]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c
index a0b2092f73b2..f8fb2a4b4f81 100644
--- a/newlib/libc/stdio/vfscanf.c
+++ b/newlib/libc/stdio/vfscanf.c
@@ -39,11 +39,11 @@ SYNOPSIS
int vfscanf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>);
int vsscanf(const char *<[str]>, const char *<[fmt]>, va_list <[list]>);
- int _vscanf_r(struct _reent *<[reent]>, const char *<[fmt]>,
+ int _vscanf_r(__reent_ptr_t <[reent]>, const char *<[fmt]>,
va_list <[list]>);
- int _vfscanf_r(struct _reent *<[reent]>, FILE *<[fp]>, const char *<[fmt]>,
+ int _vfscanf_r(__reent_ptr_t <[reent]>, FILE *<[fp]>, const char *<[fmt]>,
va_list <[list]>);
- int _vsscanf_r(struct _reent *<[reent]>, const char *<[str]>,
+ int _vsscanf_r(__reent_ptr_t <[reent]>, const char *<[str]>,
const char *<[fmt]>, va_list <[list]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/vfwprintf.c b/newlib/libc/stdio/vfwprintf.c
index 7342f4f55030..d61960ebdda6 100644
--- a/newlib/libc/stdio/vfwprintf.c
+++ b/newlib/libc/stdio/vfwprintf.c
@@ -57,11 +57,11 @@ SYNOPSIS
int vswprintf(wchar_t * __restrict <[str]>, size_t <[size]>,
const wchar_t *__ restrict <[fmt]>, va_list <[list]>);
- int _vwprintf_r(struct _reent *<[reent]>, const wchar_t *<[fmt]>,
+ int _vwprintf_r(__reent_ptr_t <[reent]>, const wchar_t *<[fmt]>,
va_list <[list]>);
- int _vfwprintf_r(struct _reent *<[reent]>, FILE *<[fp]>,
+ int _vfwprintf_r(__reent_ptr_t <[reent]>, FILE *<[fp]>,
const wchar_t *<[fmt]>, va_list <[list]>);
- int _vswprintf_r(struct _reent *<[reent]>, wchar_t *<[str]>,
+ int _vswprintf_r(__reent_ptr_t <[reent]>, wchar_t *<[str]>,
size_t <[size]>, const wchar_t *<[fmt]>, va_list <[list]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/vfwscanf.c b/newlib/libc/stdio/vfwscanf.c
index 17847aff547f..62a5c9b38c4c 100644
--- a/newlib/libc/stdio/vfwscanf.c
+++ b/newlib/libc/stdio/vfwscanf.c
@@ -41,11 +41,11 @@ SYNOPSIS
int vswscanf(const wchar_t *__restrict <[str]>,
const wchar_t *__restrict <[fmt]>, va_list <[list]>);
- int _vwscanf(struct _reent *<[reent]>, const wchar_t *<[fmt]>,
+ int _vwscanf(__reent_ptr_t <[reent]>, const wchar_t *<[fmt]>,
va_list <[list]>);
- int _vfwscanf(struct _reent *<[reent]>, FILE *<[fp]>,
+ int _vfwscanf(__reent_ptr_t <[reent]>, FILE *<[fp]>,
const wchar_t *<[fmt]>, va_list <[list]>);
- int _vswscanf(struct _reent *<[reent]>, const wchar_t *<[str]>,
+ int _vswscanf(__reent_ptr_t <[reent]>, const wchar_t *<[str]>,
const wchar_t *<[fmt]>, va_list <[list]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/viprintf.c b/newlib/libc/stdio/viprintf.c
index 0dea49607a46..125c48f1aa02 100644
--- a/newlib/libc/stdio/viprintf.c
+++ b/newlib/libc/stdio/viprintf.c
@@ -56,17 +56,17 @@ SYNOPSIS
char *vasniprintf(char *<[str]>, size_t *<[size]>, const char *<[fmt]>,
va_list <[list]>);
- int _viprintf_r(struct _reent *<[reent]>, const char *<[fmt]>,
+ int _viprintf_r(__reent_ptr_t <[reent]>, const char *<[fmt]>,
va_list <[list]>);
- int _vfiprintf_r(struct _reent *<[reent]>, FILE *<[fp]>,
+ int _vfiprintf_r(__reent_ptr_t <[reent]>, FILE *<[fp]>,
const char *<[fmt]>, va_list <[list]>);
- int _vsiprintf_r(struct _reent *<[reent]>, char *<[str]>,
+ int _vsiprintf_r(__reent_ptr_t <[reent]>, char *<[str]>,
const char *<[fmt]>, va_list <[list]>);
- int _vsniprintf_r(struct _reent *<[reent]>, char *<[str]>,
+ int _vsniprintf_r(__reent_ptr_t <[reent]>, char *<[str]>,
size_t <[size]>, const char *<[fmt]>, va_list <[list]>);
- int _vasiprintf_r(struct _reent *<[reent]>, char **<[str]>,
+ int _vasiprintf_r(__reent_ptr_t <[reent]>, char **<[str]>,
const char *<[fmt]>, va_list <[list]>);
- char *_vasniprintf_r(struct _reent *<[reent]>, char *<[str]>,
+ char *_vasniprintf_r(__reent_ptr_t <[reent]>, char *<[str]>,
size_t *<[size]>, const char *<[fmt]>, va_list <[list]>);
DESCRIPTION
diff --git a/newlib/libc/stdio/viscanf.c b/newlib/libc/stdio/viscanf.c
index 4b266546a57c..2454a59f29bb 100644
--- a/newlib/libc/stdio/viscanf.c
+++ b/newlib/libc/stdio/viscanf.c
@@ -41,11 +41,11 @@ SYNOPSIS
int vfiscanf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>);
int vsiscanf(const char *<[str]>, const char *<[fmt]>, va_list <[list]>);
- int _viscanf_r(struct _reent *<[reent]>, const char *<[fmt]>,
+ int _viscanf_r(__reent_ptr_t <[reent]>, const char *<[fmt]>,
va_list <[list]>);
- int _vfiscanf_r(struct _reent *<[reent]>, FILE *<[fp]>, const char *<[fmt]>,
+ int _vfiscanf_r(__reent_ptr_t <[reent]>, FILE *<[fp]>, const char *<[fmt]>,
va_list <[list]>);
- int _vsiscanf_r(struct _reent *<[reent]>, const char *<[str]>,
+ int _vsiscanf_r(__reent_ptr_t <[reent]>, const char *<[str]>,
const char *<[fmt]>, va_list <[list]>);
DESCRIPTION
diff --git a/newlib/libc/stdio64/fgetpos64.c b/newlib/libc/stdio64/fgetpos64.c
index 1fb41f7a285a..44f78a7e40d6 100644
--- a/newlib/libc/stdio64/fgetpos64.c
+++ b/newlib/libc/stdio64/fgetpos64.c
@@ -10,7 +10,7 @@ INDEX
SYNOPSIS
#include <stdio.h>
int fgetpos64(FILE *<[fp]>, _fpos64_t *<[pos]>);
- int _fgetpos64_r(struct _reent *<[ptr]>, FILE *<[fp]>,
+ int _fgetpos64_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>,
_fpos64_t *<[pos]>);
DESCRIPTION
diff --git a/newlib/libc/stdio64/freopen64.c b/newlib/libc/stdio64/freopen64.c
index e949904267d0..d0e2729fa28d 100644
--- a/newlib/libc/stdio64/freopen64.c
+++ b/newlib/libc/stdio64/freopen64.c
@@ -28,7 +28,7 @@ SYNOPSIS
#include <stdio.h>
FILE *freopen64(const char *<[file]>, const char *<[mode]>,
FILE *<[fp]>);
- FILE *_freopen64_r(struct _reent *<[ptr]>, const char *<[file]>,
+ FILE *_freopen64_r(__reent_ptr_t <[ptr]>, const char *<[file]>,
const char *<[mode]>, FILE *<[fp]>);
DESCRIPTION
diff --git a/newlib/libc/stdio64/fseeko64.c b/newlib/libc/stdio64/fseeko64.c
index 2e1cabb875ce..691fc383efab 100644
--- a/newlib/libc/stdio64/fseeko64.c
+++ b/newlib/libc/stdio64/fseeko64.c
@@ -27,7 +27,7 @@ INDEX
SYNOPSIS
#include <stdio.h>
int fseeko64(FILE *<[fp]>, _off64_t <[offset]>, int <[whence]>);
- int _fseeko64_r (struct _reent *<[ptr]>, FILE *<[fp]>,
+ int _fseeko64_r (__reent_ptr_t <[ptr]>, FILE *<[fp]>,
_off64_t <[offset]>, int <[whence]>);
DESCRIPTION
diff --git a/newlib/libc/stdio64/fsetpos64.c b/newlib/libc/stdio64/fsetpos64.c
index 658d2bc1677f..59c924a1c6ba 100644
--- a/newlib/libc/stdio64/fsetpos64.c
+++ b/newlib/libc/stdio64/fsetpos64.c
@@ -10,7 +10,7 @@ INDEX
SYNOPSIS
#include <stdio.h>
int fsetpos64(FILE *<[fp]>, const _fpos64_t *<[pos]>);
- int _fsetpos64_r(struct _reent *<[ptr]>, FILE *<[fp]>,
+ int _fsetpos64_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>,
const _fpos64_t *<[pos]>);
DESCRIPTION
diff --git a/newlib/libc/stdio64/ftello64.c b/newlib/libc/stdio64/ftello64.c
index 4ff99ec6c772..cd96fb571a9f 100644
--- a/newlib/libc/stdio64/ftello64.c
+++ b/newlib/libc/stdio64/ftello64.c
@@ -27,7 +27,7 @@ INDEX
SYNOPSIS
#include <stdio.h>
_off64_t ftello64(FILE *<[fp]>);
- _off64_t _ftello64_r(struct _reent *<[ptr]>, FILE *<[fp]>);
+ _off64_t _ftello64_r(__reent_ptr_t <[ptr]>, FILE *<[fp]>);
DESCRIPTION
Objects of type <<FILE>> can have a ``position'' that records how much
diff --git a/newlib/libc/stdlib/atoi.c b/newlib/libc/stdlib/atoi.c
index 73c206301050..d512019f61e1 100644
--- a/newlib/libc/stdlib/atoi.c
+++ b/newlib/libc/stdlib/atoi.c
@@ -15,8 +15,8 @@ SYNOPSIS
#include <stdlib.h>
int atoi(const char *<[s]>);
long atol(const char *<[s]>);
- int _atoi_r(struct _reent *<[ptr]>, const char *<[s]>);
- long _atol_r(struct _reent *<[ptr]>, const char *<[s]>);
+ int _atoi_r(__reent_ptr_t <[ptr]>, const char *<[s]>);
+ long _atol_r(__reent_ptr_t <[ptr]>, const char *<[s]>);
DESCRIPTION
<<atoi>> converts the initial portion of a string to an <<int>>.
diff --git a/newlib/libc/stdlib/atoll.c b/newlib/libc/stdlib/atoll.c
index 2475d487e6d5..b6d5684eac85 100644
--- a/newlib/libc/stdlib/atoll.c
+++ b/newlib/libc/stdlib/atoll.c
@@ -10,7 +10,7 @@ INDEX
SYNOPSIS
#include <stdlib.h>
long long atoll(const char *<[str]>);
- long long _atoll_r(struct _reent *<[ptr]>, const char *<[str]>);
+ long long _atoll_r(__reent_ptr_t <[ptr]>, const char *<[str]>);
DESCRIPTION
The function <<atoll>> converts the initial portion of the string
diff --git a/newlib/libc/stdlib/envlock.c b/newlib/libc/stdlib/envlock.c
index 5eda5338cc97..6bc6689b9ee0 100644
--- a/newlib/libc/stdlib/envlock.c
+++ b/newlib/libc/stdlib/envlock.c
@@ -9,8 +9,8 @@ INDEX
SYNOPSIS
#include <envlock.h>
- void __env_lock (struct _reent *<[reent]>);
- void __env_unlock (struct _reent *<[reent]>);
+ void __env_lock (__reent_ptr_t <[reent]>);
+ void __env_unlock (__reent_ptr_t <[reent]>);
DESCRIPTION
The <<setenv>> family of routines call these functions when they need to
diff --git a/newlib/libc/stdlib/getenv_r.c b/newlib/libc/stdlib/getenv_r.c
index edd1b1a21eb7..d20a58eb4aad 100644
--- a/newlib/libc/stdlib/getenv_r.c
+++ b/newlib/libc/stdlib/getenv_r.c
@@ -9,7 +9,7 @@ INDEX
SYNOPSIS
#include <stdlib.h>
- char *_getenv_r(struct _reent *<[reent_ptr]>, const char *<[name]>);
+ char *_getenv_r(__reent_ptr_t <[reent_ptr]>, const char *<[name]>);
DESCRIPTION
<<_getenv_r>> searches the list of environment variable names and values
diff --git a/newlib/libc/stdlib/mblen_r.c b/newlib/libc/stdlib/mblen_r.c
index 92bbf582ea24..c722aa8ced32 100644
--- a/newlib/libc/stdlib/mblen_r.c
+++ b/newlib/libc/stdlib/mblen_r.c
@@ -7,7 +7,7 @@ INDEX
SYNOPSIS
#include <stdlib.h>
- int _mblen_r(struct _reent *<[r]>, const char *<[s]>, size_t <[n]>, int *<[state]>);
+ int _mblen_r(__reent_ptr_t <[r]>, const char *<[s]>, size_t <[n]>, int *<[state]>);
DESCRIPTION
When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming
diff --git a/newlib/libc/stdlib/mbsnrtowcs.c b/newlib/libc/stdlib/mbsnrtowcs.c
index 8730527a1f70..7f94429a335a 100644
--- a/newlib/libc/stdlib/mbsnrtowcs.c
+++ b/newlib/libc/stdlib/mbsnrtowcs.c
@@ -19,7 +19,7 @@ SYNOPSIS
mbstate_t *__restrict <[ps]>);
#include <wchar.h>
- size_t _mbsrtowcs_r(struct _reent *<[ptr]>, wchar_t *<[dst]>,
+ size_t _mbsrtowcs_r(__reent_ptr_t <[ptr]>, wchar_t *<[dst]>,
const char **<[src]>, size_t <[len]>,
mbstate_t *<[ps]>);
@@ -29,7 +29,7 @@ SYNOPSIS
size_t <[len]>, mbstate_t *__restrict <[ps]>);
#include <wchar.h>
- size_t _mbsnrtowcs_r(struct _reent *<[ptr]>, wchar_t *<[dst]>,
+ size_t _mbsnrtowcs_r(__reent_ptr_t <[ptr]>, wchar_t *<[dst]>,
const char **<[src]>, size_t <[nms]>,
size_t <[len]>, mbstate_t *<[ps]>);
diff --git a/newlib/libc/stdlib/mlock.c b/newlib/libc/stdlib/mlock.c
index d9138c8c0eb7..c02354995bff 100644
--- a/newlib/libc/stdlib/mlock.c
+++ b/newlib/libc/stdlib/mlock.c
@@ -10,8 +10,8 @@ INDEX
SYNOPSIS
#include <malloc.h>
- void __malloc_lock (struct _reent *<[reent]>);
- void __malloc_unlock (struct _reent *<[reent]>);
+ void __malloc_lock (__reent_ptr_t <[reent]>);
+ void __malloc_unlock (__reent_ptr_t <[reent]>);
DESCRIPTION
The <<malloc>> family of routines call these functions when they need to lock
diff --git a/newlib/libc/stdlib/wcsnrtombs.c b/newlib/libc/stdlib/wcsnrtombs.c
index 1adfd589e52d..424a7e764819 100644
--- a/newlib/libc/stdlib/wcsnrtombs.c
+++ b/newlib/libc/stdlib/wcsnrtombs.c
@@ -18,7 +18,7 @@ SYNOPSIS
mbstate_t *__restrict <[ps]>);
#include <wchar.h>
- size_t _wcsrtombs_r(struct _reent *<[ptr]>, char *<[dst]>,
+ size_t _wcsrtombs_r(__reent_ptr_t <[ptr]>, char *<[dst]>,
const wchar_t **<[src]>, size_t <[len]>,
mbstate_t *<[ps]>);
@@ -29,7 +29,7 @@ SYNOPSIS
mbstate_t *__restrict <[ps]>);
#include <wchar.h>
- size_t _wcsnrtombs_r(struct _reent *<[ptr]>, char *<[dst]>,
+ size_t _wcsnrtombs_r(__reent_ptr_t <[ptr]>, char *<[dst]>,
const wchar_t **<[src]>, size_t <[nwc]>,
size_t <[len]>, mbstate_t *<[ps]>);
diff --git a/newlib/libc/string/wcsdup.c b/newlib/libc/string/wcsdup.c
index 6ea217db36fa..ebc9f6502bdc 100644
--- a/newlib/libc/string/wcsdup.c
+++ b/newlib/libc/string/wcsdup.c
@@ -12,7 +12,7 @@ SYNOPSIS
wchar_t *wcsdup(const wchar_t *<[str]>);
#include <wchar.h>
- wchar_t *_wcsdup_r(struct _reent *<[ptr]>, const wchar_t *<[str]>);
+ wchar_t *_wcsdup_r(__reent_ptr_t <[ptr]>, const wchar_t *<[str]>);
DESCRIPTION
<<wcsdup>> allocates a new wide character string using <<malloc>>,
diff --git a/newlib/libc/time/tzset.c b/newlib/libc/time/tzset.c
index 77accbfb0485..67a64f4331fe 100644
--- a/newlib/libc/time/tzset.c
+++ b/newlib/libc/time/tzset.c
@@ -10,7 +10,7 @@ INDEX
SYNOPSIS
#include <time.h>
void tzset(void);
- void _tzset_r (struct _reent *<[reent_ptr]>);
+ void _tzset_r (__reent_ptr_t <[reent_ptr]>);
DESCRIPTION
<<tzset>> examines the <[TZ]> environment variable and sets up the three
diff --git a/newlib/libc/unix/pread.c b/newlib/libc/unix/pread.c
index 533ca70ad2e0..94138b027cf0 100644
--- a/newlib/libc/unix/pread.c
+++ b/newlib/libc/unix/pread.c
@@ -11,7 +11,7 @@ INDEX
SYNOPSIS
#include <unistd.h>
ssize_t pread(int <[fd]>, void *<[buf]>, size_t <[n]>, off_t <[off]>);
- ssize_t _pread_r(struct _reent *<[rptr]>, int <[fd]>,
+ ssize_t _pread_r(__reent_ptr_t <[rptr]>, int <[fd]>,
void *<[buf]>, size_t <[n]>, off_t <[off]>);
DESCRIPTION
diff --git a/newlib/libc/unix/pwrite.c b/newlib/libc/unix/pwrite.c
index baf571a648c5..b4c46a3fd346 100644
--- a/newlib/libc/unix/pwrite.c
+++ b/newlib/libc/unix/pwrite.c
@@ -12,7 +12,7 @@ SYNOPSIS
#include <unistd.h>
ssize_t pwrite(int <[fd]>, const void *<[buf]>,
size_t <[n]>, off_t <[off]>);
- ssize_t _pwrite_r(struct _reent *<[rptr]>, int <[fd]>,
+ ssize_t _pwrite_r(__reent_ptr_t <[rptr]>, int <[fd]>,
const void *<[buf]>, size_t <[n]>, off_t <[off]>);
DESCRIPTION
--
2.56.1
More information about the Newlib
mailing list