X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnestedvm%2FRuntime.java;h=e909b81396fdaad7b24901492c83be0d072b5c1c;hb=e31fa57da728fa1c76760af23e62bd312a50e4df;hp=106569343e2346e2c748cbbeb2079c24a6109202;hpb=e49a5ccd0391ce6827e5d90858719c13e25b9e82;p=nestedvm.git diff --git a/src/org/ibex/nestedvm/Runtime.java b/src/org/ibex/nestedvm/Runtime.java index 1065693..e909b81 100644 --- a/src/org/ibex/nestedvm/Runtime.java +++ b/src/org/ibex/nestedvm/Runtime.java @@ -1,3 +1,7 @@ +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the Apache Public Source License 2.0 ("the License"). +// You may not use this file except in compliance with the License. + // Copyright 2003 Brian Alliet // Based on org.xwt.imp.MIPS by Adam Megacz // Portions Copyright 2003 Adam Megacz @@ -727,7 +731,6 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable { if((flags & ~(3|O_CREAT|O_EXCL|O_APPEND|O_TRUNC)) != 0) { if(STDERR_DIAG) System.err.println("WARNING: Unsupported flags passed to open(\"" + f + "\"): " + toHex(flags & ~(3|O_CREAT|O_EXCL|O_APPEND|O_TRUNC))); - throw new ErrnoException(ENOTSUP); } boolean write = (flags&3) != RD_ONLY; @@ -736,7 +739,7 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable { if((flags & (O_EXCL|O_CREAT)) == (O_EXCL|O_CREAT)) { try { - if(Platform.atomicCreateFile(f)) throw new ErrnoException(EEXIST); + if(!Platform.atomicCreateFile(f)) throw new ErrnoException(EEXIST); } catch(IOException e) { throw new ErrnoException(EIO); } @@ -1019,7 +1022,7 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable { return -ENOSYS; } } - + /** The syscall dispatcher. The should be called by subclasses when the syscall instruction is invoked. syscall should be the contents of V0 and a, b, c, and d should be