
New patches:

[unrevert
anonymous**20070107161456] 
<
> {
hunk ./src/org/ibex/nestedvm/Runtime.java 1051
         }
     }
 
+    final int fsync(int fdn) {
+        if(fdn < 0 || fdn >= OPEN_MAX) return -EBADFD;
+        if(fds[fdn] == null) return -EBADFD;
+        FD fd = fds[fdn];
+
+        Seekable s = fd.seekable();
+        if (s == null) return -EINVAL;
+
+        try {
+            s.sync();
+            return 0;
+        } catch (IOException e) {
+            return -EIO;
+        }
+    }
+
     /** The syscall dispatcher.
         The should be called by subclasses when the syscall instruction is invoked.
         <i>syscall</i> should be the contents of V0 and <i>a</i>, <i>b</i>, <i>c</i>, and <i>d</i> should be 
hunk ./src/org/ibex/nestedvm/Runtime.java 1116
             case SYS_getgid: return sys_getgid();
             case SYS_getegid: return sys_getegid();
             
+            case SYS_fsync: return fsync(a);
             case SYS_memcpy: memcpy(a,b,c); return a;
             case SYS_memset: memset(a,b,c); return a;
 
hunk ./src/org/ibex/nestedvm/UsermodeConstants.java 93
     public static final int SYS_setgroups = 88;
     public static final int SYS_resolve_ip = 89;
     public static final int SYS_setsid = 90;
+    public static final int SYS_fsync = 91;
     public static final int AF_UNIX = 1;
     public static final int AF_INET = 2;
     public static final int SOCK_STREAM = 1;
hunk ./src/org/ibex/nestedvm/support.s 198
 SYSCALL_R(getgroups)
 SYSCALL_R(setsid)
 SYSCALL_R2(__resolve_ip_r,SYS_resolve_ip)
+SYSCALL_R(fsync)
hunk ./src/org/ibex/nestedvm/support_aux.c 120
 REENT_WRAPPER1(setegid,gid_t)
 REENT_WRAPPER2(setgroups,int,const gid_t *)
 REENT_WRAPPER0R(setsid,pid_t)
+REENT_WRAPPER1(fsync,int)
 
 extern int __execve_r(struct _reent *ptr, const char *path, char *const argv[], char *const envp[]);
 int _execve(const char *path, char *const argv[], char *const envp[]) {
hunk ./src/org/ibex/nestedvm/support_aux.c 173
 void sync() {
     /* do nothing*/
 }
-
-int fsync(int fd) {
-    /* do nothing */
-    return 0;
-}
 
 char *ttyname(int fd) {
     return isatty(fd) ? "/dev/console" : NULL;
hunk ./src/org/ibex/nestedvm/syscalls.h 88
 #define SYS_setgroups 88
 #define SYS_resolve_ip 89
 #define SYS_setsid 90
+#define SYS_fsync 91
hunk ./src/org/ibex/nestedvm/util/Seekable.java 17
     public abstract void close() throws IOException;
     public abstract int pos() throws IOException;
 
+    public void sync() throws IOException {
+        throw new IOException("sync not implemented for " + getClass());
+    }
     public void resize(long length) throws IOException {
         throw new IOException("resize not implemented for " + getClass());
     }
hunk ./src/org/ibex/nestedvm/util/Seekable.java 96
         
         public int read(byte[] buf, int offset, int length) throws IOException { return raf.read(buf,offset,length); }
         public int write(byte[] buf, int offset, int length) throws IOException { raf.write(buf,offset,length); return length; }
+        public void sync() throws IOException { raf.getFD().sync(); }
         public void seek(int pos) throws IOException{ raf.seek(pos); }
         public int pos()  throws IOException { return (int) raf.getFilePointer(); }
         public int length() throws IOException { return (int)raf.length(); }
}

Context:

