1 2 3 4 5 6 7 8 9 10 11 12
#include <u.h> #include <libc.h> #undef dup int p9dup(int old, int new) { if(new == -1) return dup(old); return dup2(old, new); }