Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 20 of 20) sorted by relevance

/xv6-public/
H A Dls.c9 static char buf[DIRSIZ+1]; in fmtname() local
20 memmove(buf, p, strlen(p)); in fmtname()
21 memset(buf+strlen(p), ' ', DIRSIZ-strlen(p)); in fmtname()
22 return buf; in fmtname()
28 char buf[512], *p; in ls() local
50 if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){ in ls()
54 strcpy(buf, path); in ls()
55 p = buf+strlen(buf); in ls()
62 if(stat(buf, &st) < 0){ in ls()
63 printf(1, "ls: cannot stat %s\n", buf); in ls()
[all …]
H A Dmkfs.c73 char buf[BSIZE]; in main() local
113 memset(buf, 0, sizeof(buf)); in main()
115 wsect(1, buf); in main()
152 while((cc = read(fd, buf, sizeof(buf))) > 0) in main()
186 char buf[BSIZE]; in winode() local
191 rsect(bn, buf); in winode()
194 wsect(bn, buf); in winode()
200 char buf[BSIZE]; in rinode() local
205 rsect(bn, buf); in rinode()
247 buf[i/8] = buf[i/8] | (0x1 << (i%8)); in balloc()
[all …]
H A Dsign.pl5 $n = sysread(SIG, $buf, 1000);
14 $buf .= "\0" x (510-$n);
15 $buf .= "\x55\xAA";
18 print SIG $buf;
H A Dbio.c31 struct buf buf[NBUF]; member
35 struct buf head;
41 struct buf *b; in binit()
49 for(b = bcache.buf; b < bcache.buf+NBUF; b++){ in binit()
61 static struct buf*
64 struct buf *b; in bget()
96 struct buf*
99 struct buf *b; in bread()
110 bwrite(struct buf *b) in bwrite()
121 brelse(struct buf *b) in brelse()
H A Dbuf.h1 struct buf { struct
7 struct buf *prev; // LRU cache list argument
8 struct buf *next; argument
9 struct buf *qnext; // disk queue argument
H A Dgrep.c7 char buf[1024]; variable
17 while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){ in grep()
19 buf[m] = '\0'; in grep()
20 p = buf; in grep()
29 if(p == buf) in grep()
32 m -= p - buf; in grep()
33 memmove(buf, p, m); in grep()
H A Dlog.c75 struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block in install_trans()
76 struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst in install_trans()
88 struct buf *buf = bread(log.dev, log.start); in read_head() local
89 struct logheader *lh = (struct logheader *) (buf->data); in read_head()
95 brelse(buf); in read_head()
104 struct buf *buf = bread(log.dev, log.start); in write_head() local
105 struct logheader *hb = (struct logheader *) (buf->data); in write_head()
111 bwrite(buf); in write_head()
112 brelse(buf); in write_head()
183 struct buf *to = bread(log.dev, log.start+tail+1); // log block in write_log()
[all …]
H A Dwc.c5 char buf[512]; variable
15 while((n = read(fd, buf, sizeof(buf))) > 0){ in wc()
18 if(buf[i] == '\n') in wc()
20 if(strchr(" \r\t\n\v", buf[i])) in wc()
H A Dcat.c5 char buf[512]; variable
12 while((n = read(fd, buf, sizeof(buf))) > 0) { in cat()
13 if (write(1, buf, n) != n) { in cat()
H A Dusertests.c11 char buf[8192]; variable
387 if(read(pfds[0], buf, sizeof(buf)) != 1){ in preempt()
479 memset(buf, pid==0?'c':'p', sizeof(buf)); in sharedfd()
481 if(write(fd, buf, sizeof(buf)) != sizeof(buf)){ in sharedfd()
497 while((n = read(fd, buf, sizeof(buf))) > 0){ in sharedfd()
562 while((n = read(fd, buf, sizeof(buf))) > 0){ in fourfiles()
684 if(read(fd, buf, sizeof(buf)) != 5){ in unlinkread()
738 if(read(fd, buf, sizeof(buf)) != 5){ in linktest()
978 cc = read(fd, buf, sizeof(buf)); in subdir()
1021 if(read(fd, buf, sizeof(buf)) != 2){ in subdir()
[all …]
H A Dide.c32 static struct buf *idequeue;
35 static void idestart(struct buf*);
74 idestart(struct buf *b) in idestart()
106 struct buf *b; in ideintr()
138 iderw(struct buf *b) in iderw()
140 struct buf **pp; in iderw()
H A Dconsole.c31 char buf[16]; in printint() local
42 buf[i++] = digits[x % base]; in printint()
46 buf[i++] = '-'; in printint()
49 consputc(buf[i]); in printint()
183 char buf[INPUT_BUF]; member
205 input.buf[(input.e-1) % INPUT_BUF] != '\n'){ in consoleintr()
219 input.buf[input.e++ % INPUT_BUF] = c; in consoleintr()
253 c = input.buf[input.r++ % INPUT_BUF]; in consoleread()
274 consolewrite(struct inode *ip, char *buf, int n) in consolewrite() argument
281 consputc(buf[i] & 0xff); in consolewrite()
H A Dprintf.c15 char buf[16]; in printint() local
29 buf[i++] = digits[x % base]; in printint()
32 buf[i++] = '-'; in printint()
35 putc(fd, buf[i]); in printint()
H A Dulib.c53 gets(char *buf, int max) in gets() argument
62 buf[i++] = c; in gets()
66 buf[i] = '\0'; in gets()
67 return buf; in gets()
H A Dsh.c134 getcmd(char *buf, int nbuf) in getcmd() argument
137 memset(buf, 0, nbuf); in getcmd()
138 gets(buf, nbuf); in getcmd()
139 if(buf[0] == 0) // EOF in getcmd()
147 static char buf[100]; in main() local
159 while(getcmd(buf, sizeof(buf)) >= 0){ in main()
160 if(buf[0] == 'c' && buf[1] == 'd' && buf[2] == ' '){ in main()
162 buf[strlen(buf)-1] = 0; // chop \n in main()
163 if(chdir(buf+3) < 0) in main()
164 printf(2, "cannot cd %s\n", buf+3); in main()
[all …]
H A Ddefs.h1 struct buf;
15 struct buf* bread(uint, uint);
16 void brelse(struct buf*);
17 void bwrite(struct buf*);
59 void iderw(struct buf*);
86 void log_write(struct buf*);
H A Dfs.c34 struct buf *bp; in readsb()
45 struct buf *bp; in bzero()
60 struct buf *bp; in balloc()
84 struct buf *bp; in bfree()
198 struct buf *bp; in ialloc()
223 struct buf *bp; in iupdate()
290 struct buf *bp; in ilock()
376 struct buf *bp; in bmap()
411 struct buf *bp; in itrunc()
456 struct buf *bp; in readi()
[all …]
H A Dmemide.c39 iderw(struct buf *b) in iderw()
H A Dvm.c368 char *buf, *pa0; in copyout() local
371 buf = (char*)p; in copyout()
380 memmove(pa0 + (va - va0), buf, n); in copyout()
382 buf += n; in copyout()
H A Drunoff.list38 buf.h