int /* Lock a file region using nonblocking F_SETLK */ lockRegion(int fd, int type, int whence, int start, int len) { return lockReg(fd, F_SETLK, type, whence, start, len); }
int /* Lock a file region using blocking F_SETLKW */ lockRegionWait(int fd, int type, int whence, int start, int len) { return lockReg(fd, F_SETLKW, type, whence, start, len); }
/* Lock 'op' by locking its register(s) */ void lock(opdesc *op) { if (op->type != constop) lockReg(op->reg); if (op->type == indexop) lockReg(op->reg2); }