n 10 cat.c int n; n 12 cat.c while((n = read(fd, buf, sizeof(buf))) > 0) n 13 cat.c write(1, buf, n); n 14 cat.c if(n < 0){ n 228 console.c consoleread(struct inode *ip, char *dst, int n) n 234 console.c target = n; n 236 console.c while(n > 0){ n 247 console.c if(n < target){ n 255 console.c --n; n 262 console.c return target - n; n 266 console.c consolewrite(struct inode *ip, char *buf, int n) n 272 console.c for(i = 0; i < n; i++) n 277 console.c return n; n 32 defs.h int fileread(struct file*, char*, int n); n 34 defs.h int filewrite(struct file*, char*, int n); n 96 file.c fileread(struct file *f, char *addr, int n) n 103 file.c return piperead(f->pipe, addr, n); n 106 file.c if((r = readi(f->ip, addr, f->off, n)) > 0) n 117 file.c filewrite(struct file *f, char *addr, int n) n 124 file.c return pipewrite(f->pipe, addr, n); n 134 file.c while(i < n){ n 135 file.c int n1 = n - i; n 152 file.c return i == n ? n : -1; n 19 forktest.c int n, pid; n 23 forktest.c for(n=0; n<N; n++){ n 31 forktest.c if(n == N){ n 36 forktest.c for(; n > 0; n--){ n 435 fs.c readi(struct inode *ip, char *dst, uint off, uint n) n 443 fs.c return devsw[ip->major].read(ip, dst, n); n 446 fs.c if(off > ip->size || off + n < off) n 448 fs.c if(off + n > ip->size) n 449 fs.c n = ip->size - off; n 451 fs.c for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ n 453 fs.c m = min(n - tot, BSIZE - off%BSIZE); n 457 fs.c return n; n 463 fs.c writei(struct inode *ip, char *src, uint off, uint n) n 471 fs.c return devsw[ip->major].write(ip, src, n); n 474 fs.c if(off > ip->size || off + n < off) n 476 fs.c if(off + n > MAXFILE*BSIZE) n 479 fs.c for(tot=0; tot<n; tot+=m, off+=m, src+=m){ n 481 fs.c m = min(n - tot, BSIZE - off%BSIZE); n 487 fs.c if(n > 0 && off > ip->size){ n 491 fs.c return n; n 13 grep.c int n, m; n 17 grep.c while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){ n 18 grep.c m += n; n 108 lapic.c static int n; n 109 lapic.c if(n++ == 0) n 34 log.c int n; n 73 log.c for (tail = 0; tail < log.lh.n; tail++) { n 90 log.c log.lh.n = lh->n; n 91 log.c for (i = 0; i < log.lh.n; i++) { n 106 log.c hb->n = log.lh.n; n 107 log.c for (i = 0; i < log.lh.n; i++) { n 119 log.c log.lh.n = 0; n 131 log.c } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ n 179 log.c for (tail = 0; tail < log.lh.n; tail++) { n 192 log.c if (log.lh.n > 0) { n 196 log.c log.lh.n = 0; n 215 log.c if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) n 221 log.c for (i = 0; i < log.lh.n; i++) { n 226 log.c if (i == log.lh.n) n 227 log.c log.lh.n++; n 42 mkfs.c void iappend(uint inum, void *p, int n); n 256 mkfs.c iappend(uint inum, void *xp, int n) n 268 mkfs.c while(n > 0){ n 287 mkfs.c n1 = min(n, (fbn + 1) * BSIZE - off); n 291 mkfs.c n -= n1; n 78 pipe.c pipewrite(struct pipe *p, char *addr, int n) n 83 pipe.c for(i = 0; i < n; i++){ n 96 pipe.c return n; n 100 pipe.c piperead(struct pipe *p, char *addr, int n) n 112 pipe.c for(i = 0; i < n; i++){ //DOC: piperead-copy n 108 proc.c growproc(int n) n 113 proc.c if(n > 0){ n 114 proc.c if((sz = allocuvm(proc->pgdir, sz, sz + n)) == 0) n 116 proc.c } else if(n < 0){ n 117 proc.c if((sz = deallocuvm(proc->pgdir, sz, sz + n)) == 0) n 5 string.c memset(void *dst, int c, uint n) n 7 string.c if ((int)dst%4 == 0 && n%4 == 0){ n 9 string.c stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); n 11 string.c stosb(dst, c, n); n 16 string.c memcmp(const void *v1, const void *v2, uint n) n 22 string.c while(n-- > 0){ n 32 string.c memmove(void *dst, const void *src, uint n) n 39 string.c if(s < d && s + n > d){ n 40 string.c s += n; n 41 string.c d += n; n 42 string.c while(n-- > 0) n 45 string.c while(n-- > 0) n 53 string.c memcpy(void *dst, const void *src, uint n) n 55 string.c return memmove(dst, src, n); n 59 string.c strncmp(const char *p, const char *q, uint n) n 61 string.c while(n > 0 && *p && *p == *q) n 62 string.c n--, p++, q++; n 63 string.c if(n == 0) n 69 string.c strncpy(char *s, const char *t, int n) n 74 string.c while(n-- > 0 && (*s++ = *t++) != 0) n 76 string.c while(n-- > 0) n 83 string.c safestrcpy(char *s, const char *t, int n) n 88 string.c if(n <= 0) n 90 string.c while(--n > 0 && (*s++ = *t++) != 0) n 99 string.c int n; n 101 string.c for(n = 0; s[n]; n++) n 103 string.c return n; n 46 syscall.c argint(int n, int *ip) n 48 syscall.c return fetchint(proc->tf->esp + 4 + 4*n, ip); n 55 syscall.c argptr(int n, char **pp, int size) n 59 syscall.c if(argint(n, &i) < 0) n 72 syscall.c argstr(int n, char **pp) n 75 syscall.c if(argint(n, &addr) < 0) n 20 sysfile.c argfd(int n, int *pfd, struct file **pf) n 25 sysfile.c if(argint(n, &fd) < 0) n 70 sysfile.c int n; n 73 sysfile.c if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) n 75 sysfile.c return fileread(f, p, n); n 82 sysfile.c int n; n 85 sysfile.c if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) n 87 sysfile.c return filewrite(f, p, n); n 49 sysproc.c int n; n 51 sysproc.c if(argint(0, &n) < 0) n 54 sysproc.c if(growproc(n) < 0) n 62 sysproc.c int n; n 65 sysproc.c if(argint(0, &n) < 0) n 69 sysproc.c while(ticks - ticks0 < n){ n 29 ulib.c int n; n 31 ulib.c for(n = 0; s[n]; n++) n 33 ulib.c return n; n 37 ulib.c memset(void *dst, int c, uint n) n 39 ulib.c stosb(dst, c, n); n 71 ulib.c stat(char *n, struct stat *st) n 76 ulib.c fd = open(n, O_RDONLY); n 87 ulib.c int n; n 89 ulib.c n = 0; n 91 ulib.c n = n*10 + *s++ - '0'; n 92 ulib.c return n; n 96 ulib.c memmove(void *vdst, void *vsrc, int n) n 102 ulib.c while(n-- > 0) n 190 usertests.c int i, fd, n; n 216 usertests.c n = 0; n 220 usertests.c if(n == MAXFILE - 1){ n 221 usertests.c printf(stdout, "read only %d blocks from big", n); n 229 usertests.c if(((int*)buf)[0] != n){ n 231 usertests.c n, ((int*)buf)[0]); n 234 usertests.c n++; n 309 usertests.c int seq, i, n, cc, total; n 319 usertests.c for(n = 0; n < 5; n++){ n 332 usertests.c while((n = read(fds[0], buf, cc)) > 0){ n 333 usertests.c for(i = 0; i < n; i++){ n 339 usertests.c total += n; n 467 usertests.c int fd, pid, i, n, nc, np; n 497 usertests.c while((n = read(fd, buf, sizeof(buf))) > 0){ n 520 usertests.c int fd, pid, i, j, n, total, pi; n 545 usertests.c if((n = write(fd, buf, 500)) != 500){ n 546 usertests.c printf(1, "write failed %d\n", n); n 562 usertests.c while((n = read(fd, buf, sizeof(buf))) > 0){ n 563 usertests.c for(j = 0; j < n; j++){ n 569 usertests.c total += n; n 768 usertests.c int i, pid, n, fd; n 802 usertests.c n = 0; n 817 usertests.c n++; n 822 usertests.c if(n != 40){ n 1382 usertests.c int n, pid; n 1386 usertests.c for(n=0; n<1000; n++){ n 1394 usertests.c if(n == 1000){ n 1399 usertests.c for(; n > 0; n--){ n 199 vm.c uint i, pa, n; n 209 vm.c n = sz - i; n 211 vm.c n = PGSIZE; n 212 vm.c if(readi(ip, p2v(pa), offset+i, n) != n) n 361 vm.c uint n, va0; n 369 vm.c n = PGSIZE - (va - va0); n 370 vm.c if(n > len) n 371 vm.c n = len; n 372 vm.c memmove(pa0 + (va - va0), buf, n); n 373 vm.c len -= n; n 374 vm.c buf += n; n 10 wc.c int i, n; n 15 wc.c while((n = read(fd, buf, sizeof(buf))) > 0){ n 16 wc.c for(i=0; i<n; i++){ n 28 wc.c if(n < 0){