/external/toybox/toys/pending/ |
D | crontab.c | 125 snprintf(toybuf, sizeof(toybuf), "'%d': premature EOF\n", lno); in parse_crontab() 145 snprintf(toybuf, sizeof(toybuf), "'%d': %s\n", lno, line); in parse_crontab() 156 snprintf(toybuf, sizeof(toybuf), "'%d': %s\n", lno, line); in parse_crontab() 162 snprintf(toybuf, sizeof(toybuf), "'%d': %s\n", lno, line); in parse_crontab() 170 snprintf(toybuf, sizeof(toybuf), "'%d': %s\n", lno, line); in parse_crontab() 176 snprintf(toybuf, sizeof(toybuf), "'%d': bad minute\n", lno); in parse_crontab() 180 snprintf(toybuf, sizeof(toybuf), "'%d': bad hour\n", lno); in parse_crontab() 184 snprintf(toybuf, sizeof(toybuf), "'%d': bad day-of-month\n", lno); in parse_crontab() 188 snprintf(toybuf, sizeof(toybuf), "'%d': bad month\n", lno); in parse_crontab() 192 snprintf(toybuf, sizeof(toybuf), "'%d': bad day-of-week\n", lno); in parse_crontab() [all …]
|
D | top.c | 106 fgets(toybuf, sizeof(toybuf), file); in read_stat() 110 open_paren = strchr(toybuf, '('); in read_stat() 111 close_paren = strrchr(toybuf, ')'); in read_stat() 135 while (fgets(toybuf, sizeof(toybuf), file)) in read_status() 136 if (sscanf(toybuf, "Uid: %u", &(proc->uid)) == 1) break; in read_status() 147 rbytes = readall(fd, toybuf, sizeof(toybuf)); in read_cmdline() 153 toybuf[rbytes] = '\0'; in read_cmdline() 154 while (--rbytes >= 0 && toybuf[rbytes] == '\0') continue; in read_cmdline() 158 ch = strchr(toybuf, ' '); in read_cmdline() 160 base = strrchr(toybuf, '/'); in read_cmdline() [all …]
|
D | bootchartd.c | 85 if ((len = readall(fd, toybuf, sizeof(toybuf)-1)) < 0) { in dump_proc_data() 89 toybuf[len] = '\0'; in dump_proc_data() 91 fputs(toybuf, fp); in dump_proc_data() 93 if ((ptr = strchr(toybuf, '('))) { in dump_proc_data() 132 sscanf(ptr, "%s", toybuf); // string will come with double quotes. in parse_config_file() 133 if (!(strncmp(toybuf+1, "on", strlen("on"))) || in parse_config_file() 134 !(strncmp(toybuf+1, "yes", strlen("yes")))) TT.proc_accounting = 1; in parse_config_file() 221 memset(toybuf, 0, sizeof(toybuf)); in stop_logging() 222 strftime(toybuf, sizeof(toybuf), "%a %b %e %H:%M:%S %Z %Y", &st); in stop_logging() 224 fprintf(hdr_fp, "title = Boot chart for %s (%s)\n", host_name, toybuf); in stop_logging() [all …]
|
D | pgrep.c | 117 snprintf(toybuf, sizeof(toybuf), "/proc/%s/cmdline", entry->d_name); in pgrep_main() 118 if ((fd = open(toybuf, O_RDONLY)) == -1) goto cmdline_fail; in pgrep_main() 119 n = read(fd, toybuf, sizeof(toybuf)); in pgrep_main() 121 toybuf[n--] = '\0'; in pgrep_main() 124 snprintf(toybuf, sizeof(toybuf), "/proc/%s/comm", entry->d_name); in pgrep_main() 125 if ((fd = open(toybuf, O_RDONLY)) == -1) continue; in pgrep_main() 126 n = read(fd, toybuf, sizeof(toybuf)); in pgrep_main() 128 toybuf[--n] = '\0'; in pgrep_main() 133 if (toybuf[n] < ' ') toybuf[n] = ' '; in pgrep_main() 136 cmdline = xstrdup(toybuf); in pgrep_main() [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 | ftpget.c | 77 char *str = toybuf; //toybuf holds response data. in close_stream() 83 error_exit("%s server response: %s", (msg_str) ? msg_str:"", toybuf); in close_stream() 101 if (!fgets(toybuf, sizeof(toybuf)-1, TT.sockfp)) close_stream(NULL); in get_ftp_response() 102 } while (!isdigit(toybuf[0]) || toybuf[3] != ' '); in get_ftp_response() 104 toybuf[3] = '\0'; in get_ftp_response() 105 cmd_status = atolx_range(toybuf, 0, INT_MAX); in get_ftp_response() 106 toybuf[3] = ' '; in get_ftp_response() 161 if (!(pch = strrchr(toybuf, ')'))) goto close_stream; in verify_pasv_mode() 163 if (!(pch = strrchr(toybuf, ','))) goto close_stream; in verify_pasv_mode() 168 if (!(pch = strrchr(toybuf, ','))) goto close_stream; in verify_pasv_mode() [all …]
|
D | netstat.c | 271 fgets(toybuf, sizeof(toybuf), fp); //skip header. in show_ipv4() 272 while (fgets(toybuf, sizeof(toybuf), fp)) { in show_ipv4() 278 int nitems = sscanf(toybuf, " %d: %x:%x %x:%x %x %x:%x %*X:%*X %*X %d %*d %ld", in show_ipv4() 298 fgets(toybuf, sizeof(toybuf), fp); //skip header. in show_ipv6() 299 while (fgets(toybuf, sizeof(toybuf), fp)) { in show_ipv6() 304 …int nitems = sscanf(toybuf, " %d: %8x%8x%8x%8x:%x %8x%8x%8x%8x:%x %x %x:%x %*X:%*X %*X %d %*d %ld", in show_ipv6() 325 fgets(toybuf, sizeof(toybuf), fp); //skip header. in show_unix_sockets() 326 while (fgets(toybuf, sizeof(toybuf), fp)) { in show_unix_sockets() 329 char sock_flags[32] = {0,}, *sock_type, *sock_state, *bptr = toybuf; in show_unix_sockets() 331 if (!toybuf[0]) continue; in show_unix_sockets() [all …]
|
D | sulogin.c | 55 ret = read_password(toybuf, sizeof(toybuf), s); in validate_password() 58 if ( ret && !toybuf[0]) { in validate_password() 63 pass = crypt(toybuf, pwd); in validate_password() 72 snprintf(toybuf,sizeof(toybuf), "-%s", shell); in run_shell() 73 execl(shell, toybuf, NULL); in run_shell()
|
D | compress.c | 337 struct huff *h2 = ((struct huff *)toybuf)+1; in inflate() 351 memset(bits = toybuf+1, 0, 19); in inflate() 373 len2huff(disthuff = ((struct huff *)toybuf)+2, bits+litlen, distlen); in inflate() 488 for (i=0; i<288; i++) toybuf[i] = 8 + (i>143) - ((i>255)<<1) + (i>279); in init_deflate() 489 len2huff(TT.fixlithuff = ((struct huff *)toybuf)+3, toybuf, 288); in init_deflate() 490 memset(toybuf, 5, 30); in init_deflate() 491 len2huff(TT.fixdisthuff = ((struct huff *)toybuf)+4, toybuf, 30); in init_deflate() 516 unsigned crc, *crc_table = (unsigned *)(toybuf+sizeof(toybuf)-1024); in gzip_crc() 526 struct bitbuf *bb = bitbuf_init(1, sizeof(toybuf)); in do_gzip() 537 crc_init((unsigned *)(toybuf+sizeof(toybuf)-1024), 1); in do_gzip() [all …]
|
D | ps.c | 96 long long *slot = (void *)(toybuf+1024); in do_ps() 105 sprintf(toybuf, "%lld/stat", *slot); in do_ps() 106 if (!readfileat(dirtree_parentfd(new), toybuf, toybuf, 1024)) return 0; in do_ps() 109 if (!(s = strchr(toybuf, '('))) return 0; in do_ps() 125 char *out = toybuf+2048; in do_ps() 149 sprintf(toybuf+512, "%lld/wchan", *slot); in do_ps() 150 readfileat(dirtree_parentfd(new), toybuf+512, out, 2047); in do_ps() 160 sprintf(toybuf+512, "%lld/fd/%i", *slot, i); in do_ps() 162 if (!fstatat(fd, toybuf+512, &st, 0) && S_ISCHR(st.st_mode) in do_ps() 164 && 0<(len = readlinkat(fd, toybuf+512, out, 2047))) in do_ps() [all …]
|
/external/toybox/toys/posix/ |
D | cpio.c | 108 xreadall(afd, toybuf, 110); in cpio_main() 109 tofree = name = strpad(afd, x8u(toybuf+94), 110); in cpio_main() 119 size = x8u(toybuf+54); in cpio_main() 120 mode = x8u(toybuf+14); in cpio_main() 121 uid = x8u(toybuf+30); in cpio_main() 122 gid = x8u(toybuf+38); in cpio_main() 123 timestamp = x8u(toybuf+46); // unsigned 32 bit, so year 2100 problem in cpio_main() 153 data = toybuf; in cpio_main() 155 if (size < sizeof(toybuf)) data = strpad(afd, size, 0); in cpio_main() 156 else xreadall(afd, toybuf, sizeof(toybuf)); 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 | 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 | cmp.c | 33 int i, len1, len2, min_len, size = sizeof(toybuf)/2; 35 char *buf2 = toybuf+size; 47 len1 = readall(TT.fd, toybuf, size); 52 if (toybuf[i] != buf2[i]) { 55 printf("%ld %o %o\n", byte_no, toybuf[i], buf2[i]); 66 if (toybuf[i] == '\n') line_no++;
|
/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 | lsusb.c | 27 snprintf(toybuf, sizeof(toybuf), "%s/%s", name, "/uevent"); 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 | login.c | 52 if (read_password(toybuf, sizeof(toybuf), "Password: ")) return 1; in verify_password() 56 pass = crypt(toybuf, pwd); in verify_password() 92 size = readall(fd, toybuf,sizeof(toybuf)-1); in handle_nologin() 93 toybuf[size] = 0; in handle_nologin() 95 else puts(toybuf); in handle_nologin() 108 size = readall(fd, toybuf,sizeof(toybuf)-1); in handle_motd() 109 toybuf[size] = 0; in handle_motd() 110 puts(toybuf); in handle_motd() 122 snprintf(toybuf,sizeof(toybuf)-1, "-%s", shell); in spawn_shell() 123 execl(shell, toybuf, NULL); in spawn_shell()
|
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 | 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() 120 toybuf+fstypes[i].label_off-off); in do_blkid() 130 for (j = 0; j < size; j++) printf("-%02x"+!(bits & (1<<j)), toybuf[uoff+j]); in do_blkid()
|
D | acpi.c | 60 len = readall(fd, toybuf, sizeof(toybuf)); in acpi_callback() 64 if (!strncmp(toybuf, "Battery", 7)) { in acpi_callback() 116 memset(toybuf, 0, sizeof(toybuf)); in cool_callback() 124 if (readfile(TT.cpath, toybuf, 256) && !errno) { in cool_callback() 125 toybuf[strlen(toybuf) -1] = 0; in cool_callback() 129 printf("Cooling %d: %s no state information\n", TT.cool++, toybuf); in cool_callback() 130 else printf("Cooling %d: %s %d of %d\n", TT.cool++, toybuf, cur, max); in cool_callback()
|
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() 39 res = init_module(buf, len, toybuf); in insmod_main() 41 if (buf != toybuf) free(buf); in insmod_main()
|
D | lspci.c | 42 char *p = toybuf, *vendor = toybuf+9, *device = toybuf+18, 59 int fd, size = 6 + 2*((toys.optflags & FLAG_e) && p == toybuf); 84 if (!fgets(s, sizeof(toybuf)-(p-toybuf)-1, TT.db)) break; 102 new->name+5, toybuf, vbig ? vbig : "", vendor, 110 : "%s Class %s: %s:%s", new->name+5, toybuf,
|
D | base64.c | 32 char *buf = toybuf+128; 35 if (!(len = xread(fd, buf, sizeof(toybuf)-128))) { 38 putchar(toybuf[out<<(6-bits)]); 51 if ((x = stridx(toybuf, buf[i])) != -1) { 69 putchar(toybuf[out >> (bits -= 6)]); 85 base64_init(toybuf); in base64_main()
|
/external/toybox/toys/lsb/ |
D | passwd.c | 70 pass = crypt(toybuf, pwd); in verify_passwd() 80 if (read_password(toybuf, sizeof(toybuf), "New password:")) in new_password() 83 newp = xstrdup(toybuf); in new_password() 85 if (read_password(toybuf, sizeof(toybuf), "Retype password:")) { in new_password() 90 if (!strcmp(newp, toybuf)) return newp; in new_password() 140 if (read_password(toybuf, sizeof(toybuf), "Origial password:")) { in passwd_main() 144 orig = toybuf; in passwd_main()
|