aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2004-06-08 06:55:04 +0000
committerH. Peter Anvin <hpa@zytor.com>2004-06-08 06:55:04 +0000
commitc74f1dd23ed4018dea4a6f1bccf7dc7e7bde5c63 (patch)
tree29fb5f9606b56069c35634970eb90c600a17d4b8
parente65529d215db51b7ff7b567e03292a2311a1836a (diff)
downloadklibc-c74f1dd23ed4018dea4a6f1bccf7dc7e7bde5c63.tar.gz
Wrap open prototype to open.c doesn't go weirdklibc-0.129
-rw-r--r--include/fcntl.h2
-rw-r--r--include/unistd.h2
-rw-r--r--klibc/include/fcntl.h2
-rw-r--r--klibc/include/unistd.h2
-rw-r--r--klibc/open.c1
-rw-r--r--klibc/strerror.c6
6 files changed, 12 insertions, 3 deletions
diff --git a/include/fcntl.h b/include/fcntl.h
index c0f2a01bc4c5c..b9336abdc4a11 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -13,6 +13,8 @@
/* This is defined here as well as in <unistd.h> since old-style code
would still include <fcntl.h> when using open(), and open() being
a varadic function changes its calling convention on some architectures. */
+#ifndef _KLIBC_IN_OPEN_C
__extern int open(const char *, int, ...);
+#endif
#endif /* _FCNTL_H */
diff --git a/include/unistd.h b/include/unistd.h
index 99341a5ee03c2..f00c402717b2c 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -78,7 +78,9 @@ __extern int sync(void);
__extern ssize_t read(int, void *, size_t);
__extern ssize_t write(int, const void *, size_t);
/* Also in <fcntl.h> */
+#ifndef _KLIBC_IN_OPEN_C
__extern int open(const char *, int, ...);
+#endif
__extern int close(int);
__extern off_t lseek(int, off_t, int);
/* off_t is 64 bits now even on 32-bit platforms; see llseek.c */
diff --git a/klibc/include/fcntl.h b/klibc/include/fcntl.h
index c0f2a01bc4c5c..b9336abdc4a11 100644
--- a/klibc/include/fcntl.h
+++ b/klibc/include/fcntl.h
@@ -13,6 +13,8 @@
/* This is defined here as well as in <unistd.h> since old-style code
would still include <fcntl.h> when using open(), and open() being
a varadic function changes its calling convention on some architectures. */
+#ifndef _KLIBC_IN_OPEN_C
__extern int open(const char *, int, ...);
+#endif
#endif /* _FCNTL_H */
diff --git a/klibc/include/unistd.h b/klibc/include/unistd.h
index 99341a5ee03c2..f00c402717b2c 100644
--- a/klibc/include/unistd.h
+++ b/klibc/include/unistd.h
@@ -78,7 +78,9 @@ __extern int sync(void);
__extern ssize_t read(int, void *, size_t);
__extern ssize_t write(int, const void *, size_t);
/* Also in <fcntl.h> */
+#ifndef _KLIBC_IN_OPEN_C
__extern int open(const char *, int, ...);
+#endif
__extern int close(int);
__extern off_t lseek(int, off_t, int);
/* off_t is 64 bits now even on 32-bit platforms; see llseek.c */
diff --git a/klibc/open.c b/klibc/open.c
index e1d12336ce411..d52b53a6992af 100644
--- a/klibc/open.c
+++ b/klibc/open.c
@@ -5,6 +5,7 @@
* system call, to indicate that we're 64-bit safe.
*/
+#define _KLIBC_IN_OPEN_C
#include <unistd.h>
#include <fcntl.h>
diff --git a/klibc/strerror.c b/klibc/strerror.c
index af13533ad8cc5..bc053dbca9eb0 100644
--- a/klibc/strerror.c
+++ b/klibc/strerror.c
@@ -16,9 +16,9 @@ char *strerror(int errnum)
*--p = '\0';
do {
- *--p = (errnum % 10) + '0';
- errnum /= 10;
- } while ( errnum );
+ *--p = (e % 10) + '0';
+ e /= 10;
+ } while ( e );
memcpy(message+6, p, (numbuf+sizeof numbuf)-p);