Index: g_gate.c =================================================================== RCS file: /private/FreeBSD/src/sys/geom/gate/g_gate.c,v retrieving revision 1.12 diff -u -p -r1.12 g_gate.c --- g_gate.c 2 Oct 2004 15:03:26 -0000 1.12 +++ g_gate.c 2 Oct 2004 16:38:19 -0000 @@ -497,6 +497,11 @@ g_gate_ioctl(struct cdev *dev, u_long cm bp = bioq_first(&sc->sc_inqueue); if (bp != NULL) break; + if ((ggio->gctl_flags & G_GATE_IOFLAG_NONBLOCK) != 0) { + g_gate_release(sc); + ggio->gctl_error = EAGAIN; + return (0); + } if (msleep(sc, &sc->sc_inqueue_mtx, PPAUSE | PDROP | PCATCH, "ggwait", 0) != 0) { g_gate_release(sc); Index: g_gate.h =================================================================== RCS file: /private/FreeBSD/src/sys/geom/gate/g_gate.h,v retrieving revision 1.3 diff -u -p -r1.3 g_gate.h --- g_gate.h 3 May 2004 21:02:02 -0000 1.3 +++ g_gate.h 2 Oct 2004 16:36:35 -0000 @@ -41,7 +41,7 @@ #define G_GATE_MOD_NAME "ggate" #define G_GATE_CTL_NAME "ggctl" -#define G_GATE_VERSION 0 +#define G_GATE_VERSION 1 /* * Maximum number of request that can be stored in @@ -61,6 +61,8 @@ #define G_GATE_INFOSIZE 2048 +#define G_GATE_IOFLAG_NONBLOCK 0x0001 + #ifdef _KERNEL /* * 'P:' means 'Protected by'. @@ -138,6 +140,7 @@ struct g_gate_ctl_io { off_t gctl_offset; off_t gctl_length; void *gctl_data; + u_int gctl_flags; int gctl_error; }; #endif /* !_G_GATE_H_ */