Home
last modified time | relevance | path

Searched refs:toybuf (Results 1 – 25 of 136) sorted by relevance

123456

/external/toybox/toys/pending/
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), "'%d': %s\n", lno, line); in parse_crontab()
179 snprintf(toybuf, sizeof(toybuf), "'%d': bad minute\n", lno); in parse_crontab()
183 snprintf(toybuf, sizeof(toybuf), "'%d': bad hour\n", lno); in parse_crontab()
187 snprintf(toybuf, sizeof(toybuf), "'%d': bad day-of-month\n", lno); in parse_crontab()
191 snprintf(toybuf, sizeof(toybuf), "'%d': bad month\n", lno); in parse_crontab()
195 snprintf(toybuf, sizeof(toybuf), "'%d': bad day-of-week\n", lno); in parse_crontab()
[all …]
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()
197 memset(toybuf, 0, sizeof(toybuf)); in stop_logging()
198 strftime(toybuf, sizeof(toybuf), "%a %b %e %H:%M:%S %Z %Y", &st); in stop_logging()
200 fprintf(hdr_fp, "title = Boot chart for %s (%s)\n", host_name, toybuf); in stop_logging()
204 memset(toybuf, 0, sizeof(toybuf)); in stop_logging()
208 if ((len = readall(kcmd_line_fd, toybuf, sizeof(toybuf)-1)) > 0) { in stop_logging()
209 toybuf[len] = 0; in stop_logging()
[all …]
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, toybuf+18, toybuf+28); in last_main()
161 strcpy(toybuf+18, " still"); in last_main()
162 strcpy(toybuf+28, "logged in"); in last_main()
165 strcpy(toybuf+18, "- down "); in last_main()
168 strcpy(toybuf+18, "- crash"); in last_main()
[all …]
Dwget.c147 strcat(toybuf, name); in mk_fld()
148 strcat(toybuf, ": "); in mk_fld()
149 strcat(toybuf, value); in mk_fld()
150 strcat(toybuf, "\r\n"); in mk_fld()
158 if (!strncmp(toybuf+i, "\r\n\r\n", 4)) break; in get_body()
161 return toybuf+i+4; in get_body()
182 sprintf(toybuf, "GET %s HTTP/1.1\r\n", path); in wget_main()
186 strcat(toybuf, "\r\n"); in wget_main()
189 len = strlen(toybuf); in wget_main()
190 if (write(sock, toybuf, len) != len) perror_exit("write error"); in wget_main()
[all …]
Dchsh.c48 if (mlock(toybuf, sizeof(toybuf))) perror_exit("mlock");
50 if (read_password(toybuf, sizeof(toybuf), "Password: ")) perror_exit("woaj"); //xexit();
51 if (!(encrypted = crypt(toybuf, shadow_info->sp_pwdp))) perror_exit("crypt");
52 memset(toybuf, 0, sizeof(toybuf));
53 munlock(toybuf, sizeof(toybuf)); // prevents memset from "optimizing" away.
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, mode | type, dev_makedev(major, minor)) && in make_device()
[all …]
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()
316 snprintf(toybuf, sizeof(toybuf), "/proc/%d/fd/%s", pi->pid, path); in visit_symlink()
320 fill_stat(fi, toybuf); in visit_symlink()
322 fi->name = xreadlink(toybuf); in visit_symlink()
324 fi->name = xmprintf("%s (readlink: %s)", toybuf, strerror(errno)); in visit_symlink()
338 snprintf(toybuf, sizeof(toybuf), "/proc/%d/maps", pi->pid); in visit_maps()
339 fp = fopen(toybuf, "r"); in visit_maps()
368 snprintf(toybuf, sizeof(toybuf), "/proc/%d/fd", pi->pid); in visit_fds()
[all …]
/external/toybox/toys/other/
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()
87 if (!read_password(toybuf, sizeof(toybuf), "Password: ")) { in login_main()
88 int x = pass && (ss = crypt(toybuf, pass)) && !strcmp(pass, ss); in login_main()
91 memset(toybuf, 0, sizeof(toybuf)); in login_main()
111 ss = readfile("/etc/nologin", toybuf, sizeof(toybuf)); in login_main()
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[uoff+3], toybuf[uoff+2], in do_blkid()
176 toybuf[uoff+1], toybuf[uoff]); in do_blkid()
[all …]
Ddos2unix.c44 len = read(fd, toybuf+(sizeof(toybuf)/2), sizeof(toybuf)/2);
49 char x = toybuf[in+sizeof(toybuf)/2];
53 if (c == 'u' || x != '\n') toybuf[out++] = '\r';
56 } else if (c == 'u' && x == '\n') toybuf[out++] = '\r';
59 else toybuf[out++] = x;
61 xwrite(outfd, toybuf, out);
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, '-', 16); in pmap_main()
104 toybuf); in pmap_main()
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()
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()
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()
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, cur, max); in cool_callback()
/external/toybox/toys/posix/
Dcpio.c122 if (1>(len = readall(afd, toybuf+size, 110-size))) break; in cpio_main()
123 if (size || *toybuf) { in cpio_main()
127 for (size = 0; size<len; size++) if (toybuf[size]) break; in cpio_main()
128 memmove(toybuf, toybuf+size, len-size); in cpio_main()
135 if (size != 110 || memcmp(toybuf, "070701", 6)) error_exit("bad header"); in cpio_main()
136 tofree = name = strpad(afd, x8u(toybuf+94), 110); in cpio_main()
146 size = x8u(toybuf+54); in cpio_main()
147 mode = x8u(toybuf+14); in cpio_main()
148 uid = x8u(toybuf+22); in cpio_main()
149 gid = x8u(toybuf+30); in cpio_main()
[all …]
Dkill.c120 snprintf(toybuf, sizeof(toybuf), "/proc/%d/stat", procpid);
121 if (!readfile(toybuf, toybuf, sizeof(toybuf))) continue;
122 if (sscanf(toybuf, "%*d %*s %*c %*d %*d %d", &procsid) != 1) continue;
126 snprintf(toybuf, sizeof(toybuf), "/proc/%d/cmdline", procpid);
127 if (!readfile(toybuf, toybuf, sizeof(toybuf)) || !*toybuf) continue;
Dfile.c36 int endian = toybuf[5], bits = toybuf[4], i, j, dynamic = 0, stripped = 1,
46 i = elf_int(toybuf+16, 2);
52 if (elf_int(toybuf+36+12*(bits==2), 4) & 0x8000) printf(" (fdpic)");
72 printf("%s", elf_arch_name(elf_int(toybuf+18, 2)));
88 phentsize = elf_int(toybuf+42+12*bits, 2);
89 phnum = elf_int(toybuf+44+12*bits, 2);
90 phoff = elf_int(toybuf+28+4*bits, 4+4*bits);
91 shsize = elf_int(toybuf+46+12*bits, 2);
92 shnum = elf_int(toybuf+48+12*bits, 2);
93 shoff = elf_int(toybuf+32+8*bits, 4+4*bits);
[all …]
Dstrings.c54 nread = read(fd, toybuf, sizeof(toybuf));
64 if ((toybuf[i]>=32 && toybuf[i]<=126) || toybuf[i]=='\t') {
65 if (count == wlen) fputc(toybuf[i], stdout);
67 string[count++] = toybuf[i];
/external/toybox/toys/lsb/
Dhostname.c43 char *hostname = toybuf, *dot;
46 gethostname(toybuf, sizeof(toybuf)-1);
53 } else hostname = (FLAG(b) && !*toybuf) ? "localhost" : *toys.optargs;
64 if (!(h = gethostbyname(toybuf)))
66 snprintf(toybuf, sizeof(toybuf), "%s", h->h_name);
68 dot = toybuf+strcspn(toybuf, ".");
70 xputs(FLAG(d) ? dot+1 : toybuf);
Dseq.c75 if (ss-toybuf<TT.buflen) return ss; in flush_toybuf()
76 xwrite(1, toybuf, ss-toybuf); in flush_toybuf()
78 return toybuf; in flush_toybuf()
105 TT.buflen = sizeof(toybuf) - 32 - len - TT.precision - strlen(TT.s); in seq_main()
113 ss = toybuf; in seq_main()
118 if (ss != toybuf) xwrite(1, toybuf, ss-toybuf); in seq_main()
129 for (ii = 0, ss = toybuf;; ii++) { in seq_main()
137 xwrite(1, toybuf, ss-toybuf); in seq_main()
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()
Dmd5sum.c276 i = read(fd, toybuf, sizeof(toybuf)); in do_lib_hash()
278 hash->update(&ctx, toybuf, i); in do_lib_hash()
280 hash->final(toybuf+128, &ctx); in do_lib_hash()
283 sprintf(toybuf+2*i, "%02x", toybuf[i+128]); in do_lib_hash()
305 i = read(fd, toybuf, sizeof(toybuf)); in do_builtin_hash()
307 hash_update(toybuf, i, transform); in do_builtin_hash()
329 sprintf(toybuf+2*i, "%02x", 255&(TT.state[i>>2] >> ((3-(i & 3)) * 8))); in do_builtin_hash()
330 else for (i=0; i<4; i++) sprintf(toybuf+8*i, "%08x", bswap_32(TT.state[i])); in do_builtin_hash()
337 i = strlen(toybuf)+1; in do_builtin_hash()
338 memset(toybuf+i, 0, sizeof(toybuf)-i); in do_builtin_hash()
[all …]
/external/toybox/toys/net/
Dnetstat.c103 fgets(toybuf, sizeof(toybuf), fp); in show_ip()
105 while (fgets(toybuf, sizeof(toybuf), fp)) { in show_ip()
115 if (16 != sscanf(toybuf, in show_ip()
123 if (10 != sscanf(toybuf, in show_ip()
150 if (FLAG(n)) sprintf(s = toybuf, "%d", uid); in show_ip()
173 fgets(toybuf, sizeof(toybuf), fp); in show_unix_sockets()
190 sprintf(toybuf, "[ %s]", flags ? "ACC " : ""); in show_unix_sockets()
192 refcount, toybuf, types[type], states[state], inode); in show_unix_sockets()
210 char *s = toybuf+256; in scan_pids()
218 sprintf(toybuf, "/proc/%d/cmdline", pid); in scan_pids()
[all …]
Dsntp.c75 unsigned long long *pktime = (void *)toybuf, now, then, before = before; in sntp_main()
126 memset(toybuf, 0, 48); in sntp_main()
127 *toybuf = 0xe3; // li = 3 (unsynchronized), version = 4, mode = 3 (client) in sntp_main()
128 toybuf[2] = 8; // poll frequency 1<<8 = 256 seconds in sntp_main()
130 xsendto(fd, toybuf, 48, ai->ai_addr); in sntp_main()
140 strike = xrecvwait(fd, toybuf, sizeof(toybuf), &sa, then-now); in sntp_main()
151 int mode = 7&*toybuf; in sntp_main()
166 char *buf = toybuf+48; in sntp_main()
222 format_iso_time(toybuf, sizeof(toybuf)-1, &tv2); in sntp_main()
223 printf("%s offset %c%lld.%09lld secs\n", toybuf, (diff<0) ? '-' : '+', in sntp_main()

123456