| plan 9 kernel history: overview | file list | diff list |
gnot/sysfile.c (diff list | history)
| 1990/03091/sys/src/9/gnot/sysfile.c:406,415 – 1990/03291/sys/src/9/gnot/sysfile.c:406,411 (short | long) | ||
| 1990/03091 | c[1] = (*d->clone)(c[0], 0); c[0] = (*d->open)(c[0], ORDWR); c[1] = (*d->open)(c[1], ORDWR); | |
| 1990/03291/sys/src/9/gnot/sysfile.c:126,132 – 1990/03292/sys/src/9/gnot/sysfile.c:126,132 (short | long) | ||
| 1990/03091 | mnt = c->mnt; lock(pg); if(c->mountid != mnt->mountid){ | |
| 1990/03292 | pprint("unionread: changed underfoot?\n"); | |
| 1990/03091 | unlock(pg); return 0; } | |
| 1990/03292/sys/src/9/gnot/sysfile.c:457,462 – 1990/0703/sys/src/9/gnot/sysfile.c:457,463 (short | long) | ||
| 1990/03091 | validaddr(arg[0], 1, 0); c = namec((char*)arg[0], Aaccess, 0, 0); if(waserror()){ | |
| 1990/0703 | c->type = 0; /* see below */ | |
| 1990/03091 | close(c); nexterror(); } | |
| 1990/0703/sys/src/9/gnot/sysfile.c:44,53 – 1990/08141/sys/src/9/gnot/sysfile.c:44,53 (short | long) | ||
| 1990/03091 | int openmode(ulong o) { | |
| 1990/08141 | if(o >= (OTRUNC|OCEXEC|ORCLOSE|OEXEC)) | |
| 1990/03091 | Err: error(0, Ebadarg); | |
| 1990/08141 | o &= ~(OTRUNC|OCEXEC|ORCLOSE); | |
| 1990/03091 | if(o > OEXEC) goto Err; if(o == OEXEC) | |
| 1990/08141/sys/src/9/gnot/sysfile.c:148,153 – 1990/0821/sys/src/9/gnot/sysfile.c:148,154 (short | long) | ||
| 1990/03091 | nc = (*devtab[nc->type].open)(nc, OREAD); nc->offset = c->offset; nr = (*devtab[nc->type].read)(nc, va, n); | |
| 1990/0821 | c->offset = nc->offset; /* devdirread e.g. changes it */ | |
| 1990/03091 | close(nc); poperror(); if(nr > 0) | |
| 1990/08141/sys/src/9/gnot/sysfile.c:192,198 – 1990/0821/sys/src/9/gnot/sysfile.c:193,199 | ||
| 1990/03091 | if(c->offset%DIRLEN || n==0) error(0, Ebaddirread); } | |
| 1990/0821 | if((c->qid&CHDIR) && (c->flag&CMOUNT)) | |
| 1990/03091 | n = unionread(c, (void*)arg[1], n); else n = (*devtab[c->type].read)(c, (void*)arg[1], n); | |
| 1990/0821/sys/src/9/gnot/sysfile.c:299,309 – 1990/0822/sys/src/9/gnot/sysfile.c:299,305 (short | long) | ||
| 1990/03091 | Chan *c; long mode; | |
| 1990/0822 | postnote(u->p, 1, "access is deprecated", NDebug); | |
| 1990/03091 | return 0; } | |
| 1990/0822/sys/src/9/gnot/sysfile.c:321,326 – 1990/0918/sys/src/9/gnot/sysfile.c:321,328 (short | long) | ||
| 1990/03091 | Chan *c0, *c1; ulong flag; long ret; | |
| 1990/0918 | char *p; int t; | |
| 1990/03091 | struct{ Chan *chan; char *spec; | |
| 1990/0822/sys/src/9/gnot/sysfile.c:331,338 – 1990/0918/sys/src/9/gnot/sysfile.c:333,344 | ||
| 1990/03091 | error(0, Ebadarg); if(ismount){ bogus.chan = fdtochan(arg[0], 2); | |
| 1990/0918 | p = (char*)arg[3]; t = BY2PG-((ulong)p&(BY2PG-1)); while(vmemchr(p, 0, t) == 0){ p += t; t = BY2PG; } | |
| 1990/03091 | bogus.spec = (char*)arg[3]; ret = devno('M', 0); c0 = (*devtab[ret].attach)((char*)&bogus); | |
| 1990/0918/sys/src/9/gnot/sysfile.c:31,42 – 1990/0928/sys/src/9/gnot/sysfile.c:31,42 (short | long) | ||
| 1990/03091 | if(fd<0 || NFD<=fd || (c=u->fd[fd])==0) error(0, Ebadfd); | |
| 1990/0928 | if(mode<0 || c->mode==ORDWR) | |
| 1990/03091 | return c; | |
| 1990/0928 | if((mode&OTRUNC) && c->mode==OREAD) | |
| 1990/03091 | err: error(0, Ebadusefd); | |
| 1990/0928 | if((mode&~OTRUNC) != c->mode) | |
| 1990/03091 | goto err; return c; } | |
| 1990/0928/sys/src/9/gnot/sysfile.c:56,61 – 1990/1009/sys/src/9/gnot/sysfile.c:56,100 (short | long) | ||
| 1990/03091 | } long | |
| 1990/1009 | syspipe(ulong *arg) { int fd[2]; Chan *c[2]; Dev *d; validaddr(arg[0], 2*BY2WD, 1); evenaddr(arg[0]); d = &devtab[devno('|', 0)]; c[0] = (*d->attach)(0); c[1] = 0; fd[0] = -1; fd[1] = -1; if(waserror()){ close(c[0]); if(c[1]) close(c[1]); if(fd[0] >= 0) u->fd[fd[0]]=0; if(fd[1] >= 0) u->fd[fd[1]]=0; nexterror(); } c[1] = (*d->clone)(c[0], 0); (*d->walk)(c[0], "data"); (*d->walk)(c[1], "data1"); c[0] = (*d->open)(c[0], ORDWR); c[1] = (*d->open)(c[1], ORDWR); fd[0] = newfd(); u->fd[fd[0]] = c[0]; fd[1] = newfd(); u->fd[fd[1]] = c[1]; ((long*)arg[0])[0] = fd[0]; ((long*)arg[0])[1] = fd[1]; poperror(); return 0; } long | |
| 1990/03091 | sysdup(ulong *arg) { int fd; | |
| 1990/0928/sys/src/9/gnot/sysfile.c:180,187 – 1990/1009/sys/src/9/gnot/sysfile.c:219,226 | ||
| 1990/03091 | Chan *c; long n; | |
| 1990/1009 | c = fdtochan(arg[0], OREAD); validaddr(arg[1], arg[2], 1); | |
| 1990/03091 | qlock(c); if(waserror()){ qunlock(c); | |
| 1990/0928/sys/src/9/gnot/sysfile.c:208,214 – 1990/1009/sys/src/9/gnot/sysfile.c:247,253 | ||
| 1990/03091 | Chan *c; long n; | |
| 1990/1009 | c = fdtochan(arg[0], OWRITE); | |
| 1990/03091 | validaddr(arg[1], arg[2], 0); qlock(c); if(waserror()){ | |
| 1990/0928/sys/src/9/gnot/sysfile.c:380,422 – 1990/1009/sys/src/9/gnot/sysfile.c:419,424 | ||
| 1990/03091 | sysmount(ulong *arg) { return bindmount(arg, 1); | |
| 1990/1009/sys/src/9/gnot/sysfile.c:508,510 – 1990/1104/sys/src/9/gnot/sysfile.c:508,523 (short | long) | ||
| 1990/03091 | (*devtab[c->type].wstat)(c, (char*)arg[1]); return 0; } | |
| 1990/1104 | long sysfilsys(ulong *arg) { Chan *c; c = fdtochan(arg[0], -1); validaddr(arg[1], 1, 0); if((c->qid&CHDIR) || (c->mode&ORDWR)!=ORDWR) error(0, Ebadarg); service((char *)arg[1], c, filsys); return 0; } | |
| 1990/1104/sys/src/9/gnot/sysfile.c:512,523 – 1990/1106/sys/src/9/gnot/sysfile.c:512,524 (short | long) | ||
| 1990/1104 | long sysfilsys(ulong *arg) { | |
| 1990/1106 | Chan *cin, *cout; | |
| 1990/1104 |
| |
| 1990/1106 | cin = fdtochan(arg[0], OREAD); cout = fdtochan(arg[1], OWRITE); validaddr(arg[2], 1, 0); if((cin->qid&CHDIR) || (cout->qid&CHDIR)) | |
| 1990/1104 | error(0, Ebadarg); | |
| 1990/1106 | service((char *)arg[2], cin, cout, filsys); | |
| 1990/1104 | return 0; } | |
| 1990/1106/sys/src/9/gnot/sysfile.c:21,27 – 1990/11211/sys/src/9/gnot/sysfile.c:21,27 (short | long) | ||
| 1990/03091 | u->maxfd = i; return i; } | |
| 1990/11211 | error(Enofd); | |
| 1990/03091 | } Chan* | |
| 1990/1106/sys/src/9/gnot/sysfile.c:30,41 – 1990/11211/sys/src/9/gnot/sysfile.c:30,41 | ||
| 1990/03091 | Chan *c; if(fd<0 || NFD<=fd || (c=u->fd[fd])==0) | |
| 1990/11211 | error(Ebadfd); | |
| 1990/0928 | if(mode<0 || c->mode==ORDWR) | |
| 1990/03091 | return c; | |
| 1990/0928 | if((mode&OTRUNC) && c->mode==OREAD) | |
| 1990/03091 | err: | |
| 1990/11211 | error(Ebadusefd); | |
| 1990/0928 | if((mode&~OTRUNC) != c->mode) | |
| 1990/03091 | goto err; return c; | |
| 1990/1106/sys/src/9/gnot/sysfile.c:46,52 – 1990/11211/sys/src/9/gnot/sysfile.c:46,52 | ||
| 1990/03091 | { | |
| 1990/08141 | if(o >= (OTRUNC|OCEXEC|ORCLOSE|OEXEC)) | |
| 1990/03091 | Err: | |
| 1990/11211 | error(Ebadarg); | |
| 1990/08141 | o &= ~(OTRUNC|OCEXEC|ORCLOSE); | |
| 1990/03091 | if(o > OEXEC) goto Err; | |
| 1990/1106/sys/src/9/gnot/sysfile.c:227,238 – 1990/11211/sys/src/9/gnot/sysfile.c:227,238 | ||
| 1990/03091 | nexterror(); } n = arg[2]; | |
| 1990/11211 | if(c->qid.path & CHDIR){ | |
| 1990/03091 | n -= n%DIRLEN; if(c->offset%DIRLEN || n==0) | |
| 1990/11211 | error(Ebaddirread); | |
| 1990/03091 | } | |
| 1990/0821 |
| |
| 1990/11211 | if((c->qid.path&CHDIR) && (c->flag&CMOUNT)) | |
| 1990/03091 | n = unionread(c, (void*)arg[1], n); else n = (*devtab[c->type].read)(c, (void*)arg[1], n); | |
| 1990/1106/sys/src/9/gnot/sysfile.c:254,261 – 1990/11211/sys/src/9/gnot/sysfile.c:254,261 | ||
| 1990/03091 | qunlock(c); nexterror(); } | |
| 1990/11211 | if(c->qid.path & CHDIR) error(Eisdir); | |
| 1990/03091 | n = (*devtab[c->type].write)(c, (void*)arg[1], arg[2]); c->offset += n; qunlock(c); | |
| 1990/1106/sys/src/9/gnot/sysfile.c:271,278 – 1990/11211/sys/src/9/gnot/sysfile.c:271,278 | ||
| 1990/03091 | long off; c = fdtochan(arg[0], -1); | |
| 1990/11211 | if(c->qid.path & CHDIR) error(Eisdir); | |
| 1990/03091 | qlock(c); if(waserror()){ qunlock(c); | |
| 1990/1106/sys/src/9/gnot/sysfile.c:365,377 – 1990/11211/sys/src/9/gnot/sysfile.c:365,379 | ||
| 1990/03091 | struct{ Chan *chan; char *spec; | |
| 1990/11211 | char *auth; | |
| 1990/03091 | }bogus; flag = arg[2]; if(flag>MMASK || (flag&MORDER)==(MBEFORE|MAFTER)) | |
| 1990/11211 | error(Ebadarg); | |
| 1990/03091 | if(ismount){ bogus.chan = fdtochan(arg[0], 2); | |
| 1990/11211 | validaddr(arg[3], 1, 0); | |
| 1990/0918 | p = (char*)arg[3]; t = BY2PG-((ulong)p&(BY2PG-1)); while(vmemchr(p, 0, t) == 0){ | |
| 1990/1106/sys/src/9/gnot/sysfile.c:379,384 – 1990/11211/sys/src/9/gnot/sysfile.c:381,394 | ||
| 1990/0918 | t = BY2PG; } | |
| 1990/03091 | bogus.spec = (char*)arg[3]; | |
| 1990/11211 | validaddr(arg[4], 1, 0); p = (char*)arg[4]; t = BY2PG-((ulong)p&(BY2PG-1)); while(vmemchr(p, 0, t) == 0){ p += t; t = BY2PG; } bogus.auth = (char*)arg[4]; | |
| 1990/03091 | ret = devno('M', 0); c0 = (*devtab[ret].attach)((char*)&bogus); }else{ | |
| 1990/1106/sys/src/9/gnot/sysfile.c:395,404 – 1990/11211/sys/src/9/gnot/sysfile.c:405,414 | ||
| 1990/03091 | close(c1); nexterror(); } | |
| 1990/11211 | if((c0->qid.path^c1->qid.path) & CHDIR) error(Ebadmount); if(flag && !(c0->qid.path&CHDIR)) error(Ebadmount); | |
| 1990/03091 | ret = mount(c0, c1, flag); close(c0); close(c1); | |
| 1990/1106/sys/src/9/gnot/sysfile.c:436,460 – 1990/11211/sys/src/9/gnot/sysfile.c:446,451 | ||
| 1990/03091 | } long | |
| 1990/1106/sys/src/9/gnot/sysfile.c:509,514 – 1990/11211/sys/src/9/gnot/sysfile.c:500,506 | ||
| 1990/03091 | return 0; } | |
| 1990/1104 | ||
| 1990/11211 | #ifdef asdf | |
| 1990/1104 | long sysfilsys(ulong *arg) { | |
| 1990/1106/sys/src/9/gnot/sysfile.c:517,524 – 1990/11211/sys/src/9/gnot/sysfile.c:509,517 | ||
| 1990/1106 | cin = fdtochan(arg[0], OREAD); cout = fdtochan(arg[1], OWRITE); validaddr(arg[2], 1, 0); | |
| 1990/1104 |
| |
| 1990/11211 | if((cin->qid.path&CHDIR) || (cout->qid.path&CHDIR)) error(Ebadarg); | |
| 1990/1106 | service((char *)arg[2], cin, cout, filsys); | |
| 1990/1104 | return 0; } | |
| 1990/11211 | #endif | |
| 1990/11211/sys/src/9/gnot/sysfile.c:29,34 – 1990/1126/sys/src/9/gnot/sysfile.c:29,35 (short | long) | ||
| 1990/03091 | { Chan *c; | |
| 1990/1126 | c = 0; /* set */ | |
| 1990/03091 | if(fd<0 || NFD<=fd || (c=u->fd[fd])==0) | |
| 1990/11211 | error(Ebadfd); | |
| 1990/0928 | if(mode<0 || c->mode==ORDWR) | |
| 1990/11211/sys/src/9/gnot/sysfile.c:329,344 – 1990/1126/sys/src/9/gnot/sysfile.c:330,335 | ||
| 1990/03091 | (*devtab[c->type].stat)(c, (char*)arg[1]); poperror(); close(c); | |
| 1990/0822 |
| |
| 1990/03091 | return 0; } | |
| 1990/1126/sys/src/9/gnot/sysfile.c:1,508 – 1990/1210/sys/src/9/gnot/sysfile.c:0 (short | long) | ||
|
Deleted.
rsc Mon Mar 7 10:21:57 2005 | ||
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/03091 |
| |
| 1990/1126 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/0928 |
| |
| 1990/03091 |
| |
| 1990/0928 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/0928 |
| |
| 1990/03091 |
| |
| 1990/08141 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/08141 |
| |
| 1990/03091 |
| |
| 1990/1009 |
| |
| 1990/03091 |
| |
| 1990/03292 |
| |
| 1990/03091 |
| |
| 1990/0821 |
| |
| 1990/03091 |
| |
| 1990/1009 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/03091 |
| |
| 1990/1009 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/03091 |
| |
| 1990/0918 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/0918 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/03091 |
| |
| 1990/11211 |
| |
| 1990/03091 |
| |
| 1990/0703 |
| |
| 1990/03091 |
| |
| 1990/1104 | ||
| 1990/11211 |
| |
| 1990/1104 |
| |
| 1990/1106 |
| |
| 1990/1104 | ||
| 1990/1106 |
| |
| 1990/11211 |
| |
| 1990/1106 |
| |
| 1990/1104 |
| |
| 1990/11211 |
| |