Home
last modified time | relevance | path

Searched refs:toybuf (Results 1 - 25 of 146) sorted by relevance

123456

/third_party/toybox/toys/pending/
H A Dcrontab.c128 snprintf(toybuf, sizeof(toybuf), "'%d': premature EOF\n", lno); in parse_crontab()
148 snprintf(toybuf, sizeof(toybuf), "'%d': %s\n", lno, line); in parse_crontab()
159 snprintf(toybuf, sizeof(toybuf), "'%d': %s\n", lno, line); in parse_crontab()
165 snprintf(toybuf, sizeof(toybuf), "'%d': %s\n", lno, line); in parse_crontab()
173 snprintf(toybuf, sizeof(toybuf), "' in parse_crontab()
[all...]
H A Dbootchartd.c70 if ((len = readall(fd, toybuf, sizeof(toybuf)-1)) < 0) { in dump_proc_data()
74 toybuf[len] = '\0'; in dump_proc_data()
76 fputs(toybuf, fp); in dump_proc_data()
78 if ((ptr = strchr(toybuf, '('))) { in dump_proc_data()
183 memset(toybuf, 0, sizeof(toybuf)); in stop_logging()
184 strftime(toybuf, sizeof(toybuf), "%a %b %e %H:%M:%S %Z %Y", &st); in stop_logging()
186 fprintf(hdr_fp, "title = Boot chart for %s (%s)\n", host_name, toybuf); in stop_logging()
[all...]
H A Dwget.c288 sprintf(toybuf, "GET /%s HTTP/1.1\r\nHost: %s\r\n" in wget_main()
291 if (FLAG(d)) printf("--- Request\n%s", toybuf); in wget_main()
294 wget_write(toybuf, strlen(toybuf)); in wget_main()
296 // Greedily read the HTTP response until either complete or toybuf is full in wget_main()
297 index = toybuf; in wget_main()
298 while ((len = wget_read(index, sizeof(toybuf) - (index - toybuf))) > 0) in wget_main()
302 // Valid ranges toybuf[0...index) valid length is (index - toybuf) in wget_main()
[all...]
H A Dlast.c78 toybuf[0] = toybuf[18] = toybuf[28] = '\0'; in seize_duration()
79 strncpy(toybuf, ctime(&tm0), 16); // Login Time. in seize_duration()
80 snprintf(toybuf+18, 8, "- %s", ctime(&tm1) + 11); // Logout Time. in seize_duration()
84 sprintf(toybuf+28, "(%u+%02u:%02u)", days, hours, mins); // Duration. in seize_duration()
138 toybuf, toybuf+18, toybuf+28); in last_main()
149 toybuf, toybu in last_main()
[all...]
H A Dchsh.c48 if (mlock(toybuf, sizeof(toybuf))) perror_exit("mlock"); in chsh_main()
50 if (read_password(toybuf, sizeof(toybuf), "Password: ")) perror_exit("woaj"); //xexit(); in chsh_main()
51 if (!(encrypted = crypt(toybuf, shadow_info->sp_pwdp))) perror_exit("crypt"); in chsh_main()
52 memset(toybuf, 0, sizeof(toybuf)); in chsh_main()
53 munlock(toybuf, sizeof(toybuf)); // prevents memset from "optimizing" away. in chsh_main()
H A Dmdev.c53 len = read(fd, toybuf, 64); in make_device()
56 toybuf[len] = 0; in make_device()
61 sscanf(toybuf, "%u:%u", &major, &minor); in make_device()
226 sprintf(toybuf, "/dev/%s", custom_name); in make_device()
229 dir = opendir(toybuf); in make_device()
231 else mkdir(toybuf, 0755); in make_device()
235 sprintf(toybuf, "/dev/%s", device_name); in make_device()
238 unlink(toybuf); in make_device()
242 if (strchr(device_name, '/')) mkpath(toybuf); in make_device()
243 if (mknod(toybuf, mod in make_device()
[all...]
H A Dlsof.c94 snprintf(toybuf, sizeof(toybuf), "/proc/%d/fdinfo/%s", fi->pi.pid, fi->fd); in fill_flags()
95 fp = fopen(toybuf, "r"); in fill_flags()
312 snprintf(toybuf, sizeof(toybuf), "/proc/%d/%s", pi->pid, path); in visit_symlink()
315 fill_flags(fi); // Clobbers toybuf. in visit_symlink()
316 snprintf(toybuf, sizeof(toybuf), "/proc/%d/fd/%s", pi->pid, path); in visit_symlink()
319 // rely on toybuf being preserved here. in visit_symlink()
320 fill_stat(fi, toybuf); in visit_symlink()
[all...]
/third_party/toybox/toys/posix/
H A Dcpio.c115 if (!(size =readall(afd, toybuf, 110))) break; in cpio_main()
116 if (size != 110 || memcmp(toybuf, "070701", 6)) error_exit("bad header"); in cpio_main()
117 tofree = name = strpad(afd, x8u(toybuf+94), 110); in cpio_main()
127 size = x8u(toybuf+54); in cpio_main()
128 mode = x8u(toybuf+14); in cpio_main()
129 uid = x8u(toybuf+22); in cpio_main()
130 gid = x8u(toybuf+30); in cpio_main()
131 timestamp = x8u(toybuf+46); // unsigned 32 bit, so year 2100 problem in cpio_main()
162 data = toybuf; in cpio_main()
164 if (size < sizeof(toybuf)) dat in cpio_main()
[all...]
H A Dkill.c120 snprintf(toybuf, sizeof(toybuf), "/proc/%d/stat", procpid); in kill_main()
121 if (!readfile(toybuf, toybuf, sizeof(toybuf))) continue; in kill_main()
122 if (sscanf(toybuf, "%*d %*s %*c %*d %*d %d", &procsid) != 1) continue; in kill_main()
126 snprintf(toybuf, sizeof(toybuf), "/proc/%d/cmdline", procpid); in kill_main()
127 if (!readfile(toybuf, toybuf, sizeo in kill_main()
[all...]
H A Dfile.c36 int endian = toybuf[5], bits = toybuf[4], i, j, dynamic = 0, stripped = 1, in do_elf_file()
61 i = elf_int(toybuf+16, 2); in do_elf_file()
67 if (elf_int(toybuf+36+12*(bits==2), 4) & 0x8000) printf(" (fdpic)"); in do_elf_file()
87 j = elf_int(toybuf+18, 2); in do_elf_file()
105 // Stash what we need from the header; it's okay to reuse toybuf after this. in do_elf_file()
106 phentsize = elf_int(toybuf+42+12*bits, 2); in do_elf_file()
107 phnum = elf_int(toybuf+44+12*bits, 2); in do_elf_file()
108 phoff = elf_int(toybuf+28+4*bits, 4+4*bits); in do_elf_file()
109 shsize = elf_int(toybuf in do_elf_file()
[all...]
H A Dstrings.c54 nread = read(fd, toybuf, sizeof(toybuf)); in do_strings()
64 if ((toybuf[i]>=32 && toybuf[i]<=126) || toybuf[i]=='\t') { in do_strings()
65 if (count == wlen) fputc(toybuf[i], stdout); in do_strings()
67 string[count++] = toybuf[i]; in do_strings()
/third_party/toybox/toys/other/
H A Dlogin.c58 if (gethostname(toybuf, sizeof(toybuf)-1)) *toybuf = 0; in login_main()
59 printf("%s%slogin: ", *toybuf ? toybuf : "", *toybuf ? " " : ""); in login_main()
62 if(!fgets(toybuf, sizeof(toybuf)-1, stdin)) xexit(); in login_main()
65 for (ss = toybuf; *ss; ss++) if (*ss<=' ' || *ss==':') break; in login_main()
67 if (!*(username = toybuf)) { in login_main()
[all...]
H A Dblkid.c97 len = readall(fd, toybuf, sizeof(toybuf)); in do_blkid()
98 if (len != sizeof(toybuf)) return; in do_blkid()
105 if (fstypes[i].magic_offset > off+sizeof(toybuf)) { in do_blkid()
114 test += ((uint64_t)toybuf[j+fstypes[i].magic_offset-off])<<(8*j); in do_blkid()
129 if (toybuf[1116]&4) type = "ext3"; in do_blkid()
130 if (toybuf[1120]&64) type = "ext4"; in do_blkid()
144 s = toybuf+fstypes[i].label_off-off; in do_blkid()
173 for (j = 7; j >= 0; --j) s += sprintf(s, "%02X", toybuf[uoff+j]); in do_blkid()
175 s += sprintf(s, "%02X%02X-%02X%02X", toybuf[uof in do_blkid()
[all...]
H A Ddos2unix.c44 len = read(fd, toybuf+(sizeof(toybuf)/2), sizeof(toybuf)/2); in do_dos2unix()
49 char x = toybuf[in+sizeof(toybuf)/2]; in do_dos2unix()
53 if (c == 'u' || x != '\n') toybuf[out++] = '\r'; in do_dos2unix()
56 } else if (c == 'u' && x == '\n') toybuf[out++] = '\r'; in do_dos2unix()
59 else toybuf[out++] = x; in do_dos2unix()
61 xwrite(outfd, toybuf, out); in do_dos2unix()
H A Dpmap.c39 snprintf(toybuf, sizeof(toybuf), "/proc/%u/cmdline", pid); in pmap_main()
40 line = readfile(toybuf, 0, 0); in pmap_main()
47 sprintf(toybuf, "/proc/%u/%smaps", pid, in pmap_main()
49 if (!(fp = fopen(toybuf, "r"))) { in pmap_main()
65 &start, &end, toybuf, &off); in pmap_main()
69 if (toybuf[3] == 'p') toybuf[3] = '-'; in pmap_main()
92 xprintf("%s- %s%s", toybuf, line[off]=='[' ? " " : "", name); in pmap_main()
102 memset(toybuf, ' in pmap_main()
[all...]
H A Dmkpasswd.c64 if (read_password(toybuf, sizeof(toybuf), "Password: ")) in mkpasswd_main()
67 for (i = 0; i<sizeof(toybuf)-1; i++) { in mkpasswd_main()
68 if (!xread(0, toybuf+i, 1)) break; in mkpasswd_main()
69 if (toybuf[i] == '\n' || toybuf[i] == '\r') break; in mkpasswd_main()
71 toybuf[i] = 0; in mkpasswd_main()
76 xprintf("%s\n",crypt(*toys.optargs ? *toys.optargs : toybuf, salt)); in mkpasswd_main()
H A Dlsusb.c27 sprintf(toybuf, "%s/uevent", name); in list_device()
28 file = fopen(toybuf, "r"); in list_device()
32 while (fgets(toybuf, sizeof(toybuf), file)) in list_device()
33 if (sscanf(toybuf, "BUSNUM=%u\n", &busnum) in list_device()
34 || sscanf(toybuf, "DEVNUM=%u\n", &devnum) in list_device()
35 || sscanf(toybuf, "PRODUCT=%x/%x/", &pid, &vid)) count++; in list_device()
H A Dacpi.c57 len = readall(fd, toybuf, sizeof(toybuf)); in acpi_callback()
61 if (!strncmp(toybuf, "Battery", 7)) { in acpi_callback()
113 memset(toybuf, 0, sizeof(toybuf)); in cool_callback()
121 if (readfile(TT.cpath, toybuf, 256) && !errno) { in cool_callback()
122 toybuf[strlen(toybuf) -1] = 0; in cool_callback()
126 printf("Cooling %d: %s no state information\n", TT.cool++, toybuf); in cool_callback()
127 else printf("Cooling %d: %s %d of %d\n", TT.cool++, toybuf, cu in cool_callback()
[all...]
H A Dtaskset.c48 unsigned long *mask = (unsigned long *)toybuf; in do_taskset()
54 int j = sizeof(toybuf), flag = 0; in do_taskset()
56 if (-1 == sched_getaffinity(pid, sizeof(toybuf), (void *)mask)) in do_taskset()
75 memset(toybuf, 0, sizeof(toybuf)); in do_taskset()
86 if (-1 == sched_setaffinity(pid, sizeof(toybuf), (void *)mask)) in do_taskset()
124 if (!toys.optflags && -1!=sched_getaffinity(getpid(), 4096, toybuf)) { in nproc_main()
126 if (toybuf[i]) for (j=0; j<8; j++) if (toybuf[i]&(1<<j)) nproc++; in nproc_main()
/third_party/toybox/toys/lsb/
H A Dhostname.c43 char *hostname = toybuf, *dot; in hostname_main()
46 gethostname(toybuf, sizeof(toybuf)-1); in hostname_main()
53 } else hostname = (FLAG(b) && !*toybuf) ? "localhost" : *toys.optargs; in hostname_main()
64 if (!(h = gethostbyname(toybuf))) in hostname_main()
66 snprintf(toybuf, sizeof(toybuf), "%s", h->h_name); in hostname_main()
68 dot = toybuf+strcspn(toybuf, "."); in hostname_main()
70 xputs(FLAG(d) ? dot+1 : toybuf); in hostname_main()
[all...]
H A Dpasswd.c93 if (read_password(toybuf+2048, 2048, "Old password:")) return; in passwd_main()
94 pass = crypt(toybuf+2048, pw->pw_passwd); in passwd_main()
98 if (read_password(toybuf, 2048, "New password:")) return; in passwd_main()
100 if (CFG_PASSWD_SAD) weak_check(toybuf, toybuf+2048, name); in passwd_main()
101 if (read_password(toybuf+2048, 2048, "Retype password:")) return; in passwd_main()
102 if (strcmp(toybuf, toybuf+2048)) error_exit("Passwords do not match."); in passwd_main()
104 encrypted = crypt(toybuf, salt); in passwd_main()
/third_party/toybox/toys/net/
H A Dnetstat.c118 if(!fgets(toybuf, sizeof(toybuf), fp)) return; //skip header. in show_ip()
120 while (fgets(toybuf, sizeof(toybuf), fp)) { in show_ip()
130 nitems = sscanf(toybuf, in show_ip()
138 nitems = sscanf(toybuf, in show_ip()
167 snprintf(toybuf, sizeof(toybuf), "%s", pw->pw_name); in show_ip()
168 else snprintf(toybuf, sizeof(toybuf), " in show_ip()
[all...]
H A Dsntp.c73 unsigned long long *pktime = (void *)toybuf, now, then, before = before; in sntp_main()
119 memset(toybuf, 0, 48); in sntp_main()
120 *toybuf = 0xe3; // li = 3 (unsynchronized), version = 4, mode = 3 (client) in sntp_main()
121 toybuf[2] = 8; // poll frequency 1<<8 = 256 seconds in sntp_main()
123 xsendto(fd, toybuf, 48, ai->ai_addr); in sntp_main()
133 strike = xrecvwait(fd, toybuf, sizeof(toybuf), &sa, then-now); in sntp_main()
144 int mode = 7&*toybuf; in sntp_main()
159 char *buf = toybuf+48; in sntp_main()
216 format_iso_time(toybuf, sizeo in sntp_main()
[all...]
H A Dftpget.c65 __LINE__, len, total, i, toybuf); in xread2line()
73 __LINE__, len, total, toybuf); in xread2line()
88 if (toys.optflags & FLAG_v) fprintf(stderr, "%s\n", toybuf); in xread2line()
103 xread2line(TT.fd, toybuf, sizeof(toybuf)); in ftp_line()
104 if (!sscanf(toybuf, "%d", &rc) || (must && rc != must)) { in ftp_line()
106 __LINE__, must, rc, toybuf); in ftp_line()
116 error_exit_raw(toybuf); in ftp_line()
152 __LINE__, rc, toybuf); in ftpget_main()
156 error_exit_raw(toybuf); in ftpget_main()
[all...]
/third_party/toybox/porting/liteos_a/toys/posix/
H A Dkill.c114 snprintf(toybuf, sizeof(toybuf), "/proc/%d/stat", procpid); in kill_main()
115 if (!readfile(toybuf, toybuf, sizeof(toybuf))) continue; in kill_main()
116 if (sscanf(toybuf, "%*d %*s %*c %*d %*d %d", &procsid) != 1) continue; in kill_main()
120 snprintf(toybuf, sizeof(toybuf), "/proc/%d/cmdline", procpid); in kill_main()
121 if (!readfile(toybuf, toybuf, sizeo in kill_main()
[all...]

Completed in 8 milliseconds

123456