| plan 9 kernel history: overview | file list | diff list |
2002/0623/port/devcap.c (diff list | history)
| 2002/0622/sys/src/9/port/devcap.c:29,35 – 2002/0623/sys/src/9/port/devcap.c:29,34 (short | long | prev | next) | ||
| 2001/0527 | struct { QLock; | |
| 2002/0622/sys/src/9/port/devcap.c:41,53 – 2002/0623/sys/src/9/port/devcap.c:40,53 | ||
| 2001/0527 | Quse, }; | |
| 2002/0623 | /* caphash must be last */ | |
| 2001/0527 | Dirtab capdir[] = { ".", {Qdir,0,QTDIR}, 0, DMDIR|0500, | |
| 2002/0623 | "caphash", {Qhash}, 0, 0200, | |
| 2001/0527 | }; | |
| 2002/0623 | int ncapdir = nelem(capdir); | |
| 2001/0527 | static Chan* capattach(char *spec) | |
| 2002/0622/sys/src/9/port/devcap.c:58,70 – 2002/0623/sys/src/9/port/devcap.c:58,80 | ||
| 2001/0527 | static Walkqid* capwalk(Chan *c, Chan *nc, char **name, int nname) { | |
| 2002/0623 | return devwalk(c, nc, name, nname, capdir, ncapdir, devgen); | |
| 2001/0527 | } | |
| 2002/0623 | static void capremove(Chan *c) { if(iseve() && c->qid.path == Qhash) ncapdir = nelem(capdir)-1; else error(Eperm); } | |
| 2001/0527 | static int capstat(Chan *c, uchar *db, int n) { | |
| 2002/0623 | return devstat(c, db, n, capdir, ncapdir, devgen); | |
| 2001/0527 | } /* | |
| 2002/0622/sys/src/9/port/devcap.c:86,105 – 2002/0623/sys/src/9/port/devcap.c:96,108 | ||
| 2001/0527 | qunlock(&capalloc); nexterror(); } | |
| 2002/0622 | if(!iseve()) error(Eperm); | |
| 2001/0527 |
| |
| 2002/0622/sys/src/9/port/devcap.c:164,177 – 2002/0623/sys/src/9/port/devcap.c:167,174 | ||
| 2001/0527 | } static void | |
| 2002/0623 | capclose(Chan*) | |
| 2001/0527 | { | |
| 2002/0622/sys/src/9/port/devcap.c:179,185 – 2002/0623/sys/src/9/port/devcap.c:176,182 | ||
| 2001/0527 | { switch((ulong)c->qid.path){ case Qdir: | |
| 2002/0623 | return devdirread(c, va, n, capdir, ncapdir, devgen); | |
| 2001/0527 | default: error(Eperm); | |
| 2002/0622/sys/src/9/port/devcap.c:258,279 – 2002/0623/sys/src/9/port/devcap.c:255,276 | ||
| 2001/0527 | } Dev capdevtab = { | |
| 2002/0623 | .dc= L'¤', .name= "cap", | |
| 2001/0527 |
| |
| 2002/0109 |
| |
| 2001/0527 |
| |
| 2002/0623 | .reset= devreset, .init= devinit, .shutdown= devshutdown, .attach= capattach, .walk= capwalk, .stat= capstat, .open= capopen, .create= devcreate, .close= capclose, .read= capread, .bread= devbread, .write= capwrite, .bwrite= devbwrite, .remove= capremove, .wstat= devwstat, | |
| 2001/0527 | }; | |