X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnestedvm%2FRuntime.java;h=6675d59c30d483e0d090c5f98f62ac7b97b31efe;hp=fd2b98518324d7a8442535d59160bdd0c9b85e41;hb=ae52817e5cb153f781b76f5d525e127f217b5482;hpb=c2b2704764af1ade923ba8f15d517b87f9d16189 diff --git a/src/org/ibex/nestedvm/Runtime.java b/src/org/ibex/nestedvm/Runtime.java index fd2b985..6675d59 100644 --- a/src/org/ibex/nestedvm/Runtime.java +++ b/src/org/ibex/nestedvm/Runtime.java @@ -626,6 +626,17 @@ public abstract class Runtime implements UsermodeConstants,Registers { fds[fdn] = null; return true; } + + /** Duplicates the file descriptor fdn and returns the new fs */ + public int dupFD(int fdn) { + int i; + if(fdn < 0 || fdn >= OPEN_MAX) return -1; + if(fds[fdn] == null) return -1; + for(i=0;i