protected final int syscall(int syscall, int a, int b, int c, int d, int e, int f) {
try {
int n = _syscall(syscall,a,b,c,d,e,f);
- //if(n < 0) System.err.println("syscall: " + syscall + " returned " + n);
+ //if(n<0) throw new ErrnoException(-n);
return n;
} catch(ErrnoException ex) {
+ //System.err.println("While executing syscall: " + syscall + ":");
+ //if(syscall == SYS_open) try { System.err.println("Failed to open " + cstring(a) + " errno " + ex.errno); } catch(Exception e2) { }
//ex.printStackTrace();
return -ex.errno;
} catch(FaultException ex) {
pos++; len--; pb = true;
}
int n = parent.read(buf,pos,len);
- if(n == -1) return -1;
+ if(n == -1) return pb ? 1 : -1;
for(int i=0;i<n;i++) {
if(buf[pos+i] == '\r') {
if(i==n-1) {