projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
if pthread_create fails, it must not attempt mmap if there is no mapping
[musl]
/
src
/
stdio
/
fwrite.c
diff --git
a/src/stdio/fwrite.c
b/src/stdio/fwrite.c
index
02908c4
..
d5f6542
100644
(file)
--- a/
src/stdio/fwrite.c
+++ b/
src/stdio/fwrite.c
@@
-1,6
+1,7
@@
#include "stdio_impl.h"
#include "stdio_impl.h"
+#include <string.h>
-size_t __fwritex(const unsigned char *
s, size_t l, FILE *
f)
+size_t __fwritex(const unsigned char *
restrict s, size_t l, FILE *restrict
f)
{
size_t i=0;
{
size_t i=0;
@@
-24,14
+25,14
@@
size_t __fwritex(const unsigned char *s, size_t l, FILE *f)
return l+i;
}
return l+i;
}
-size_t fwrite(const void *
src, size_t size, size_t nmemb, FILE *
f)
+size_t fwrite(const void *
restrict src, size_t size, size_t nmemb, FILE *restrict
f)
{
size_t k, l = size*nmemb;
if (!l) return l;
FLOCK(f);
k = __fwritex(src, l, f);
FUNLOCK(f);
{
size_t k, l = size*nmemb;
if (!l) return l;
FLOCK(f);
k = __fwritex(src, l, f);
FUNLOCK(f);
- return k==l ? nmemb :
l
/size;
+ return k==l ? nmemb :
k
/size;
}
weak_alias(fwrite, fwrite_unlocked);
}
weak_alias(fwrite, fwrite_unlocked);