aboutsummaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorMike Barcroft <mike@FreeBSD.org>2002-10-12 16:13:41 +0000
committerMike Barcroft <mike@FreeBSD.org>2002-10-12 16:13:41 +0000
commit54e4e385de33a961e801ceeea8146437e25edd88 (patch)
tree8937b8185655025519cc44865535915faec9b620 /lib/libc
parent7eeaf6dce8e5124bdaad05334e228d0d555ebbb4 (diff)
downloadsrc-54e4e385de33a961e801ceeea8146437e25edd88.tar.gz
src-54e4e385de33a961e801ceeea8146437e25edd88.zip
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/pselect.32
-rw-r--r--lib/libc/gen/pselect.c5
-rw-r--r--lib/libc/stdio/fgetpos.c2
-rw-r--r--lib/libc/stdio/fgets.34
-rw-r--r--lib/libc/stdio/fopen.32
-rw-r--r--lib/libc/stdio/fopen.c4
-rw-r--r--lib/libc/stdio/fputs.c4
-rw-r--r--lib/libc/stdio/fread.34
-rw-r--r--lib/libc/stdio/fread.c4
-rw-r--r--lib/libc/stdio/freopen.c3
-rw-r--r--lib/libc/stdio/fscanf.c2
-rw-r--r--lib/libc/stdio/fseek.32
-rw-r--r--lib/libc/stdio/fwrite.c4
-rw-r--r--lib/libc/stdio/scanf.312
-rw-r--r--lib/libc/stdio/scanf.c2
-rw-r--r--lib/libc/stdio/sscanf.c2
-rw-r--r--lib/libc/stdio/vscanf.c2
-rw-r--r--lib/libc/stdio/vsscanf.c4
18 files changed, 33 insertions, 31 deletions
diff --git a/lib/libc/gen/pselect.3 b/lib/libc/gen/pselect.3
index 6abb95205957..d09524c7a33d 100644
--- a/lib/libc/gen/pselect.3
+++ b/lib/libc/gen/pselect.3
@@ -39,7 +39,7 @@
.Sh SYNOPSIS
.In sys/select.h
.Ft int
-.Fn pselect "int nfds" "fd_set *readfds" "fd_set *writefds" "fd_set *exceptfds" "const struct timespec *timeout" "const sigset_t *newsigmask"
+.Fn pselect "int nfds" "fd_set * restrict readfds" "fd_set * restrict writefds" "fd_set * restrict exceptfds" "const struct timespec * restrict timeout" "const sigset_t * restrict newsigmask"
.Sh DESCRIPTION
The
.Fn pselect
diff --git a/lib/libc/gen/pselect.c b/lib/libc/gen/pselect.c
index c2ec1084beeb..28066a204aa4 100644
--- a/lib/libc/gen/pselect.c
+++ b/lib/libc/gen/pselect.c
@@ -47,8 +47,9 @@ __weak_reference(__pselect, pselect);
* and allows the user to specify a signal mask to apply during the select.
*/
int
-__pselect(int count, fd_set *rfds, fd_set *wfds, fd_set *efds,
- const struct timespec *timo, const sigset_t *mask)
+__pselect(int count, fd_set * __restrict rfds, fd_set * __restrict wfds,
+ fd_set * __restrict efds, const struct timespec * __restrict timo,
+ const sigset_t * __restrict mask)
{
sigset_t omask;
struct timeval tvtimo, *tvp;
diff --git a/lib/libc/stdio/fgetpos.c b/lib/libc/stdio/fgetpos.c
index f5e3aae77e42..295b20a8379e 100644
--- a/lib/libc/stdio/fgetpos.c
+++ b/lib/libc/stdio/fgetpos.c
@@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
int
-fgetpos(FILE *fp, fpos_t *pos)
+fgetpos(FILE * __restrict fp, fpos_t * __restrict pos)
{
/*
* ftello is thread-safe; no need to lock fp.
diff --git a/lib/libc/stdio/fgets.3 b/lib/libc/stdio/fgets.3
index e536b2157534..7a63039b21b3 100644
--- a/lib/libc/stdio/fgets.3
+++ b/lib/libc/stdio/fgets.3
@@ -48,7 +48,7 @@
.Sh SYNOPSIS
.In stdio.h
.Ft char *
-.Fn fgets "char *str" "int size" "FILE *stream"
+.Fn fgets "char * restrict str" "int size" "FILE * restrict stream"
.Ft char *
.Fn gets "char *str"
.Sh DESCRIPTION
@@ -163,4 +163,4 @@ The functions
and
.Fn gets
conform to
-.St -isoC .
+.St -isoC-99 .
diff --git a/lib/libc/stdio/fopen.3 b/lib/libc/stdio/fopen.3
index f4c1f34577ed..a4614d78f239 100644
--- a/lib/libc/stdio/fopen.3
+++ b/lib/libc/stdio/fopen.3
@@ -49,7 +49,7 @@
.Sh SYNOPSIS
.In stdio.h
.Ft FILE *
-.Fn fopen "const char *path" "const char *mode"
+.Fn fopen "const char * restrict path" "const char * restrict mode"
.Ft FILE *
.Fn fdopen "int fildes" "const char *mode"
.Ft FILE *
diff --git a/lib/libc/stdio/fopen.c b/lib/libc/stdio/fopen.c
index 7af0636285c0..b7c84a72006c 100644
--- a/lib/libc/stdio/fopen.c
+++ b/lib/libc/stdio/fopen.c
@@ -52,8 +52,8 @@ __FBSDID("$FreeBSD$");
FILE *
fopen(file, mode)
- const char *file;
- const char *mode;
+ const char * __restrict file;
+ const char * __restrict mode;
{
FILE *fp;
int f;
diff --git a/lib/libc/stdio/fputs.c b/lib/libc/stdio/fputs.c
index e209659dd553..812c37da50df 100644
--- a/lib/libc/stdio/fputs.c
+++ b/lib/libc/stdio/fputs.c
@@ -53,8 +53,8 @@ __FBSDID("$FreeBSD$");
*/
int
fputs(s, fp)
- const char *s;
- FILE *fp;
+ const char * __restrict s;
+ FILE * __restrict fp;
{
int retval;
struct __suio uio;
diff --git a/lib/libc/stdio/fread.3 b/lib/libc/stdio/fread.3
index 6d4a79c38e35..925ef61fc949 100644
--- a/lib/libc/stdio/fread.3
+++ b/lib/libc/stdio/fread.3
@@ -48,9 +48,9 @@
.Sh SYNOPSIS
.In stdio.h
.Ft size_t
-.Fn fread "void *ptr" "size_t size" "size_t nmemb" "FILE *stream"
+.Fn fread "void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream"
.Ft size_t
-.Fn fwrite "const void *ptr" "size_t size" "size_t nmemb" "FILE *stream"
+.Fn fwrite "const void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream"
.Sh DESCRIPTION
The function
.Fn fread
diff --git a/lib/libc/stdio/fread.c b/lib/libc/stdio/fread.c
index 39c1a8c36db4..73c7c1922eb0 100644
--- a/lib/libc/stdio/fread.c
+++ b/lib/libc/stdio/fread.c
@@ -49,9 +49,9 @@ __FBSDID("$FreeBSD$");
size_t
fread(buf, size, count, fp)
- void *buf;
+ void * __restrict buf;
size_t size, count;
- FILE *fp;
+ FILE * __restrict fp;
{
size_t resid;
char *p;
diff --git a/lib/libc/stdio/freopen.c b/lib/libc/stdio/freopen.c
index c8856739bead..b445b153d0b4 100644
--- a/lib/libc/stdio/freopen.c
+++ b/lib/libc/stdio/freopen.c
@@ -59,7 +59,8 @@ __FBSDID("$FreeBSD$");
*/
FILE *
freopen(file, mode, fp)
- const char *file, *mode;
+ const char * __restrict file;
+ const char * __restrict mode;
FILE *fp;
{
int f;
diff --git a/lib/libc/stdio/fscanf.c b/lib/libc/stdio/fscanf.c
index 1c376a89d6f1..ea76af296c1a 100644
--- a/lib/libc/stdio/fscanf.c
+++ b/lib/libc/stdio/fscanf.c
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
int
-fscanf(FILE *fp, char const *fmt, ...)
+fscanf(FILE * __restrict fp, char const * __restrict fmt, ...)
{
int ret;
va_list ap;
diff --git a/lib/libc/stdio/fseek.3 b/lib/libc/stdio/fseek.3
index 632675131f02..f2ca10f82d80 100644
--- a/lib/libc/stdio/fseek.3
+++ b/lib/libc/stdio/fseek.3
@@ -59,7 +59,7 @@
.Ft void
.Fn rewind "FILE *stream"
.Ft int
-.Fn fgetpos "FILE *stream" "fpos_t *pos"
+.Fn fgetpos "FILE * restrict stream" "fpos_t * restrict pos"
.Ft int
.Fn fsetpos "FILE *stream" "const fpos_t *pos"
.In sys/types.h
diff --git a/lib/libc/stdio/fwrite.c b/lib/libc/stdio/fwrite.c
index 445baecb7da4..0a74d8119485 100644
--- a/lib/libc/stdio/fwrite.c
+++ b/lib/libc/stdio/fwrite.c
@@ -53,9 +53,9 @@ __FBSDID("$FreeBSD$");
*/
size_t
fwrite(buf, size, count, fp)
- const void *buf;
+ const void * __restrict buf;
size_t size, count;
- FILE *fp;
+ FILE * __restrict fp;
{
size_t n;
struct __suio uio;
diff --git a/lib/libc/stdio/scanf.3 b/lib/libc/stdio/scanf.3
index af7cc18c95e5..ea99c0e537b9 100644
--- a/lib/libc/stdio/scanf.3
+++ b/lib/libc/stdio/scanf.3
@@ -52,18 +52,18 @@
.Sh SYNOPSIS
.In stdio.h
.Ft int
-.Fn scanf "const char *format" ...
+.Fn scanf "const char * restrict format" ...
.Ft int
-.Fn fscanf "FILE *stream" "const char *format" ...
+.Fn fscanf "FILE * restrict stream" "const char * restrict format" ...
.Ft int
-.Fn sscanf "const char *str" "const char *format" ...
+.Fn sscanf "const char * restrict str" "const char * restrict format" ...
.In stdarg.h
.Ft int
-.Fn vscanf "const char *format" "va_list ap"
+.Fn vscanf "const char * restrict format" "va_list ap"
.Ft int
-.Fn vsscanf "const char *str" "const char *format" "va_list ap"
+.Fn vsscanf "const char * restrict str" "const char * restrict format" "va_list ap"
.Ft int
-.Fn vfscanf "FILE *stream" "const char *format" "va_list ap"
+.Fn vfscanf "FILE * restrict stream" "const char * restrict format" "va_list ap"
.Sh DESCRIPTION
The
.Fn scanf
diff --git a/lib/libc/stdio/scanf.c b/lib/libc/stdio/scanf.c
index 990c9b0a7995..929c20b6d319 100644
--- a/lib/libc/stdio/scanf.c
+++ b/lib/libc/stdio/scanf.c
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
int
-scanf(char const *fmt, ...)
+scanf(char const * __restrict fmt, ...)
{
int ret;
va_list ap;
diff --git a/lib/libc/stdio/sscanf.c b/lib/libc/stdio/sscanf.c
index d98832605fc9..4db0d2963aff 100644
--- a/lib/libc/stdio/sscanf.c
+++ b/lib/libc/stdio/sscanf.c
@@ -59,7 +59,7 @@ eofread(cookie, buf, len)
}
int
-sscanf(const char *str, char const *fmt, ...)
+sscanf(const char * __restrict str, char const * __restrict fmt, ...)
{
int ret;
va_list ap;
diff --git a/lib/libc/stdio/vscanf.c b/lib/libc/stdio/vscanf.c
index 92f55fcee382..c3a4266d4cf0 100644
--- a/lib/libc/stdio/vscanf.c
+++ b/lib/libc/stdio/vscanf.c
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
int
vscanf(fmt, ap)
- const char *fmt;
+ const char * __restrict fmt;
__va_list ap;
{
int retval;
diff --git a/lib/libc/stdio/vsscanf.c b/lib/libc/stdio/vsscanf.c
index 81a241ca6e3d..40d494737b7d 100644
--- a/lib/libc/stdio/vsscanf.c
+++ b/lib/libc/stdio/vsscanf.c
@@ -60,8 +60,8 @@ eofread(cookie, buf, len)
int
vsscanf(str, fmt, ap)
- const char *str;
- const char *fmt;
+ const char * __restrict str;
+ const char * __restrict fmt;
__va_list ap;
{
FILE f;