| plan 9 kernel history: overview | file list | diff list |
1990/0820/port/chan.c (diff list | history)
| 1990/08141/sys/src/9/port/chan.c:340,346 – 1990/0820/sys/src/9/port/chan.c:340,346 (short | long | prev | next) | ||
| 1990/0227 | goto Notfound; } if(c->mountid != mnt->mountid){ | |
| 1990/0321 |
| |
| 1990/0820 | pprint("walk: changed underfoot? '%s'\n", name); | |
| 1990/0227 | unlock(pg); goto Notfound; } | |
| 1990/08141/sys/src/9/port/chan.c:431,442 – 1990/0820/sys/src/9/port/chan.c:431,443 | ||
| 1990/0227 | { Chan *c, *nc; int t; | |
| 1990/0820 | int mntok, isdot; | |
| 1990/0227 | char *elem = u->elem; if(name[0] == 0) error(0, Enonexist); mntok = 1; | |
| 1990/0820 | isdot = 0; | |
| 1990/0227 | if(name[0] == '/'){ c = clone(u->slash, 0); /* | |
| 1990/08141/sys/src/9/port/chan.c:459,466 – 1990/0820/sys/src/9/port/chan.c:460,471 | ||
| 1990/0227 | }else name = nextelem(name, elem); c = (*devtab[t].attach)(elem); | |
| 1990/0820 | }else{ | |
| 1990/0227 | c = clone(u->dot, 0); | |
| 1990/0820 | name = skipslash(name); /* eat leading ./ */ if(*name == 0) isdot = 1; } | |
| 1990/0227 | if(waserror()){ close(c); | |
| 1990/08141/sys/src/9/port/chan.c:468,475 – 1990/0820/sys/src/9/port/chan.c:473,481 | ||
| 1990/0227 | } name = nextelem(name, elem); | |
| 1990/0820 | if(mntok && !isdot) if(!(amode==Amount && elem[0]==0)) /* don't domount on slash */ | |
| 1990/0227 | c = domount(c); /* see case Atodir below */ /* | |
| 1990/08141/sys/src/9/port/chan.c:482,487 – 1990/0820/sys/src/9/port/chan.c:488,494 | ||
| 1990/0227 | c = nc; name = nextelem(name, elem); } | |
| 1990/0820 | ||
| 1990/0227 | /* * Last element; act according to type of access. */ | |
| 1990/08141/sys/src/9/port/chan.c:488,496 – 1990/0820/sys/src/9/port/chan.c:495,507 | ||
| 1990/0227 | switch(amode){ case Aaccess: | |
| 1990/0515 |
| |
| 1990/0227 |
| |
| 1990/0820 | if(isdot) c = domount(c); else{ if((nc=walk(c, elem, mntok)) == 0) error(0, Enonexist); c = nc; } | |
| 1990/0227 | break; case Atodir: | |
| 1990/08141/sys/src/9/port/chan.c:506,514 – 1990/0820/sys/src/9/port/chan.c:517,529 | ||
| 1990/0227 | break; case Aopen: | |
| 1990/0820 | if(isdot) c = domount(c); else{ if((nc=walk(c, elem, mntok)) == 0) error(0, Enonexist); c = nc; } | |
| 1990/0227 | Open: c = (*devtab[c->type].open)(c, omode); | |
| 1990/08141 | if(omode & OCEXEC) | |
| 1990/08141/sys/src/9/port/chan.c:527,532 – 1990/0820/sys/src/9/port/chan.c:542,549 | ||
| 1990/0227 | break; case Acreate: | |
| 1990/0820 | if(isdot) error(0, Eisdir); | |
| 1990/0227 | if((nc=walk(c, elem, 1)) != 0){ c = nc; omode |= OTRUNC; | |
| 1990/08141/sys/src/9/port/chan.c:552,561 – 1990/0820/sys/src/9/port/chan.c:569,587 | ||
| 1990/0227 | char* skipslash(char *name) { | |
| 1990/0820 | Again: | |
| 1990/0227 | while(*name == '/'){ if(((ulong)name&KZERO)==0 && (((ulong)name+1)&(BY2PG-1))==0) validaddr((ulong)name+1, 1, 0); name++; | |
| 1990/0820 | } if(*name == '.'){ if(((ulong)name&KZERO)==0 && (((ulong)name+1)&(BY2PG-1))==0) validaddr((ulong)name+1, 1, 0); if(name[1]==0 || name[1]=='/'){ name++; goto Again; } | |
| 1990/0227 | } return name; } | |