/external/toybox/toys/pending/ |
D | crontab.c | 126 snprintf(toybuf, sizeof(toybuf), "'%d': premature EOF\n", lno); in parse_crontab() 146 snprintf(toybuf, sizeof(toybuf), "'%d': %s\n", lno, line); in parse_crontab() 157 snprintf(toybuf, sizeof(toybuf), "'%d': %s\n", lno, line); in parse_crontab() 163 snprintf(toybuf, sizeof(toybuf), "'%d': %s\n", lno, line); in parse_crontab() 171 snprintf(toybuf, sizeof(toybuf), "'%d': %s\n", lno, line); in parse_crontab() 177 snprintf(toybuf, sizeof(toybuf), "'%d': bad minute\n", lno); in parse_crontab() 181 snprintf(toybuf, sizeof(toybuf), "'%d': bad hour\n", lno); in parse_crontab() 185 snprintf(toybuf, sizeof(toybuf), "'%d': bad day-of-month\n", lno); in parse_crontab() 189 snprintf(toybuf, sizeof(toybuf), "'%d': bad month\n", lno); in parse_crontab() 193 snprintf(toybuf, sizeof(toybuf), "'%d': bad day-of-week\n", lno); in parse_crontab() [all …]
|
D | bootchartd.c | 86 if ((len = readall(fd, toybuf, sizeof(toybuf)-1)) < 0) { in dump_proc_data() 90 toybuf[len] = '\0'; in dump_proc_data() 92 fputs(toybuf, fp); in dump_proc_data() 94 if ((ptr = strchr(toybuf, '('))) { in dump_proc_data() 133 sscanf(ptr, "%s", toybuf); // string will come with double quotes. in parse_config_file() 134 if (!(strncmp(toybuf+1, "on", strlen("on"))) || in parse_config_file() 135 !(strncmp(toybuf+1, "yes", strlen("yes")))) TT.proc_accounting = 1; in parse_config_file() 222 memset(toybuf, 0, sizeof(toybuf)); in stop_logging() 223 strftime(toybuf, sizeof(toybuf), "%a %b %e %H:%M:%S %Z %Y", &st); in stop_logging() 225 fprintf(hdr_fp, "title = Boot chart for %s (%s)\n", host_name, toybuf); in stop_logging() [all …]
|
D | last.c | 78 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 …]
|
D | wget.c | 111 strcat(toybuf, name); in mk_fld() 112 strcat(toybuf, ": "); in mk_fld() 113 strcat(toybuf, value); in mk_fld() 114 strcat(toybuf, "\r\n"); in mk_fld() 122 if (!strncmp(toybuf+i, "\r\n\r\n", 4)) break; in get_body() 125 return toybuf+i+4; in get_body() 146 sprintf(toybuf, "GET %s HTTP/1.1\r\n", path); in wget_main() 152 strcat(toybuf, "\r\n"); in wget_main() 155 len = strlen(toybuf); in wget_main() 156 if (write(sock, toybuf, len) != len) perror_exit("write error"); in wget_main() [all …]
|
D | lsof.c | 99 snprintf(toybuf, sizeof(toybuf), "/proc/%d/fdinfo/%s", fi->pi.pid, fi->fd); in fill_flags() 100 fp = fopen(toybuf, "r"); in fill_flags() 319 snprintf(toybuf, sizeof(toybuf), "/proc/%d/%s", pi->pid, path); in visit_symlink() 323 snprintf(toybuf, sizeof(toybuf), "/proc/%d/fd/%s", pi->pid, path); in visit_symlink() 327 fill_stat(fi, toybuf); in visit_symlink() 329 fi->name = xreadlink(toybuf); in visit_symlink() 331 fi->name = xmprintf("%s (readlink: %s)", toybuf, strerror(errno)); in visit_symlink() 345 snprintf(toybuf, sizeof(toybuf), "/proc/%d/maps", pi->pid); in visit_maps() 346 fp = fopen(toybuf, "r"); in visit_maps() 375 snprintf(toybuf, sizeof(toybuf), "/proc/%d/fd", pi->pid); in visit_fds() [all …]
|
D | mke2fs.c | 353 memset(toybuf, 0, sizeof(toybuf)); in put_zeroes() 355 int out = len > sizeof(toybuf) ? sizeof(toybuf) : len; in put_zeroes() 356 xwrite(TT.fsfd, toybuf, out); in put_zeroes() 440 strncpy(toybuf, TT.gendir, sizeof(toybuf)); in mke2fs_main() 441 dti = dirtree_read(toybuf, dirtree_notdotdot); in mke2fs_main() 502 struct ext2_inode *in = (struct ext2_inode *)toybuf; in mke2fs_main() 516 struct ext2_group *bg = (struct ext2_group *)toybuf; in mke2fs_main() 525 memset(toybuf, 0, TT.blocksize); in mke2fs_main() 526 xwrite(TT.fsfd, toybuf, temp); in mke2fs_main() 580 memset(toybuf, 0, TT.blocksize); in mke2fs_main() [all …]
|
/external/toybox/toys/posix/ |
D | cpio.c | 116 xreadall(afd, toybuf, 110); in cpio_main() 117 if (memcmp(toybuf, "070701", 6)) error_exit("bad cpio magic"); in cpio_main() 118 tofree = name = strpad(afd, x8u(toybuf+94), 110); in cpio_main() 128 size = x8u(toybuf+54); in cpio_main() 129 mode = x8u(toybuf+14); in cpio_main() 130 uid = x8u(toybuf+22); in cpio_main() 131 gid = x8u(toybuf+30); in cpio_main() 132 timestamp = x8u(toybuf+46); // unsigned 32 bit, so year 2100 problem in cpio_main() 163 data = toybuf; in cpio_main() 165 if (size < sizeof(toybuf)) data = strpad(afd, size, 0); in cpio_main() [all …]
|
D | kill.c | 114 snprintf(toybuf, sizeof(toybuf), "/proc/%d/stat", procpid); 115 if (!readfile(toybuf, toybuf, sizeof(toybuf))) continue; 116 if (sscanf(toybuf, "%*d %*s %*c %*d %*d %d", &procsid) != 1) continue; 120 snprintf(toybuf, sizeof(toybuf), "/proc/%d/cmdline", procpid); 121 if (!readfile(toybuf, toybuf, sizeof(toybuf)) || !*toybuf) continue;
|
D | file.c | 32 int endian = toybuf[5], bits = toybuf[4], i, j; 58 i = toybuf[16]; 85 j = elf_int(toybuf+18, 2); 98 phentsize = elf_int(toybuf+42+12*bits, 2); 99 phnum = elf_int(toybuf+44+12*bits, 2); 100 phoff = elf_int(toybuf+28+4*bits, 4+4*bits); 101 shsize = elf_int(toybuf+46+12*bits, 2); 102 shnum = elf_int(toybuf+48+12*bits, 2); 103 shoff = elf_int(toybuf+32+8*bits, 4+4*bits); 187 int len = read(fd, s = toybuf, sizeof(toybuf)-256); in do_regular_file() [all …]
|
D | strings.c | 39 nread = read(fd, toybuf, sizeof(toybuf)); 43 if (((toybuf[i] >= 32) && (toybuf[i] <= 126)) || (toybuf[i] == '\t')) { 44 if (count == wlen) fputc(toybuf[i], stdout); 46 string[count++] = toybuf[i];
|
D | date.c | 72 strftime(toybuf, sizeof(toybuf), fmt, &tm0); 73 len = strlen(toybuf) + 1; 74 strftime(toybuf + len, sizeof(toybuf) - len, fmt, &tm1); 75 error_exit("bad date '%s'; %s != %s", str, toybuf, toybuf + len); 219 if (!strftime(toybuf, sizeof(toybuf), format_string, &tm)) in date_main() 221 puts(toybuf); in date_main()
|
/external/toybox/toys/net/ |
D | netstat.c | 118 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), "%d", uid); in show_ip() 173 if ((toys.optflags & FLAG_e)) printf(" %-10s %-11ld", toybuf, inode); in show_ip() 192 if(!fgets(toybuf, sizeof(toybuf), fp)) return; //skip header. in show_unix_sockets() 194 while (fgets(toybuf, sizeof(toybuf), fp)) { in show_unix_sockets() 198 if (6<sscanf(toybuf, "%*p: %lX %*X %lX %lX %lX %lu %n", in show_unix_sockets() [all …]
|
/external/toybox/toys/other/ |
D | dos2unix.c | 44 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);
|
D | pmap.c | 39 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()
|
D | blkid.c | 71 len = readall(fd, toybuf, sizeof(toybuf)); in do_blkid() 72 if (len != sizeof(toybuf)) return; in do_blkid() 79 if (fstypes[i].magic_offset > off+sizeof(toybuf)) { in do_blkid() 88 test += ((uint64_t)toybuf[j+fstypes[i].magic_offset-off])<<(8*j); in do_blkid() 103 if (toybuf[1116]&4) type = "ext3"; in do_blkid() 104 if (toybuf[1120]&64) type = "ext4"; in do_blkid() 119 char *s = toybuf+fstypes[i].label_off-off;; in do_blkid() 137 for (j = 0; j < size; j++) printf("-%02x"+!(bits & (1<<j)), toybuf[uoff+j]); in do_blkid() 149 char *name = toybuf, *buffer = toybuf+1024, device[32]; in blkid_main()
|
D | mkpasswd.c | 64 if (read_password(toybuf, sizeof(toybuf), "Password: ")) 67 for (i = 0; i<sizeof(toybuf)-1; i++) { 68 if (!xread(0, toybuf+i, 1)) break; 69 if (toybuf[i] == '\n' || toybuf[i] == '\r') break; 71 toybuf[i] = 0; 76 xprintf("%s\n",crypt(*toys.optargs ? *toys.optargs : toybuf, salt));
|
D | lsusb.c | 27 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()
|
D | taskset.c | 48 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()
|
D | acpi.c | 57 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()
|
D | lspci.c | 42 char *p = toybuf, *vendor = toybuf+9, *device = toybuf+18, 58 int fd, size = 6 + 2*((toys.optflags & FLAG_e) && p == toybuf); 83 if (!fgets(s, sizeof(toybuf)-(p-toybuf)-1, TT.db)) break; 101 new->name+5, toybuf, vbig ? vbig : "", vendor, 109 : "%s Class %s: %s:%s", new->name+5, toybuf,
|
D | login.c | 102 if (!read_password(toybuf, sizeof(toybuf), "Password: ")) { in login_main() 103 int x = pass && (ss = crypt(toybuf, pass)) && !strcmp(pass, ss); in login_main() 106 memset(toybuf, 0, sizeof(toybuf)); in login_main() 122 memset(toybuf, 0, sizeof(toybuf)); in login_main() 129 ss = readfile("/etc/nologin", toybuf, sizeof(toybuf)); in login_main()
|
D | insmod.c | 33 strlen(toybuf) + strlen(toys.optargs[i]) + 2 < sizeof(toybuf)) in insmod_main() 35 strcat(toybuf, toys.optargs[i++]); in insmod_main() 36 strcat(toybuf, " "); in insmod_main() 41 rc = finit_module(fd, toybuf, 0); in insmod_main() 47 rc = init_module(buf, len, toybuf); in insmod_main()
|
/external/toybox/toys/lsb/ |
D | md5sum.c | 275 i = read(fd, toybuf, sizeof(toybuf)); in do_lib_hash() 277 hash->update(&ctx, toybuf, i); in do_lib_hash() 279 hash->final(toybuf+128, &ctx); in do_lib_hash() 282 sprintf(toybuf+2*i, "%02x", toybuf[i+128]); in do_lib_hash() 304 i = read(fd, toybuf, sizeof(toybuf)); in do_builtin_hash() 306 hash_update(toybuf, i, transform); in do_builtin_hash() 328 sprintf(toybuf+2*i, "%02x", 255&(TT.state[i>>2] >> ((3-(i & 3)) * 8))); in do_builtin_hash() 329 else for (i=0; i<4; i++) sprintf(toybuf+8*i, "%08x", bswap_32(TT.state[i])); in do_builtin_hash() 333 i = strlen(toybuf)+1; in do_builtin_hash() 334 memset(toybuf+i, 0, sizeof(toybuf)-i); in do_builtin_hash() [all …]
|
D | hostname.c | 41 if (gethostname(toybuf, sizeof(toybuf)-1) || !*toybuf) 48 if (gethostname(toybuf, sizeof(toybuf)-1)) perror_exit("gethostname"); 49 xputs(toybuf);
|
D | passwd.c | 77 pass = crypt(toybuf, pwd); in verify_passwd() 87 if (read_password(toybuf, sizeof(toybuf), "New password:")) in new_password() 90 newp = xstrdup(toybuf); in new_password() 92 if (read_password(toybuf, sizeof(toybuf), "Retype password:")) { in new_password() 97 if (!strcmp(newp, toybuf)) return newp; in new_password() 146 if (read_password(toybuf, sizeof(toybuf), "Origial password:")) { in passwd_main() 150 orig = toybuf; in passwd_main()
|