From a7c3258311f02587564df48055a8dabbab464fdc Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 21 Nov 2013 16:44:39 +0000 Subject: 2013-11-21 Joel Sherrill * libc/posix/readdir_r.c: Add restrict keyword. * libc/machine/spu/sys/dirent.h, libc/sys/decstation/sys/dirent.h, libc/sys/linux/sys/dirent.h, libc/sys/rtems/sys/dirent.h, libc/sys/sparc64/sys/dirent.h, libc/sys/sun4/sys/dirent.h, libc/sys/sysvi386/sys/dirent.h: Add readdir_r() prototype. --- newlib/libc/machine/spu/sys/dirent.h | 2 ++ newlib/libc/posix/readdir_r.c | 6 +++--- newlib/libc/sys/decstation/sys/dirent.h | 2 ++ newlib/libc/sys/linux/sys/dirent.h | 2 ++ newlib/libc/sys/rtems/sys/dirent.h | 2 ++ newlib/libc/sys/sparc64/sys/dirent.h | 2 ++ newlib/libc/sys/sun4/sys/dirent.h | 2 ++ newlib/libc/sys/sysvi386/sys/dirent.h | 2 ++ 8 files changed, 17 insertions(+), 3 deletions(-) (limited to 'newlib/libc') diff --git a/newlib/libc/machine/spu/sys/dirent.h b/newlib/libc/machine/spu/sys/dirent.h index 6a158ec..60da65a 100644 --- a/newlib/libc/machine/spu/sys/dirent.h +++ b/newlib/libc/machine/spu/sys/dirent.h @@ -54,6 +54,8 @@ typedef struct { DIR *opendir(const char *); int closedir(DIR *); struct dirent *readdir (DIR *); +int readdir_r (DIR *__restrict, struct dirent *__restrict, + struct dirent **__restrict); void rewinddir(DIR *); void seekdir(DIR *dir, off_t offset); off_t telldir(DIR *dir); diff --git a/newlib/libc/posix/readdir_r.c b/newlib/libc/posix/readdir_r.c index 1d526e3..d13775b 100644 --- a/newlib/libc/posix/readdir_r.c +++ b/newlib/libc/posix/readdir_r.c @@ -51,9 +51,9 @@ extern int getdents (int fd, void *dp, int count); */ int _DEFUN(readdir_r, (dirp, dp, dpp), - register DIR *dirp _AND - struct dirent *dp _AND - struct dirent **dpp) { + register DIR *__restrict dirp _AND + struct dirent *__restrict dp _AND + struct dirent **__restrict dpp) { struct dirent *tmpdp; diff --git a/newlib/libc/sys/decstation/sys/dirent.h b/newlib/libc/sys/decstation/sys/dirent.h index c5a90e9..c3abda6 100644 --- a/newlib/libc/sys/decstation/sys/dirent.h +++ b/newlib/libc/sys/decstation/sys/dirent.h @@ -25,6 +25,8 @@ typedef struct __dirdesc { DIR *opendir (const char *); struct dirent *readdir (DIR *); +int readdir_r (DIR *__restrict, struct dirent *__restrict, + struct dirent **__restrict); void rewinddir (DIR *); int closedir (DIR *); diff --git a/newlib/libc/sys/linux/sys/dirent.h b/newlib/libc/sys/linux/sys/dirent.h index ec8ed89..a67378b 100644 --- a/newlib/libc/sys/linux/sys/dirent.h +++ b/newlib/libc/sys/linux/sys/dirent.h @@ -36,6 +36,8 @@ typedef struct { DIR *opendir(const char *); struct dirent *readdir(DIR *); +int readdir_r(DIR *__restrict, struct dirent *__restrict, + struct dirent **__restrict); void rewinddir(DIR *); int closedir(DIR *); diff --git a/newlib/libc/sys/rtems/sys/dirent.h b/newlib/libc/sys/rtems/sys/dirent.h index c52c7bc..8d2aa38 100644 --- a/newlib/libc/sys/rtems/sys/dirent.h +++ b/newlib/libc/sys/rtems/sys/dirent.h @@ -26,6 +26,8 @@ typedef struct _dirdesc { DIR *opendir(const char *); struct dirent *readdir(DIR *); +int readdir_r(DIR *__restrict, struct dirent *__restrict, + struct dirent **__restrict); void rewinddir(DIR *); int closedir(DIR *); void seekdir(DIR *dir, long loc); diff --git a/newlib/libc/sys/sparc64/sys/dirent.h b/newlib/libc/sys/sparc64/sys/dirent.h index 864bb5c..cb933b4 100644 --- a/newlib/libc/sys/sparc64/sys/dirent.h +++ b/newlib/libc/sys/sparc64/sys/dirent.h @@ -21,6 +21,8 @@ typedef struct __dirdesc { DIR *opendir (const char *); struct dirent *readdir (DIR *); +int readdir_r (DIR *__restrict, struct dirent *__restrict, + struct dirent **__restrict); void rewinddir (DIR *); int closedir (DIR *); diff --git a/newlib/libc/sys/sun4/sys/dirent.h b/newlib/libc/sys/sun4/sys/dirent.h index b7ca90b..2e6fc45 100644 --- a/newlib/libc/sys/sun4/sys/dirent.h +++ b/newlib/libc/sys/sun4/sys/dirent.h @@ -23,6 +23,8 @@ typedef struct __dirdesc { DIR *opendir (const char *); struct dirent *readdir (DIR *); +int readdir_r (DIR *__restrict, struct dirent *__restrict, + struct dirent **__restrict); void rewinddir (DIR *); int closedir (DIR *); diff --git a/newlib/libc/sys/sysvi386/sys/dirent.h b/newlib/libc/sys/sysvi386/sys/dirent.h index 7280421..06af4fa 100644 --- a/newlib/libc/sys/sysvi386/sys/dirent.h +++ b/newlib/libc/sys/sysvi386/sys/dirent.h @@ -20,6 +20,8 @@ typedef struct _dirdesc { DIR *opendir (const char *); struct dirent *readdir (DIR *); +int readdir_r (DIR *__restrict, struct dirent *__restrict, + struct dirent **__restrict); void rewinddir (DIR *); int closedir (DIR *); -- cgit v1.1