Get usb/usbaudio and usb/usbmouse to work again. In usbmouse is the dependency on stdio.h removed, so it got 30Kb smaller on my dev machine. Reference: /n/sources/patch/applied/usbaudio-mouse-work Date: Fri Jan 20 15:40:49 CET 2006 --- /sys/src/cmd/usb/misc/usbmouse.c Fri Jan 20 15:40:11 2006 +++ /sys/src/cmd/usb/misc/usbmouse.c Fri Jan 20 15:40:07 2006 @@ -1,11 +1,10 @@ #include #include #include -#include int mousefd, ctlfd, mousein; -char hbm[] = "Enabled 0x020103\n"; +char hbm[] = "Enabled 0x020103"; char *mouseinfile = "/dev/mousein"; char *statfmt = "/dev/usb%d/%d/status"; char *ctlfmt = "/dev/usb%d/%d/ctl"; @@ -87,8 +86,7 @@ void threadmain(int argc, char *argv[]) { - FILE *f; - int ctlrno, i; + int ctlrno, i, sfd; char line[256]; ARGBEGIN{ @@ -112,17 +110,17 @@ case 0: for (ctlrno = 0; ctlrno < 16; ctlrno++) { for (i = 0; i < 128; i++) { - sprint(line, statfmt, ctlrno, i); - f = fopen(line, "r"); - if (f == nil) + snprint(line, sizeof line, statfmt, ctlrno, i); + sfd = open(line, OREAD); + if (sfd < 0) break; - if (fgets(line, sizeof line, f) && strcmp(hbm, line) == 0) { + if (read(sfd, line, strlen(hbm)) && strncmp(hbm, line, strlen(hbm)) == 0) { snprint(ctlfile, sizeof ctlfile, ctlfmt, ctlrno, i); snprint(msefile, sizeof msefile, msefmt, ctlrno, i); - fclose(f); + close(sfd); goto found; } - fclose(f); + close(sfd); } } threadexitsall("no mouse"); --- /sys/src/cmd/usb/audio/usbaudio.c Fri Jan 20 15:40:31 2006 +++ /sys/src/cmd/usb/audio/usbaudio.c Fri Jan 20 15:40:26 2006 @@ -16,7 +16,7 @@ Channel *controlchan; -char audstr[] = "Enabled 0x000101\n"; /* audio.control.0 */ +char audstr[] = "Enabled 0x000101"; /* audio.control.0 */ int defaultspeed[2] = {44100, 44100};