| plan 9 kernel history: overview | file list | diff list |
port/devdup.c (diff list | history)
| 1990/0227/sys/src/9/port/devdup.c:20,26 – 1990/11211/sys/src/9/port/devdup.c:20,26 (short | long) | ||
| 1990/0227 | if((f=u->fd[s]) == 0) return 0; sprint(buf, "%ld", s); | |
| 1990/11211 | devdir(c, (Qid){s, 0}, buf, 0, perm[f->mode&3], dp); | |
| 1990/0227 | return 1; } | |
| 1990/0227/sys/src/9/port/devdup.c:63,78 – 1990/11211/sys/src/9/port/devdup.c:63,78 | ||
| 1990/0227 | { Chan *f; | |
| 1990/11211 | if(c->qid.path == CHDIR){ | |
| 1990/0227 | if(omode != 0) | |
| 1990/11211 | error(Eisdir); | |
| 1990/0227 | c->mode = 0; c->flag |= COPEN; c->offset = 0; return c; } | |
| 1990/11211 | fdtochan(c->qid.path, openmode(omode)); /* error check only */ f = u->fd[c->qid.path]; | |
| 1990/0227 | close(c); incref(f); return f; | |
| 1990/0227/sys/src/9/port/devdup.c:81,99 – 1990/11211/sys/src/9/port/devdup.c:81,99 | ||
| 1990/0227 | void dupcreate(Chan *c, char *name, int omode, ulong perm) { | |
| 1990/11211 | error(Eperm); | |
| 1990/0227 | } void dupremove(Chan *c) { | |
| 1990/11211 | error(Eperm); | |
| 1990/0227 | } void dupwstat(Chan *c, char *dp) { | |
| 1990/11211 | error(Egreg); | |
| 1990/0227 | } void | |
| 1990/0227/sys/src/9/port/devdup.c:106,112 – 1990/11211/sys/src/9/port/devdup.c:106,112 | ||
| 1990/0227 | { char *a = va; | |
| 1990/11211 | if(c->qid.path != CHDIR) | |
| 1990/0227 | panic("dupread"); return devdirread(c, a, n, (Dirtab *)0, 0L, dupgen); } | |
| 1990/0227/sys/src/9/port/devdup.c:115,130 – 1990/11211/sys/src/9/port/devdup.c:115,118 | ||
| 1990/0227 | dupwrite(Chan *c, void *va, long n) { panic("dupwrite"); | |
| 1990/11211/sys/src/9/port/devdup.c:75,80 – 1991/0320/sys/src/9/port/devdup.c:75,82 (short | long) | ||
| 1990/11211 | f = u->fd[c->qid.path]; | |
| 1990/0227 | close(c); incref(f); | |
| 1991/0320 | if(omode & OCEXEC) f->flag |= CCEXEC; | |
| 1990/0227 | return f; } | |
| 1991/0320/sys/src/9/port/devdup.c:104,110 – 1991/0411/sys/src/9/port/devdup.c:104,110 (short | long) | ||
| 1990/0227 | } long | |
| 1991/0411 | dupread(Chan *c, void *va, long n, ulong offset) | |
| 1990/0227 | { char *a = va; | |
| 1991/0320/sys/src/9/port/devdup.c:114,120 – 1991/0411/sys/src/9/port/devdup.c:114,120 | ||
| 1990/0227 | } long | |
| 1991/0411 | dupwrite(Chan *c, void *va, long n, ulong offset) | |
| 1990/0227 | { panic("dupwrite"); } | |
| 1991/0411/sys/src/9/port/devdup.c:46,51 – 1991/0419/sys/src/9/port/devdup.c:46,57 (short | long) | ||
| 1990/0227 | return devclone(c, nc); } | |
| 1991/0419 | Chan* dupclwalk(Chan *c, char *name) { return devclwalk(c, name); } | |
| 1990/0227 | int dupwalk(Chan *c, char *name) { | |
| 1991/0419/sys/src/9/port/devdup.c:61,67 – 1991/0425/sys/src/9/port/devdup.c:61,78 (short | long) | ||
| 1990/0227 | void dupstat(Chan *c, char *db) { | |
| 1991/0425 | int fd; Chan *f; if(c->qid.path == CHDIR){ devstat(c, db, (Dirtab *)0, 0L, dupgen); }else{ fd = c->qid.path; SET(f); if(fd<0 || NFD<=fd || (f=u->fd[fd])==0) error(Ebadfd); (*devtab[f->type].stat)(f, (char*)db); } | |
| 1990/0227 | } Chan * | |
| 1991/0425/sys/src/9/port/devdup.c:61,78 – 1991/0426/sys/src/9/port/devdup.c:61,67 (short | long) | ||
| 1990/0227 | void dupstat(Chan *c, char *db) { | |
| 1991/0425 |
| |
| 1991/0426 | devstat(c, db, (Dirtab *)0, 0L, dupgen); | |
| 1990/0227 | } Chan * | |
| 1991/0426/sys/src/9/port/devdup.c:46,57 – 1991/0427/sys/src/9/port/devdup.c:46,51 (short | long) | ||
| 1990/0227 | return devclone(c, nc); } | |
| 1991/0419 |
| |
| 1990/0227 | int dupwalk(Chan *c, char *name) { | |
| 1991/0427/sys/src/9/port/devdup.c:12,23 – 1991/0705/sys/src/9/port/devdup.c:12,24 (short | long) | ||
| 1990/0227 | dupgen(Chan *c, Dirtab *tab, int ntab, int s, Dir *dp) { char buf[8]; | |
| 1991/0705 | Fgrp *fgrp = u->p->fgrp; | |
| 1990/0227 | Chan *f; static int perm[] = { 0400, 0200, 0600, 0 }; if(s >= NFD) return -1; | |
| 1991/0705 | if((f=fgrp->fd[s]) == 0) | |
| 1990/0227 | return 0; sprint(buf, "%ld", s); | |
| 1990/11211 | devdir(c, (Qid){s, 0}, buf, 0, perm[f->mode&3], dp); | |
| 1991/0427/sys/src/9/port/devdup.c:72,78 – 1991/0705/sys/src/9/port/devdup.c:73,79 | ||
| 1990/0227 | return c; } | |
| 1990/11211 | fdtochan(c->qid.path, openmode(omode)); /* error check only */ | |
| 1991/0705 | f = u->p->fgrp->fd[c->qid.path]; | |
| 1990/0227 | close(c); incref(f); | |
| 1991/0320 | if(omode & OCEXEC) | |
| 1991/0705/sys/src/9/port/devdup.c:72,78 – 1991/1011/sys/src/9/port/devdup.c:72,78 (short | long) | ||
| 1990/0227 | c->offset = 0; return c; } | |
| 1990/11211 |
| |
| 1991/1011 | fdtochan(c->qid.path, openmode(omode), 0); /* error check only */ | |
| 1991/0705 | f = u->p->fgrp->fd[c->qid.path]; | |
| 1990/0227 | close(c); incref(f); | |
| 1991/1011/sys/src/9/port/devdup.c:21,27 – 1991/1109/sys/src/9/port/devdup.c:21,27 (short | long) | ||
| 1991/0705 | if((f=fgrp->fd[s]) == 0) | |
| 1990/0227 | return 0; sprint(buf, "%ld", s); | |
| 1990/11211 |
| |
| 1991/1109 | devdir(c, (Qid){s, 0}, buf, 0, eve, perm[f->mode&3], dp); | |
| 1990/0227 | return 1; } | |
| 1991/1109/sys/src/9/port/devdup.c:84,89 – 1991/1115/sys/src/9/port/devdup.c:84,90 (short | long) | ||
| 1990/0227 | void dupcreate(Chan *c, char *name, int omode, ulong perm) { | |
| 1991/1115 | USED(c, name, omode, perm); | |
| 1990/11211 | error(Eperm); | |
| 1990/0227 | } | |
| 1991/1109/sys/src/9/port/devdup.c:90,95 – 1991/1115/sys/src/9/port/devdup.c:91,97 | ||
| 1990/0227 | void dupremove(Chan *c) { | |
| 1991/1115 | USED(c); | |
| 1990/11211 | error(Eperm); | |
| 1990/0227 | } | |
| 1991/1109/sys/src/9/port/devdup.c:96,101 – 1991/1115/sys/src/9/port/devdup.c:98,104 | ||
| 1990/0227 | void dupwstat(Chan *c, char *dp) { | |
| 1991/1115 | USED(c); | |
| 1990/11211 | error(Egreg); | |
| 1990/0227 | } | |
| 1991/1109/sys/src/9/port/devdup.c:102,107 – 1991/1115/sys/src/9/port/devdup.c:105,111 | ||
| 1990/0227 | void dupclose(Chan *c) { | |
| 1991/1115 | USED(c); | |
| 1990/0227 | } long | |
| 1991/1109/sys/src/9/port/devdup.c:117,121 – 1991/1115/sys/src/9/port/devdup.c:121,126 | ||
| 1990/0227 | long | |
| 1991/0411 | dupwrite(Chan *c, void *va, long n, ulong offset) | |
| 1990/0227 | { | |
| 1991/1115 | USED(c, va, n, offset); | |
| 1990/0227 | panic("dupwrite"); } | |
| 1991/1115/sys/src/9/port/devdup.c:3,9 – 1992/0111/sys/src/9/port/devdup.c:3,9 (short | long) | ||
|
Move error.h to ../port. Change errors to actual strings.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1990/0227 | #include "mem.h" #include "dat.h" #include "fns.h" | |
| 1992/0111 | #include "../port/error.h" | |
| 1990/0227 | #include "devtab.h" | |
| 1992/0111/sys/src/9/port/devdup.c:1,5 – 1992/0321/sys/src/9/port/devdup.c:1,5 (short | long) | ||
|
Move lib.h to ../port.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1990/0227 | #include "u.h" | |
| 1992/0321 | #include "../port/lib.h" | |
| 1990/0227 | #include "mem.h" #include "dat.h" #include "fns.h" | |
| 1992/0321/sys/src/9/port/devdup.c:123,126 – 1992/0520/sys/src/9/port/devdup.c:123,127 (short | long) | ||
| 1990/0227 | { | |
| 1991/1115 | USED(c, va, n, offset); | |
| 1990/0227 | panic("dupwrite"); | |
| 1992/0520 | return 0; /* not reached */ | |
| 1990/0227 | } | |
| 1992/0520/sys/src/9/port/devdup.c:16,21 – 1992/0711/sys/src/9/port/devdup.c:16,23 (short | long) | ||
| 1990/0227 | Chan *f; static int perm[] = { 0400, 0200, 0600, 0 }; | |
| 1992/0711 | USED(tab); USED(ntab); | |
| 1990/0227 | if(s >= NFD) return -1; | |
| 1991/0705 | if((f=fgrp->fd[s]) == 0) | |
| 1992/0520/sys/src/9/port/devdup.c:99,104 – 1992/0711/sys/src/9/port/devdup.c:101,107 | ||
| 1990/0227 | dupwstat(Chan *c, char *dp) { | |
| 1991/1115 | USED(c); | |
| 1992/0711 | USED(dp); | |
| 1990/11211 | error(Egreg); | |
| 1990/0227 | } | |
| 1992/0520/sys/src/9/port/devdup.c:113,118 – 1992/0711/sys/src/9/port/devdup.c:116,122 | ||
| 1990/0227 | { char *a = va; | |
| 1992/0711 | USED(offset); | |
| 1990/11211 | if(c->qid.path != CHDIR) | |
| 1990/0227 | panic("dupread"); return devdirread(c, a, n, (Dirtab *)0, 0L, dupgen); | |
| 1992/0711/sys/src/9/port/devdup.c:74,80 – 1992/0825/sys/src/9/port/devdup.c:74,80 (short | long) | ||
| 1990/0227 | c->offset = 0; return c; } | |
| 1991/1011 |
| |
| 1992/0825 | fdtochan(c->qid.path, openmode(omode), 0, 0); /* error check only */ | |
| 1991/0705 | f = u->p->fgrp->fd[c->qid.path]; | |
| 1990/0227 | close(c); incref(f); | |
| 1992/0825/sys/src/9/port/devdup.c:12,18 – 1993/0501/sys/src/9/port/devdup.c:12,18 (short | long) | ||
| 1990/0227 | dupgen(Chan *c, Dirtab *tab, int ntab, int s, Dir *dp) { char buf[8]; | |
| 1991/0705 |
| |
| 1993/0501 | Fgrp *fgrp = up->fgrp; | |
| 1990/0227 | Chan *f; static int perm[] = { 0400, 0200, 0600, 0 }; | |
| 1992/0825/sys/src/9/port/devdup.c:75,81 – 1993/0501/sys/src/9/port/devdup.c:75,81 | ||
| 1990/0227 | return c; } | |
| 1992/0825 | fdtochan(c->qid.path, openmode(omode), 0, 0); /* error check only */ | |
| 1991/0705 |
| |
| 1993/0501 | f = up->fgrp->fd[c->qid.path]; | |
| 1990/0227 | close(c); incref(f); | |
| 1991/0320 | if(omode & OCEXEC) | |
| 1993/0501/sys/src/9/port/devdup.c:122,127 – 1995/0108/sys/src/9/port/devdup.c:122,133 (short | long) | ||
| 1990/0227 | return devdirread(c, a, n, (Dirtab *)0, 0L, dupgen); } | |
| 1995/0108 | Block* dupbread(Chan *c, long n, ulong offset) { return devbread(c, n, offset); } | |
| 1990/0227 | long | |
| 1991/0411 | dupwrite(Chan *c, void *va, long n, ulong offset) | |
| 1990/0227 | { | |
| 1993/0501/sys/src/9/port/devdup.c:128,131 – 1995/0108/sys/src/9/port/devdup.c:134,143 | ||
| 1991/1115 | USED(c, va, n, offset); | |
| 1990/0227 | panic("dupwrite"); | |
| 1992/0520 | return 0; /* not reached */ | |
| 1995/0108 | } long dupbwrite(Chan *c, Block *bp, ulong offset) { return devbwrite(c, bp, offset); | |
| 1990/0227 | } | |
| 1995/0108/sys/src/9/port/devdup.c:9,15 – 1995/0804/sys/src/9/port/devdup.c:9,15 (short | long) | ||
| 1990/0227 | int | |
| 1995/0804 | dupgen(Chan *c, Dirtab*, int, int s, Dir *dp) | |
| 1990/0227 | { char buf[8]; | |
| 1993/0501 | Fgrp *fgrp = up->fgrp; | |
| 1995/0108/sys/src/9/port/devdup.c:16,23 – 1995/0804/sys/src/9/port/devdup.c:16,21 | ||
| 1990/0227 | Chan *f; static int perm[] = { 0400, 0200, 0600, 0 }; | |
| 1992/0711 |
| |
| 1990/0227 | if(s >= NFD) return -1; | |
| 1991/0705 | if((f=fgrp->fd[s]) == 0) | |
| 1995/0108/sys/src/9/port/devdup.c:84,122 – 1995/0804/sys/src/9/port/devdup.c:82,114 | ||
| 1990/0227 | } void | |
| 1995/0804 | dupcreate(Chan*, char*, int, ulong) | |
| 1990/0227 | { | |
| 1991/1115 |
| |
| 1990/11211 | error(Eperm); | |
| 1990/0227 | } void | |
| 1995/0804 | dupremove(Chan*) | |
| 1990/0227 | { | |
| 1991/1115 |
| |
| 1990/11211 | error(Eperm); | |
| 1990/0227 | } void | |
| 1995/0804 | dupwstat(Chan*, char*) | |
| 1990/0227 | { | |
| 1991/1115 |
| |
| 1992/0711 |
| |
| 1990/11211 | error(Egreg); | |
| 1990/0227 | } void | |
| 1995/0804 | dupclose(Chan*) | |
| 1990/0227 | { | |
| 1991/1115 |
| |
| 1990/0227 | } long | |
| 1991/0411 |
| |
| 1995/0804 | dupread(Chan *c, void *va, long n, ulong) | |
| 1990/0227 | { char *a = va; | |
| 1992/0711 |
| |
| 1990/11211 | if(c->qid.path != CHDIR) | |
| 1990/0227 | panic("dupread"); return devdirread(c, a, n, (Dirtab *)0, 0L, dupgen); | |
| 1995/0108/sys/src/9/port/devdup.c:129,137 – 1995/0804/sys/src/9/port/devdup.c:121,128 | ||
| 1995/0108 | } | |
| 1990/0227 | long | |
| 1991/0411 |
| |
| 1995/0804 | dupwrite(Chan*, void*, long, ulong) | |
| 1990/0227 | { | |
| 1991/1115 |
| |
| 1990/0227 | panic("dupwrite"); | |
| 1992/0520 | return 0; /* not reached */ | |
| 1995/0108 | } | |
| 1995/0804/sys/src/9/port/devdup.c:5,11 – 1996/0223/sys/src/9/port/devdup.c:5,10 (short | long) | ||
| 1990/0227 | #include "fns.h" | |
| 1992/0111 | #include "../port/error.h" | |
| 1990/0227 |
| |
| 1996/0223/sys/src/9/port/devdup.c:5,13 – 1997/0327/sys/src/9/port/devdup.c:5,11 (short | long) | ||
| 1990/0227 | #include "fns.h" | |
| 1992/0111 | #include "../port/error.h" | |
| 1990/0227 |
| |
| 1997/0327 | static int | |
| 1995/0804 | dupgen(Chan *c, Dirtab*, int, int s, Dir *dp) | |
| 1990/0227 | { char buf[8]; | |
| 1996/0223/sys/src/9/port/devdup.c:24,64 – 1997/0327/sys/src/9/port/devdup.c:22,46 | ||
| 1990/0227 | return 1; } | |
| 1997/0327 | static Chan* | |
| 1990/0227 | dupattach(char *spec) { return devattach('d', spec); } | |
| 1997/0327 | static int | |
| 1990/0227 | dupwalk(Chan *c, char *name) { return devwalk(c, name, (Dirtab *)0, 0, dupgen); } | |
| 1997/0327 | static void | |
| 1990/0227 | dupstat(Chan *c, char *db) { | |
| 1991/0426 | devstat(c, db, (Dirtab *)0, 0L, dupgen); | |
| 1990/0227 | } | |
| 1997/0327 | static Chan* | |
| 1990/0227 | dupopen(Chan *c, int omode) { Chan *f; | |
| 1996/0223/sys/src/9/port/devdup.c:73,79 – 1997/0327/sys/src/9/port/devdup.c:55,61 | ||
| 1990/0227 | } | |
| 1992/0825 | fdtochan(c->qid.path, openmode(omode), 0, 0); /* error check only */ | |
| 1993/0501 | f = up->fgrp->fd[c->qid.path]; | |
| 1990/0227 |
| |
| 1997/0327 | cclose(c); | |
| 1990/0227 | incref(f); | |
| 1991/0320 | if(omode & OCEXEC) f->flag |= CCEXEC; | |
| 1996/0223/sys/src/9/port/devdup.c:80,109 – 1997/0327/sys/src/9/port/devdup.c:62,73 | ||
| 1990/0227 | return f; } | |
| 1995/0804 |
| |
| 1990/0227 |
| |
| 1990/11211 |
| |
| 1990/0227 |
| |
| 1995/0804 |
| |
| 1990/0227 |
| |
| 1990/11211 |
| |
| 1990/0227 |
| |
| 1995/0804 |
| |
| 1990/0227 |
| |
| 1990/11211 |
| |
| 1990/0227 |
| |
| 1997/0327 | static void | |
| 1995/0804 | dupclose(Chan*) | |
| 1990/0227 | { } | |
| 1997/0327 | static long | |
| 1995/0804 | dupread(Chan *c, void *va, long n, ulong) | |
| 1990/0227 | { char *a = va; | |
| 1996/0223/sys/src/9/port/devdup.c:113,125 – 1997/0327/sys/src/9/port/devdup.c:77,83 | ||
| 1990/0227 | return devdirread(c, a, n, (Dirtab *)0, 0L, dupgen); } | |
| 1995/0108 |
| |
| 1990/0227 |
| |
| 1997/0327 | static long | |
| 1995/0804 | dupwrite(Chan*, void*, long, ulong) | |
| 1990/0227 | { panic("dupwrite"); | |
| 1996/0223/sys/src/9/port/devdup.c:126,133 – 1997/0327/sys/src/9/port/devdup.c:84,103 | ||
| 1992/0520 | return 0; /* not reached */ | |
| 1995/0108 | } | |
| 1990/0227 |
| |
| 1997/0327 | Dev dupdevtab = { devreset, devinit, dupattach, devclone, dupwalk, dupstat, dupopen, devcreate, dupclose, dupread, devbread, dupwrite, devbwrite, devremove, devwstat, }; | |
| 1997/0327/sys/src/9/port/devdup.c:85,90 – 1997/0408/sys/src/9/port/devdup.c:85,93 (short | long) | ||
| 1995/0108 | } | |
| 1997/0327 | Dev dupdevtab = { | |
| 1997/0408 | 'd', "dup", | |
| 1997/0327 | devreset, devinit, dupattach, | |
| 1997/0408/sys/src/9/port/devdup.c:13,19 – 1997/0603/sys/src/9/port/devdup.c:13,19 (short | long) | ||
| 1990/0227 | Chan *f; static int perm[] = { 0400, 0200, 0600, 0 }; | |
| 1997/0603 | if(s >= fgrp->maxfd) | |
| 1990/0227 | return -1; | |
| 1991/0705 | if((f=fgrp->fd[s]) == 0) | |
| 1990/0227 | return 0; | |
| 1997/0603/sys/src/9/port/devdup.c:13,19 – 1997/0606/sys/src/9/port/devdup.c:13,19 (short | long) | ||
| 1990/0227 | Chan *f; static int perm[] = { 0400, 0200, 0600, 0 }; | |
| 1997/0603 |
| |
| 1997/0606 | if(s > fgrp->maxfd) | |
| 1990/0227 | return -1; | |
| 1991/0705 | if((f=fgrp->fd[s]) == 0) | |
| 1990/0227 | return 0; | |
| 1997/0606/sys/src/9/port/devdup.c:68,74 – 1998/0319/sys/src/9/port/devdup.c:68,74 (short | long) | ||
|
Change dev read and write to use vlong offset.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1990/0227 | } | |
| 1997/0327 | static long | |
| 1995/0804 |
| |
| 1998/0319 | dupread(Chan *c, void *va, long n, vlong) | |
| 1990/0227 | { char *a = va; | |
| 1997/0606/sys/src/9/port/devdup.c:78,84 – 1998/0319/sys/src/9/port/devdup.c:78,84 | ||
| 1990/0227 | } | |
| 1997/0327 | static long | |
| 1995/0804 |
| |
| 1998/0319 | dupwrite(Chan*, void*, long, vlong) | |
| 1990/0227 | { panic("dupwrite"); | |
| 1992/0520 | return 0; /* not reached */ | |
| Too many diffs (26 > 25). Stopping. | ||