+ obits[0] = obits[1] = obits[2] = 0;
+ if (uap->nd > NOFILE)
+ uap->nd = NOFILE; /* forgiving, if slightly wrong */
+
+#define getbits(name, x) \
+ if (uap->name) { \
+ u.u_error = copyin((caddr_t)uap->name, (caddr_t)&ibits[x], \
+ sizeof (ibits[x])); \
+ if (u.u_error) \
+ goto done; \
+ } else \
+ ibits[x] = 0;
+ getbits(in, 0);
+ getbits(ou, 1);
+ getbits(ex, 2);
+#undef getbits
+