/netbsd-src/external/gpl3/gdb/dist/gnulib/import/ |
H A D | setlocale_null.c | 91 setlocale_null_unlocked (int category, char *buf, size_t bufsize) in setlocale_null_unlocked() argument 102 if (bufsize > 0) in setlocale_null_unlocked() 112 if (length < bufsize) in setlocale_null_unlocked() 124 if (bufsize > 0) in setlocale_null_unlocked() 132 for (i = 0; i < bufsize; i++) in setlocale_null_unlocked() 134 buf[bufsize - 1] = '\0'; in setlocale_null_unlocked() 145 if (bufsize > 0) in setlocale_null_unlocked() 155 if (length < bufsize) in setlocale_null_unlocked() 162 if (bufsize > 0) in setlocale_null_unlocked() 167 memcpy (buf, result, bufsize - 1); in setlocale_null_unlocked() [all …]
|
H A D | openat-proc.c | 99 size_t bufsize = PROC_SELF_FD_DIR_SIZE_BOUND + strlen (file); in openat_proc_name() local 100 if (OPENAT_BUFFER_SIZE < bufsize) in openat_proc_name() 102 result = malloc (bufsize); in openat_proc_name() 114 size_t bufsize; in openat_proc_name() local 120 bufsize = dirlen + 1 + strlen (file) + 1; /* 1 for '/', 1 for null */ in openat_proc_name() 121 if (OPENAT_BUFFER_SIZE < bufsize) in openat_proc_name() 123 result = malloc (bufsize); in openat_proc_name()
|
H A D | readlink.c | 33 _GL_UNUSED size_t bufsize) in readlink() argument 54 rpl_readlink (char const *file, char *buf, size_t bufsize) in rpl_readlink() argument 72 ssize_t r = readlink (file, buf, bufsize); in rpl_readlink() 88 r = bufsize; in rpl_readlink() 94 if (bufsize < r) in rpl_readlink() 95 r = bufsize; in rpl_readlink()
|
/netbsd-src/common/lib/libutil/ |
H A D | snprintb.c | 59 size_t const bufsize; member 74 if (s->total_len < s->bufsize) in store() 82 int num_len = s->total_len < s->bufsize in store_num() 83 ? snprintf(s->buf + s->total_len, s->bufsize - s->total_len, in store_num() 255 if (s->total_len <= s->bufsize) in finish_buffer() 257 if (s->bufsize >= 3) in finish_buffer() 258 s->buf[s->bufsize - 3] = '#'; in finish_buffer() 259 if (s->bufsize >= 2) in finish_buffer() 260 s->buf[s->bufsize - 2] = '\0'; in finish_buffer() 261 if (s->bufsize >= 1) in finish_buffer() [all …]
|
/netbsd-src/lib/libc/gen/ |
H A D | shquotev.c | 52 shquotev(int argc, char * const * argv, char *buf, size_t bufsize) in shquotev() argument 60 if (bufsize != 0) in shquotev() 66 callrv = shquote(argv[i], buf, bufsize); in shquotev() 71 bufsize = (bufsize > callrv) ? (bufsize - callrv) : 0; in shquotev() 75 if (bufsize > 1) { in shquotev() 77 bufsize--; in shquotev()
|
H A D | getmntinfo.c | 58 static size_t bufsize; in getmntinfo() local 65 if (bufsize > 0 && in getmntinfo() 66 (mntsize = getvfsstat(mntbuf, bufsize, flags)) == -1) in getmntinfo() 68 while (bufsize <= mntsize * sizeof(struct statvfs)) { in getmntinfo() 71 bufsize = (mntsize + 1) * sizeof(struct statvfs); in getmntinfo() 72 if ((mntbuf = malloc(bufsize)) == NULL) in getmntinfo() 74 if ((mntsize = getvfsstat(mntbuf, bufsize, flags)) == -1) in getmntinfo()
|
/netbsd-src/usr.bin/midirecord/ |
H A D | midirecord.c | 108 size_t bufsize = 0; in main() local 117 bufsize = strsuftoll("read buffer size", optarg, in main() 178 if (bufsize < 32) in main() 179 bufsize = 32 * 1024; in main() 180 buffer = malloc(bufsize); in main() 182 err(1, "couldn't malloc buffer of %d size", (int)bufsize); in main() 272 wrsize = midi_event_to_output(e, buffer, bufsize); in main() 305 midi_event_local_to_output(seq_event_t e, u_char *buffer, size_t bufsize) in midi_event_local_to_output() argument 321 size_t bufsize) in midi_event_timer_wait_abs_to_output() argument 329 if (bufsize < 4) { in midi_event_timer_wait_abs_to_output() [all …]
|
/netbsd-src/crypto/external/bsd/openssl/dist/crypto/cmp/ |
H A D | cmp_status.c | 171 char *buf, size_t bufsize) in snprint_PKIStatusInfo_parts() argument 188 if (printed_chars < 0 || (size_t)printed_chars >= bufsize) \ in snprint_PKIStatusInfo_parts() 191 bufsize -= printed_chars; in snprint_PKIStatusInfo_parts() 193 printed_chars = BIO_snprintf(write_ptr, bufsize, "%s", status_string); in snprint_PKIStatusInfo_parts() 201 printed_chars = BIO_snprintf(write_ptr, bufsize, "; PKIFailureInfo: "); in snprint_PKIStatusInfo_parts() 207 printed_chars = BIO_snprintf(write_ptr, bufsize, "%s%s", in snprint_PKIStatusInfo_parts() 218 printed_chars = BIO_snprintf(write_ptr, bufsize, "; <no failure info>"); in snprint_PKIStatusInfo_parts() 225 printed_chars = BIO_snprintf(write_ptr, bufsize, "; StatusString%s: ", in snprint_PKIStatusInfo_parts() 230 printed_chars = BIO_snprintf(write_ptr, bufsize, "\"%.*s\"%s", in snprint_PKIStatusInfo_parts() 242 char *buf, size_t bufsize) in OSSL_CMP_snprint_PKIStatusInfo() argument [all …]
|
/netbsd-src/sys/miscfs/procfs/ |
H A D | procfs_limit.c | 91 size_t bufsize, pos, i; in procfs_dolimit() local 105 bufsize = (64 * 3) * __arraycount(rl); in procfs_dolimit() 106 buffer = malloc(bufsize, M_TEMP, M_WAITOK); in procfs_dolimit() 109 pos += snprintf(buffer + pos, bufsize - pos, "%20.20s ", in procfs_dolimit() 111 pos += prl(buffer + pos, bufsize - pos, rl[i].rlim_cur, ' '); in procfs_dolimit() 112 pos += prl(buffer + pos, bufsize - pos, rl[i].rlim_max, '\n'); in procfs_dolimit() 134 size_t bufsize, pos; in procfs_dolimits() local 148 bufsize = (64 * 3) * __arraycount(linux_rlimits_ident); in procfs_dolimits() 149 buffer = malloc(bufsize, M_TEMP, M_WAITOK); in procfs_dolimits() 150 pos = snprintf(buffer, bufsize, "%-26s%-21s%-21s%-21s\n", in procfs_dolimits() [all …]
|
/netbsd-src/external/bsd/tmux/dist/ |
H A D | cmd-set-buffer.c | 63 size_t bufsize, newsize; in cmd_set_buffer_exec() local 114 bufsize = 0; in cmd_set_buffer_exec() 118 olddata = paste_buffer_data(pb, &bufsize); in cmd_set_buffer_exec() 119 bufdata = xmalloc(bufsize); in cmd_set_buffer_exec() 120 memcpy(bufdata, olddata, bufsize); in cmd_set_buffer_exec() 123 bufdata = xrealloc(bufdata, bufsize + newsize); in cmd_set_buffer_exec() 124 memcpy(bufdata + bufsize, args_string(args, 0), newsize); in cmd_set_buffer_exec() 125 bufsize += newsize; in cmd_set_buffer_exec() 127 if (paste_set(bufdata, bufsize, bufname, &cause) != 0) { in cmd_set_buffer_exec() 134 tty_set_selection(&tc->tty, "", bufdata, bufsize); in cmd_set_buffer_exec()
|
/netbsd-src/lib/libc/compat/gen/ |
H A D | compat_getmntinfo.c | 63 static size_t bufsize; in __strong_alias() local 70 if (bufsize > 0 && in __strong_alias() 71 (mntsize = __compat_getfsstat(mntbuf, (long)bufsize, flags)) == -1) in __strong_alias() 73 while (bufsize <= mntsize * sizeof(struct statfs12)) { in __strong_alias() 76 bufsize = (mntsize + 1) * sizeof(struct statfs12); in __strong_alias() 77 if ((mntbuf = malloc(bufsize)) == NULL) in __strong_alias() 79 if ((mntsize = __compat_getfsstat(mntbuf, (long)bufsize, in __strong_alias()
|
H A D | compat___getmntinfo13.c | 62 static size_t bufsize; in __strong_alias() local 69 if (bufsize > 0 && in __strong_alias() 70 (mntsize = __compat_getvfsstat(mntbuf, bufsize, flags)) == -1) in __strong_alias() 72 while (bufsize <= mntsize * sizeof(struct statvfs90)) { in __strong_alias() 75 bufsize = (mntsize + 1) * sizeof(struct statvfs90); in __strong_alias() 76 if ((mntbuf = malloc(bufsize)) == NULL) in __strong_alias() 78 if ((mntsize = __compat_getvfsstat(mntbuf, bufsize, in __strong_alias()
|
/netbsd-src/tests/fs/nfs/nfsservice/ |
H A D | getmntinfo.c | 65 static size_t bufsize; local 72 if (bufsize > 0 && 73 (mntsize = getvfsstat(mntbuf, bufsize, flags)) == -1) 75 while (bufsize <= mntsize * sizeof(struct statvfs)) { 78 bufsize = (mntsize + 1) * sizeof(struct statvfs); 79 if ((mntbuf = malloc(bufsize)) == NULL) 81 if ((mntsize = getvfsstat(mntbuf, bufsize, flags)) == -1)
|
/netbsd-src/external/ibm-public/postfix/dist/src/util/ |
H A D | nbbio.c | 176 if (np->read_pend == np->bufsize) in nbbio_event() 179 if (np->read_pend < 0 || np->read_pend > np->bufsize) in nbbio_event() 183 np->bufsize - np->read_pend); in nbbio_event() 214 if (np->write_pend < 0 || np->write_pend > np->bufsize) in nbbio_event() 278 if (np->read_pend >= np->bufsize) in nbbio_enable_read() 341 NBBIO *nbbio_create(int fd, ssize_t bufsize, const char *label, in nbbio_create() argument 351 if (bufsize <= 0) in nbbio_create() 352 msg_panic("nbbio_create: bad buffer size: %ld", (long) bufsize); in nbbio_create() 359 np->bufsize = bufsize; in nbbio_create() 365 np->read_buf = mymalloc(bufsize); in nbbio_create() [all …]
|
/netbsd-src/external/gpl2/gmake/dist/ |
H A D | strcache.c | 39 static int bufsize = CACHE_BUFFER_SIZE; variable 46 new = (struct strcache *) xmalloc (sizeof (*new) + bufsize); in new_cache() 49 new->bytesfree = bufsize; in new_cache() 67 if (len > bufsize) in add_string() 68 bufsize = len * 2; in add_string() 168 if (size > bufsize) in strcache_setbufsize() 169 bufsize = size; in strcache_setbufsize() 170 return bufsize; in strcache_setbufsize() 186 int totsize = 0, avgsize, maxsize = 0, minsize = bufsize; in strcache_print_stats() 187 int totfree = 0, avgfree, maxfree = 0, minfree = bufsize; in strcache_print_stats()
|
/netbsd-src/usr.bin/sort/ |
H A D | fsort.c | 87 size_t bufsize = DEFBUFSIZE; in fsort() local 98 buffer = allocrec(NULL, bufsize); in fsort() 99 bufend = (u_char *)buffer + bufsize; in fsort() 150 || (bufsize >= MAXBUFSIZE && nelem > 8)) in fsort() 156 bufsize *= 2; in fsort() 157 nbuffer = allocrec(buffer, bufsize); in fsort() 160 bufsize); in fsort() 169 bufend = (u_char *)buffer + bufsize; in fsort()
|
/netbsd-src/external/gpl2/dtc/dist/tests/ |
H A D | open_pack.c | 25 int oldsize, bufsize, packsize; in main() local 36 bufsize = oldsize * 2; in main() 38 buf = xmalloc(bufsize); in main() 40 memset(buf, 0, bufsize); in main() 43 err = fdt_open_into(fdt, fdt1, bufsize); in main() 58 oldsize, bufsize, packsize); in main()
|
H A D | move_and_save.c | 26 int bufsize; in main() local 36 bufsize = fdt_totalsize(fdt) + shuntsize; in main() 37 buf = xmalloc(bufsize); in main() 40 err = fdt_move(fdt, fdt1, bufsize); in main() 48 err = fdt_move(fdt1, fdt2, bufsize-shuntsize); in main() 56 err = fdt_move(fdt2, fdt3, bufsize); in main()
|
/netbsd-src/tests/lib/libutil/ |
H A D | t_snprintb.c | 45 vis_arr(char *buf, size_t bufsize, const char *arr, size_t arrsize) in vis_arr() argument 47 ATF_REQUIRE(bufsize >= 2); in vis_arr() 48 int rv = strnvisx(buf + 1, bufsize - 2, arr, arrsize, in vis_arr() 59 size_t bufsize, const char *bitfmt, size_t bitfmtlen, uint64_t val, in check_snprintb_m() argument 65 ATF_REQUIRE(bufsize <= sizeof(buf)); in check_snprintb_m() 72 if (bufsize == 0) in check_snprintb_m() 76 int rv = snprintb_m(buf, bufsize, bitfmt, val, line_max); in check_snprintb_m() 111 #define h_snprintb_m_len(bufsize, bitfmt, val, line_max, \ argument 114 bufsize, bitfmt, sizeof(bitfmt) - 1, val, line_max, \ 120 #define h_snprintb_len(bufsize, bitfm argument [all...] |
/netbsd-src/lib/libc/gdtoa/ |
H A D | g_ffmt.c | 38 g_ffmt(buf, f, ndig, bufsize) char *buf; float *f; int ndig; size_t bufsize; in g_ffmt() argument 40 g_ffmt(char *buf, float *f, int ndig, size_t bufsize) 55 if (bufsize < ndig + 10) 88 if (bufsize < 16) 96 return g__fmt(buf, s, se, decpt, sign, bufsize);
|
H A D | g_xLfmt.c | 54 g_xLfmt(buf, V, ndig, bufsize) char *buf; char *V; int ndig; size_t bufsize; in g_xLfmt() argument 56 g_xLfmt(char *buf, void *V, int ndig, size_t bufsize) 71 if (bufsize < ndig + 10) 109 if (bufsize < 32) 116 return g__fmt(buf, s, se, decpt, sign, bufsize);
|
H A D | g_dfmt.c | 38 g_dfmt(buf, d, ndig, bufsize) char *buf; double *d; int ndig; size_t bufsize; in g_dfmt() argument 40 g_dfmt(char *buf, double *d, int ndig, size_t bufsize) 55 if (bufsize < ndig + 10) 62 if (bufsize < 10) 98 return g__fmt(buf, s, se, decpt, sign, bufsize);
|
/netbsd-src/external/mit/libuv/dist/src/win/ |
H A D | util.c | 1121 DWORD bufsize; in uv_os_tmpdir() local 1154 bufsize = WideCharToMultiByte(CP_UTF8, 0, path, -1, NULL, 0, NULL, NULL); in uv_os_tmpdir() 1156 if (bufsize == 0) { in uv_os_tmpdir() 1159 } else if (bufsize > *size) { in uv_os_tmpdir() 1161 *size = bufsize; in uv_os_tmpdir() 1166 bufsize = WideCharToMultiByte(CP_UTF8, in uv_os_tmpdir() 1176 if (bufsize == 0) in uv_os_tmpdir() 1179 *size = bufsize - 1; in uv_os_tmpdir() 1203 DWORD bufsize; in uv__convert_utf16_to_utf8() local 1209 bufsize = WideCharToMultiByte(CP_UTF8, in uv__convert_utf16_to_utf8() [all …]
|
/netbsd-src/external/gpl2/xcvs/dist/diff/ |
H A D | io.c | 90 current->bufsize = sizeof (word); 91 current->buffer = xmalloc (current->bufsize); 95 current->bufsize = STAT_BLOCKSIZE (current->stat); 96 current->buffer = xmalloc (current->bufsize); 104 ssize_t n = read (current->desc, current->buffer, current->bufsize); 143 if (current->bufsize < cc) 145 current->bufsize = cc; 164 if (current->buffered_chars == current->bufsize) 166 current->bufsize = current->bufsize * 2; 167 current->buffer = xrealloc (current->buffer, current->bufsize); [all …]
|
/netbsd-src/external/gpl2/diffutils/dist/src/ |
H A D | io.c | 105 current->bufsize = sizeof (word); in sip() 106 current->buffer = xmalloc (current->bufsize); in sip() 110 current->bufsize = buffer_lcm (sizeof (word), in sip() 113 current->buffer = xmalloc (current->bufsize); in sip() 121 file_block_read (current, current->bufsize); in sip() 173 if (current->bufsize < cc) in slurp() 175 current->bufsize = cc; in slurp() 194 file_block_read (current, current->bufsize - current->buffered); in slurp() 198 while (current->buffered == current->bufsize) in slurp() 200 if (PTRDIFF_MAX / 2 - sizeof (word) < current->bufsize) in slurp() [all …]
|