about summary refs log tree commit diff homepage
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/POSIX/fd_32.c15
-rw-r--r--runtime/klee-libc/putchar.c5
2 files changed, 8 insertions, 12 deletions
diff --git a/runtime/POSIX/fd_32.c b/runtime/POSIX/fd_32.c
index f2f384fb..1e96de37 100644
--- a/runtime/POSIX/fd_32.c
+++ b/runtime/POSIX/fd_32.c
@@ -172,8 +172,7 @@ int __getdents(unsigned int fd, struct dirent *dirp, unsigned int count)
 
 /* Forward to 64 versions (uclibc expects versions w/o asm specifier) */
 
-int open64(const char *pathname, int flags, ...) __attribute__((weak));
-int open64(const char *pathname, int flags, ...) {
+__attribute__((weak)) int open64(const char *pathname, int flags, ...) {
   mode_t mode = 0;
 
   if (flags & O_CREAT) {
@@ -187,23 +186,19 @@ int open64(const char *pathname, int flags, ...) {
   return __fd_open(pathname, flags, mode);
 }
 
-off64_t lseek64(int fd, off64_t off, int whence) __attribute__((weak));
-off64_t lseek64(int fd, off64_t off, int whence) {
+__attribute__((weak)) off64_t lseek64(int fd, off64_t off, int whence) {
   return __fd_lseek(fd, off, whence);
 }
 
-int stat64(const char *path, struct stat64 *buf) __attribute__((weak));
-int stat64(const char *path, struct stat64 *buf) {
+__attribute__((weak)) int stat64(const char *path, struct stat64 *buf) {
   return __fd_stat(path, buf);
 }
 
-int lstat64(const char *path, struct stat64 *buf) __attribute__((weak));
-int lstat64(const char *path, struct stat64 *buf) {
+__attribute__((weak)) int lstat64(const char *path, struct stat64 *buf) {
   return __fd_lstat(path, buf);
 }
 
-int fstat64(int fd, struct stat64 *buf) __attribute__((weak));
-int fstat64(int fd, struct stat64 *buf) {
+__attribute__((weak)) int fstat64(int fd, struct stat64 *buf) {
   return __fd_fstat(fd, buf);
 }
 
diff --git a/runtime/klee-libc/putchar.c b/runtime/klee-libc/putchar.c
index 4c3a57e4..497402a6 100644
--- a/runtime/klee-libc/putchar.c
+++ b/runtime/klee-libc/putchar.c
@@ -15,6 +15,7 @@
 
 int putchar(int c) {
   char x = c;
-  write(1, &x, 1);
-  return 1;
+  if (1 == write(1, &x, 1))
+    return c;
+  return EOF;
 }