closescsi(2) is documented in the manpage but not in the header or source. Perhaps it was missed when the code was written, or removed when the thread locking was added? -Steve Notes: Fri Feb 3 08:57:33 EST 2006 rsc There is no record of closescsi ever existing. I'm pretty sure the locking was there from day 1. I may well have written the man page first (I often do that for new libraries to plan them out) and then simply forgotten to implement it. Thanks. I took the locking out, by the way, as it's insufficient. If there is any contention for s at the time you're calling closescsi, you have problems. Reference: /n/sources/patch/applied/closescsi Date: Thu Feb 2 19:55:48 CET 2006 Reviewed-by: rsc --- /sys/include/disk.h Thu Feb 2 19:52:25 2006 +++ /sys/include/disk.h Thu Feb 2 19:52:23 2006 @@ -21,6 +21,7 @@ int scsicmd(Scsi*, uchar*, int, void*, int, int); int scsi(Scsi*, uchar*, int, void*, int, int); Scsi* openscsi(char*); +void closescsi(Scsi*); int scsiready(Scsi*); extern int scsiverbose; --- /sys/src/libdisk/scsi.c Thu Feb 2 19:52:38 2006 +++ /sys/src/libdisk/scsi.c Thu Feb 2 19:52:35 2006 @@ -324,3 +324,13 @@ return s; } + +void +closescsi(Scsi *s) +{ + qlock(s); + close(s->rawfd); + free(s->inquire); + qunlock(s); + free(s); +}