[abstract RandomAccessFile.setLength() for Jdk11 support
David Crawshaw <david@zentus.com>**20061217184852] 
[add push target to makefile
Brian Alliet <brian@brianweb.net>**20061216042335] 
[fix fortran breakage in gcc 3.3.6
Brian Alliet <brian@brianweb.net>**20061216035100] 
[updgrade to gcc 3.3.6
Brian Alliet <brian@brianweb.net>**20061216030953] 
[conflict resolution
brian@brianweb.net**20061216004915] 
[update upstream source locations
David Crawshaw <david@zentus.com>**20061114203054] 
[added zlib and expat targets
adam@megacz.com**20061021033045] 
[updated regex library download location
adam@megacz.com**20061021010104] 
[update newlib url
adam@megacz.com**20061013232730] 
[updated download URLs
adam@megacz.com**20060529172248] 
[fixed up Makefile to make emacs happy, updated download locations
adam@megacz.com**20050809025518] 
[moving locking code into UnixRuntime and use GlobalScope to track extra-process locks
David Crawshaw <david@zentus.com>**20061208032530] 
[add stop()
David Crawshaw <david@zentus.com>**20061127095314] 
[support utf-8 strings
David Crawshaw <david@zentus.com>**20061122210557] 
[mark env.sh executable
David Crawshaw <david@zentus.com>**20061122210439] 
[import classgen's Sort utility class, better to replicate 20 lines of quicksort than make a mess of the build process
David Crawshaw <david@zentus.com>**20061120064432] 
[close all fcntl locks when a file descriptor for the file is closed (braindead interface)
David Crawshaw <david@zentus.com>**20061118050457] 
[support F_SETLK / F_GETLK commands in the fcntl() syscall
David Crawshaw <david@zentus.com>**20061118020751] 
[add ftruncate() syscall
David Crawshaw <david@zentus.com>**20061118015608] 
[make lookupSymbol() publicly accessible
David Crawshaw <david@zentus.com>**20061118050653] 
[have cstring() return null if passed a null pointer
David Crawshaw <david@zentus.com>**20061118020959] 
[fix makefile for new gcclass
brian@brianweb.net**20060824033149] 
[allow access to every "root" on the host fs (ie other drives on windows)
brian@brianweb.net**20060527033730] 
[fix minor bug in Win32ConsoleIS
brian@brianweb.net**20060527033636] 
[add Platform.listRoots()
brian@brianweb.net**20060527033521] 
[automatically set gp register
brian@brianweb.net**20060522080305] 
[remove win32 debuggin
brian@brianweb.net**20051215024030] 
[finally do win32 paths right
brian@brianweb.net**20051215023846] 
[set TMPDIR
brian@brianweb.net**20051215020837] 
[remove debugging stuff
brian@brianweb.net**20051215020628] 
[fix md5sum again
brian@brianweb.net**20051215010024] 
[fix upstream urls
Brian Alliet <brian@brianweb.net>**20051214221225] 
[typo in check.sh
brian@brianweb.net**20051215004613] 
[target 1.3 vms
brian@brianweb.net**20051215000955] 
[ResourceFS
brian@brianweb.net**20051215000908] 
[find a gnu md5sum
brian@brianweb.net**20051215000852] 
[update for new classgen api
brian@brianweb.net**20051215000820] 
[better handling of alignment errors
brian@brianweb.net**20051214072203] 
[build jdk1.3 classes
brian@brianweb.net**20051214072148] 
[build unix_runtime.jar
brian@brianweb.net**20051214072136] 
[add gmp to makefile
brian@brianweb.net**20051115030330] 
[update nestedvm for new classgen api again
brian@brianweb.net**20050703011027] 
[harmonize nestedvm and latest classgen changes
adam@megacz.com*-20050702085205] 
[harmonize nestedvm and latest classgen changes
adam@megacz.com**20050702085205] 
[licensing update to APSL 2.0
adam@megacz.com**20050104224512] 
[update nestedvm for the new classgen api
brian@brianweb.net**20050607090316] 
[new filesystem stuff
brian@brianweb.net**20050607082829] 
[getuser
brian@brianweb.net**20040804115237] 
[cleanup elf stuff
brian@brianweb.net**20040804115158] 
[include sourcename in runtime compiled binaries, more gc friendly runtime compiler
brian@brianweb.net**20040804115124] 
[more syscall stubs
brian@brianweb.net**20040804115011] 
[bug in getParentFile()
brian@brianweb.net**20040804114945] 
[few more syscalls
brian@brianweb.net**20040804092814] 
[fix for really stupid O_EXCL bug
brian@brianweb.net**20040804092740] 
[fix amd64 bug in gcc
brian@brianweb.net**20040716195839] 
[gcclass hints (YOU NEED TO UPDATE upstream/build/gcclass)
brian@brianweb.net**20040701085322] 
[remove bash dependency2
brian@brianweb.net**20040701065320] 
[remove bash dependency
brian@brianweb.net**20040701064944] 
[gcclass dep problem
brian@brianweb.net**20040701064548] 
[ntlmauth.jar
brian@brianweb.net**20040701064413] 
[exec() cleanup
brian@brianweb.net**20040701064347] 
[upstream dep fix
brian@brianweb.net**20040701041507] 
[samba in makefile
brian@brianweb.net**20040701011505] 
[newlib unix patch
brian@brianweb.net**20040701011433] 
[use newlib/libc/unix
brian@brianweb.net**20040701011348] 
[more socket stuff
brian@brianweb.net**20040701011220] 
[move all security policy stuff out of userspace
brian@brianweb.net**20040701010812] 
[misc makefile fixes
brian@brianweb.net**20040701010353] 
[no debug flag
brian@brianweb.net**20040701010329] 
[sanity checks before extraction fix
brian@brianweb.net**20040628063552] 
[sanity checks before extraction
brian@brianweb.net**20040628062144] 
[udp support
brian@brianweb.net**20040609001319] 
[one more round of fixes and cleanup
brian@brianweb.net**20040605102726] 
[prettier sigsegv error
brian@brianweb.net**20040605090511] 
[cleanup, more efficient exec, better win32 support
brian@brianweb.net**20040605090220] 
[make nestedvm work under SableVM
brian@brianweb.net**20040604225343] 
[-d option, classfilecompiler cleanu
brian@brianweb.net**20040604000504] 
[single-float
brian@brianweb.net**20040601102234] 
[cut down the public interface of compiler
brian@brianweb.net**20040601013357] 
[got a hotel
brian@brianweb.net**20040601010501] 
[prememread(true) for S*
brian@brianweb.net**20040601010438] 
[inttofloatbits typo
brian@brianweb.net**20040601010415] 
[lessconstants support for classfilecompiler
brian@brianweb.net**20040601010331] 
[cleanup runtime compiler, auto lessconstants
brian@brianweb.net**20040601010218] 
[nextedvm typo
brian@brianweb.net**20040601010144] 
[makefile darcs wget fix
brian@brianweb.net**20040601010128] 
[my backup dns provider sucks
brian@brianweb.net**20040528203745] 
[cygwin build fixes
brian@brianweb.net**20040528190842] 
[bugfix for jumpable delay slot
brian@brianweb.net**20040528164201] 
[wget fallback for darcs
brian@brianweb.net**20040528041654] 
[use option unixruntime for runtime compiler
brian@brianweb.net**20040527142606] 
[size check
brian@brianweb.net**20040527142532] 
[fixed more fixmes/features
brian@brianweb.net**20040527084132] 
[new classgen part 3
brian@brianweb.net**20040527070021] 
[misc test changes
brian@brianweb.net**20040527065902] 
[new classgen part 2
brian@brianweb.net**20040527065620] 
[new classgen part 1
brian@brianweb.net**20040527065321] 
[implement truncate and fstat better
brian@brianweb.net**20040527044444] 
[add generic speed test
brian@brianweb.net**20040527023643] 
[more features
brian@brianweb.net**20040525045147] 
[implement util.Sort
brian@brianweb.net**20040524031340] 
[devfs fixes
brian@brianweb.net**20040524031302] 
[jdk 1.1 part 3
brian@brianweb.net**20040523225556] 
[dependency fix for build_libc in makefile
brian@brianweb.net**20040523225257] 
[fix indentation
brian@brianweb.net**20040523225119] 
[F_DUPFD fix (incorrect return value)
brian@brianweb.net**20040523225048] 
[make jdk 1.1 compliant part 2
brian@brianweb.net**20040523081744] 
[make jdk 1.1 compliant part 1
brian@brianweb.net**20040523081502] 
[split gcclass into extract/build
brian@brianweb.net*-20040522024849] 
[yet more solaris brokenness
brian@brianweb.net**20040522025723] 
[split gcclass into extract/build
brian@brianweb.net**20040522024849] 
[solaris sucks
brian@brianweb.net**20040522023905] 
[add tex.ch
brian@brianweb.net**20040521113127] 
[no GCC_FOR_TARGET
brian@brianweb.net**20040521112501] 
[no -Werror for upstream
brian@brianweb.net**20040521111400] 
[type in makefile.upstream
brian@brianweb.net**20040521110214] 
[no -Werror for busybox
brian@brianweb.net**20040521110059] 
[fix gcc urls
brian@brianweb.net**20040521105711] 
[cflags mixup
brian@brianweb.net**20040521105111] 
[add pascalhello.pas
brian@brianweb.net**20040521103622] 
[major TeX cleanup
brian@brianweb.net**20040521095250] 
[yet more conflict resolution
brian@brianweb.net**20040521085604] 
[more conflict resolution
brian@brianweb.net**20040521085340] 
[move extra headers
brian@brianweb.net**20040521085104] 
[horrendous hack for TeX... Brian, please forgive me
adam@megacz.com*-20040514081342] 
[horrendous hack for TeX... Brian, please forgive me
adam@megacz.com**20040514081342] 
[build TeX, use it to compile paper
adam@megacz.com**20040514081324] 
[added linpack benchmark
adam@megacz.com*-20040511064820] 
[added linpack benchmark
adam@megacz.com**20040511064820] 
[filename trimming for TeX
adam@megacz.com**20040514081307] 
[add fancy NesTeX banner to TeX
adam@megacz.com**20040514081252] 
[added tex stuff
adam@megacz.com**20040514004423] 
[added TeX target
adam@megacz.com**20040511064237] 
[bugfix on pathnames
adam@megacz.com*-20040511064221] 
[bugfix on pathnames
adam@megacz.com**20040511064221] 
[remove memcpy/memset due to double-definition problem
adam@megacz.com*-20040511054647] 
[remove memcpy/memset due to double-definition problem
adam@megacz.com**20040511054647] 
[switch to gcc 3.3.0, add gpc and g77 fortran
adam@megacz.com**20040511054612] 
[%.o should not depend on full_toolchain
adam@megacz.com*-20040510114823] 
[%.o should not depend on full_toolchain
adam@megacz.com**20040510114823] 
[clobber GCC_FOR_TARGET; this should solve the specs issue / UNTESTED
adam@megacz.com*-20040510112640] 
[clobber GCC_FOR_TARGET; this should solve the specs issue / UNTESTED
adam@megacz.com**20040510112640] 
[conflict resolution
brian@brianweb.net**20040521080441] 
[dump specs before pass2
adam@megacz.com**20040510112111] 
[gpc support
brian@brianweb.net**20040521072746] 
[linpack conflict resolution
brian@brianweb.net**20040521052917] 
[remove pdftex-specific stuff from paper
adam@megacz.com**20040514081207] 
[size chart fix
brian@brianweb.net**20040512040057] 
[added tex.jar target
adam@megacz.com**20040512021519] 
[added more charts
adam@megacz.com**20040512021305] 
[final revision
adam@megacz.com**20040511133448] 
[more fixups
adam@megacz.com**20040511125538] 
[linpack chart (char11)
brian@brianweb.net**20040511121127] 
[switch charts to gnuplot
adam@megacz.com**20040511115846] 
[charts
brian@brianweb.net**20040511114951] 
[reordered sections
adam@megacz.com**20040511112054] 
[mad amounts of document changes
adam@megacz.com**20040511104202] 
[lots of document revisions
adam@megacz.com**20040511095318] 
[added gnuplots
adam@megacz.com**20040511090115] 
[added revewier comments, brians notes, and new charts
adam@megacz.com**20040511075509] 
[documentation updates
adam@megacz.com**20040511075116] 
[conflict merge
adam@megacz.com**20040510042147] 
[TAG merge
adam@megacz.com**20040510035456] 
[conflict merge
adam@megacz.com**20040510035047] 
[conflict resolution
adam@megacz.com**20040510024853] 
[merged Brian and Adams changes
xwt@xwt.org**20040505102459] 
[upstream dep fixes
brian@brianweb.net**20040521043846] 
[no binutils builtin linker script
brian@brianweb.net**20040521032845] 
[more newlib patches
brian@brianweb.net**20040521025651] 
[cleaner gcc build process
brian@brianweb.net**20040521025344] 
[chdir bug
brian@brianweb.net**20040521021850] 
[use nestedvm.busyboxhack in busyboxtest
brian@brianweb.net**20040521021806] 
[update classfilecompiler for new syscall method
brian@brianweb.net**20040521015913] 
[misc cleanup
brian@brianweb.net**20040520123648] 
[uname/sysctl support
brian@brianweb.net**20040520123615] 
[better networking support
brian@brianweb.net**20040520123314] 
[ABS.X fix
brian@brianweb.net**20040512040836] 
[speedtest updates
brian@brianweb.net**20040512040822] 
[g77/linpack
brian@brianweb.net**20040512040755] 
[inputoutputstream fd fix
brian@brianweb.net**20040512040718] 
[verify problem in lookupSymbol
brian@brianweb.net**20040512040510] 
[fp fixes
brian@brianweb.net**20040511073648] 
[socket support
brian@brianweb.net**20040510103136] 
[build runtime.jar correctly
brian@brianweb.net**20040510085642] 
[compiler off by one error
brian@brianweb.net**20040510085620] 
[fix newlib breakage
brian@brianweb.net**20040510031904] 
[compact runtime jar
brian@brianweb.net**20040509085310] 
[speed improvments
brian@brianweb.net**20040509085246] 
[cleanup
brian@brianweb.net**20040509085137] 
[win32 console support
brian@brianweb.net**20040508073132] 
[fork/waitpid leak
brian@brianweb.net**20040508073029] 
[new busybox
brian@brianweb.net**20040508072947] 
[new syscall stubs
brian@brianweb.net**20040508072830] 
[jar build fixes
brian@brianweb.net**20040508072725] 
[fix last few bugs preventing gcc from working
brian@brianweb.net**20040507011512] 
[test.c stuff
brian@brianweb.net**20040507011435] 
[appease darcs
brian@brianweb.net**20040505174643] 
[test.c stuff
brian@brianweb.net**20040505174515] 
[more updates for gcc
brian@brianweb.net**20040505174428] 
[interpreter fixes
brian@brianweb.net**20040505174250] 
[fix sltiu
brian@brianweb.net**20040505173540] 
[gcc's cc1 runs!
brian@brianweb.net**20040505043013] 
[more syscalls for gcc
brian@brianweb.net**20040505032948] 
[de-eclipseify
brian@brianweb.net**20040505030857] 
[no more fixmes
brian@brianweb.net**20040505023211] 
[make plain old gcc -o foo foo.c work
brian@brianweb.net**20040505023133] 
[added inodecache
brian@brianweb.net**20040505010557] 
[even more fixmes/features
brian@brianweb.net**20040504080413] 
[fix more fixmes/features
brian@brianweb.net**20040503190908] 
[runtimecompiler
brian@brianweb.net**20040503064629] 
[tons of stuff
brian@brianweb.net**20040503064240] 
[more preliminary exec() stuff
brian@brianweb.net**20040424065333] 
[Exec support and cleanup
brian@brianweb.net**20040423073515
 tons of cleanup
 partial exec() support
 
] 
[compile fix
brian@brianweb.net**20040421035727] 
[new fs stuff
brian@brianweb.net**20040421035219] 
[cleanup callJava
brian@brianweb.net**20040417010848] 
[src/tests cleanup
brian@brianweb.net**20040417003411] 
[more xwt -> ibex cleanup
brian@brianweb.net**20040417002658] 
[kill xwt dir
brian@brianweb.net**20040416235632] 
[org.xwt.mips -> org.ibex.nestedvm
brian@brianweb.net**20040416235406] 
[get rid of useless main() func
brian@brianweb.net**20040414172747] 
[eliminated dependency between UnixRuntime and Interpreter
adam@megacz.com**20040414083452] 
[misc cleanup3
brian@brianweb.net**20040414172106] 
[misc cleanup2
brian@brianweb.net**20040414172057] 
[misc cleanup
brian@brianweb.net**20040414172034] 
[env.sh fix
brian@brianweb.net**20040414023552] 
[fix Adam's UsermodeConstants breakage
brian@brianweb.net**20040413202835] 
[added UsermodeConstants.java to src/; make sure to regenerate when needed
adam@megacz.com**20040411230542] 
[usr variable for build process
brian@brianweb.net**20040404212715] 
[bcel fix
brian@brianweb.net**20040401050148] 
[lgpl
brian@brianweb.net**20040331000919] 
[sync with my cvs
brian@brianweb.net**20040330234809] 
[more changes
brian@brianweb.net**20040320035018] 
[corrections
brian@brianweb.net**20040319023858] 
[more updates
brian@brianweb.net**20040319012622] 
[tableswitch code
brian@brianweb.net**20040318224946] 
[updates
brian@brianweb.net**20040317193045] 
[paper
adam@megacz.com**20040316101654] 
[imported brians code
adam@megacz.com**20040316021757] 
[resolve conflicts
adam@megacz.com**20040316020322] 
[Brians changes directly to mips2java.tex
adam@megacz.com**20040316020241] 
[integrated Brians comments on ivme paper
adam@megacz.com**20040316015533] 
[import
adam@megacz.com**20040310075241] 
Patch bundle hash:
3f11080e1cd7ef73a7259fc22f943d84b9efe01f
