fix some unistd functions
authorbrian <brian@brianweb.net>
Tue, 19 Jun 2007 19:15:49 +0000 (12:15 -0700)
committerbrian <brian@brianweb.net>
Tue, 19 Jun 2007 19:15:49 +0000 (12:15 -0700)
darcs-hash:20070619191549-24bed-9364e771c510f60150b9d1bbccfefbd782dbaba6.gz

src/org/ibex/nestedvm/support_aux.c
upstream/Makefile
upstream/patches/newlib-unistd.patch [new file with mode: 0644]

index 54181e9..244ae16 100644 (file)
@@ -85,7 +85,7 @@ REENT_WRAPPER0(vfork)
 REENT_WRAPPER1(chroot,const char *)
 REENT_WRAPPER3(mknod,const char *,mode_t,dev_t)
 REENT_WRAPPER2(ftruncate,int,off_t)
-REENT_WRAPPER1(usleep,unsigned int)
+REENT_WRAPPER1R(usleep,unsigned int,unsigned int)
 REENT_WRAPPER2(mkfifo,const char *, mode_t)
 REENT_WRAPPER3(klogctl,int,char*,int)
 REENT_WRAPPER2R(realpath,char *,const char *,char *)
@@ -167,8 +167,9 @@ int _sysctl_r(struct _reent *ptr, int *name, int namelen, void *oldp, size_t *ol
     }
 }
 
-void sync() {
+int sync() {
     /* do nothing*/
+    return 0;
 }
 
 char *ttyname(int fd) {
index c029a0c..abbf3ab 100644 (file)
@@ -23,7 +23,7 @@ configure_binutils = --target=mips-unknown-elf
 
 version_newlib = 1.11.0
 url_newlib = ftp://sources.redhat.com/pub/newlib/newlib-$(version_newlib).tar.gz
-patches_newlib = newlib-mips.patch newlib-tzset.patch newlib-malloc.patch newlib-nomemcpy.patch newlib-unix.patch
+patches_newlib = newlib-mips.patch newlib-tzset.patch newlib-malloc.patch newlib-nomemcpy.patch newlib-unix.patch newlib-unistd.patch
 configure_newlib = --enable-multilib --target=mips-unknown-elf
 
 url_openbsdglob = http://www.brianweb.net/xwt/openbsdglob.tar.gz
diff --git a/upstream/patches/newlib-unistd.patch b/upstream/patches/newlib-unistd.patch
new file mode 100644 (file)
index 0000000..4bc0026
--- /dev/null
@@ -0,0 +1,28 @@
+--- newlib/libc/include/sys/unistd.h~  2007-06-19 15:04:20.000000000 -0400
++++ newlib/libc/include/sys/unistd.h   2007-06-19 15:04:20.000000000 -0400
+@@ -149,19 +149,20 @@
+ int   _EXFUN(getdtablesize, (void));
+ int   _EXFUN(setdtablesize, (int));
+ useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval));
+-unsigned _EXFUN(usleep, (unsigned int __useconds));
+-int     _EXFUN(ftruncate, (int __fd, off_t __length));
+-int     _EXFUN(truncate, (const char *, off_t __length));
+ #if !(defined  (_WINSOCK_H) || defined (__USE_W32_SOCKETS))
+ /* winsock[2].h defines as __stdcall, and with int as 2nd arg */
+  int  _EXFUN(gethostname, (char *__name, size_t __len));
+ #endif
+-char *        _EXFUN(mktemp, (char *));
+-int     _EXFUN(sync, (void));
+ #endif
+ int     _EXFUN(readlink, (const char *__path, char *__buf, int __buflen));
+ int     _EXFUN(symlink, (const char *__name1, const char *__name2));
++unsigned _EXFUN(usleep, (unsigned int __useconds));
++int     _EXFUN(ftruncate, (int __fd, off_t __length));
++int     _EXFUN(truncate, (const char *, off_t __length));
++char *        _EXFUN(mktemp, (char *));
++int     _EXFUN(sync, (void));
++
+ #define       F_OK    0
+ #define       R_OK    4
+ #define       W_OK    2