| plan 9 kernel history: overview | file list | diff list |
1992/0620/port/chan.c (diff list | history)
| 1992/0619/sys/src/9/port/chan.c:5,13 – 1992/0620/sys/src/9/port/chan.c:5,15 (short | long | prev | next) | ||
| 1990/0227 | #include "fns.h" | |
| 1992/0111 | #include "../port/error.h" | |
| 1990/0227 |
| |
| 1992/0620 | struct { | |
| 1990/0227 | Lock; Chan *free; | |
| 1992/0620 | int fid; | |
| 1990/0227 | }chanalloc; int | |
| 1992/0619/sys/src/9/port/chan.c:38,59 – 1992/0620/sys/src/9/port/chan.c:40,45 | ||
| 1990/0227 | } void | |
| 1992/0619/sys/src/9/port/chan.c:75,104 – 1992/0620/sys/src/9/port/chan.c:61,96 | ||
| 1990/0227 | newchan(void) { Chan *c; | |
| 1992/0620 | int nfid; | |
| 1990/0227 | ||
| 1991/1011 |
| |
| 1991/1206 |
| |
| 1991/1011 |
| |
| 1990/0227 |
| |
| 1991/1011 |
| |
| 1992/0620 | SET(nfid); lock(&chanalloc); c = chanalloc.free; if(c) chanalloc.free = c->next; else nfid = ++chanalloc.fid; unlock(&chanalloc); if(c == 0) { c = smalloc(sizeof(Chan)); c->fid = nfid; | |
| 1990/0227 | } | |
| 1992/0520 |
| |
| 1992/0620 | /* if you get an error before associating with a dev, close calls rootclose, a nop */ c->type = 0; c->flag = 0; c->ref = 1; c->dev = 0; c->offset = 0; c->mnt = 0; c->stream = 0; c->aux = 0; c->mchan = 0; c->mqid = (Qid){0, 0}; return c; | |
| 1990/0227 | } void | |