Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 153) sorted by relevance

1234567

/bionic/libc/upstream-openbsd/lib/libc/stdio/
Dfgets.c48 size_t len; in fgets() local
75 len = fp->_r; in fgets()
84 if (len > n) in fgets()
85 len = n; in fgets()
86 t = memchr((void *)p, '\n', len); in fgets()
88 len = ++t - p; in fgets()
89 fp->_r -= len; in fgets()
91 (void)memcpy((void *)s, (void *)p, len); in fgets()
92 s[len] = '\0'; in fgets()
96 fp->_r -= len; in fgets()
[all …]
Dtempnam.c45 int sverrno, len; in tempnam() local
55 len = snprintf(name, PATH_MAX, "%s%s%sXXXXXXXXXX", f, in tempnam()
57 if (len < 0 || len >= PATH_MAX) { in tempnam()
67 len = snprintf(name, PATH_MAX, "%s%s%sXXXXXXXXXX", f, in tempnam()
69 if (len < 0 || len >= PATH_MAX) { in tempnam()
78 len = snprintf(name, PATH_MAX, "%s%sXXXXXXXXX", f, pfx); in tempnam()
79 if (len < 0 || len >= PATH_MAX) { in tempnam()
87 len = snprintf(name, PATH_MAX, "%s%sXXXXXXXXX", f, pfx); in tempnam()
88 if (len < 0 || len >= PATH_MAX) { in tempnam()
Dfvwrite.c50 size_t len; in __sfvwrite() local
57 if ((len = uio->uio_resid) == 0) in __sfvwrite()
70 len = iov->iov_len; in __sfvwrite()
73 while (len == 0) { \ in __sfvwrite()
76 len = iov->iov_len; \ in __sfvwrite()
85 w = (*fp->_write)(fp->_cookie, p, MIN(len, BUFSIZ)); in __sfvwrite()
89 len -= w; in __sfvwrite()
106 (__SALC | __SSTR) && fp->_w < len) { in __sfvwrite()
115 } while (_size < blen + len); in __sfvwrite()
126 if (len < w) in __sfvwrite()
[all …]
Dfgetln.c68 size_t len; in fgetln() local
87 *lenp = len = p - fp->_p; in fgetln()
89 fp->_r -= len; in fgetln()
105 for (len = fp->_r, off = 0;; len += fp->_r) { in fgetln()
113 if (__slbexpand(fp, len + OPTIMISTIC)) in fgetln()
116 len - off); in fgetln()
117 off = len; in fgetln()
126 len += diff; in fgetln()
127 if (__slbexpand(fp, len)) in fgetln()
135 *lenp = len; in fgetln()
Dvswscanf.c46 eofread(void *cookie, char *buf, int len) in eofread() argument
59 size_t len, mlen; in vswscanf() local
67 len = wcslen(str) * MB_CUR_MAX; in vswscanf()
68 if ((mbstr = malloc(len + 1)) == NULL) in vswscanf()
72 if ((mlen = wcsrtombs(mbstr, &strp, len, &mbs)) == (size_t)-1) { in vswscanf()
76 if (mlen == len) in vswscanf()
77 mbstr[len] = '\0'; in vswscanf()
Dgetdelim.c50 size_t len, newlen, off; in getdelim() local
78 len = fp->_r; in getdelim()
80 len = (p - fp->_p) + 1; in getdelim()
83 if (off > SSIZE_MAX || len + 1 > SSIZE_MAX - off) { in getdelim()
87 newlen = off + len + 1; /* reserve space for NUL terminator */ in getdelim()
113 (void)memcpy((*buf + off), fp->_p, len); in getdelim()
115 fp->_r -= (int)len; in getdelim()
116 fp->_p += (int)len; in getdelim()
117 off += len; in getdelim()
Dopen_wmemstream.c36 size_t len; /* length of the data */ member
45 size_t nmc, len, end; in wmemstream_write() local
64 len = mbsnrtowcs(st->string + st->pos, &b, nmc, l, &st->mbs); in wmemstream_write()
65 if (len == (size_t)-1) in wmemstream_write()
67 st->pos += len; in wmemstream_write()
69 if (st->pos > st->len) { in wmemstream_write()
70 st->len = st->pos; in wmemstream_write()
71 st->string[st->len] = L'\0'; in wmemstream_write()
76 return (len); in wmemstream_write()
92 base = st->len; in wmemstream_seek()
[all …]
/bionic/libc/bionic/
Dlibgen.cpp45 int len; in __basename_r() local
51 len = 1; in __basename_r()
64 len = 1; in __basename_r()
74 len = endp - startp +1; in __basename_r()
77 result = len; in __basename_r()
81 if (len > static_cast<int>(buffer_size) - 1) { in __basename_r()
82 len = buffer_size - 1; in __basename_r()
87 if (len >= 0) { in __basename_r()
88 memcpy(buffer, startp, len); in __basename_r()
89 buffer[len] = 0; in __basename_r()
[all …]
Dsystem_properties_compat.c76 unsigned len = strlen(name); in __system_property_find_compat() local
79 if (len >= PROP_NAME_MAX) in __system_property_find_compat()
81 if (len < 1) in __system_property_find_compat()
86 if(TOC_NAME_LEN(entry) != len) continue; in __system_property_find_compat()
89 if(memcmp(name, pi->name, len)) continue; in __system_property_find_compat()
99 unsigned serial, len; in __system_property_read_compat() local
108 len = SERIAL_VALUE_LEN(serial); in __system_property_read_compat()
109 memcpy(value, pi->value, len + 1); in __system_property_read_compat()
114 return len; in __system_property_read_compat()
D__strncat_chk.cpp45 size_t len, size_t dest_buf_size) { in __strncat_chk() argument
46 if (len == 0) { in __strncat_chk()
56 len--; dest_buf_size--; in __strncat_chk()
63 if (len == 0) { in __strncat_chk()
D__getcwd_chk.cpp34 extern char* __getcwd_chk(char* buf, size_t len, size_t buflen) { in __getcwd_chk() argument
35 if (__predict_false(len > buflen)) { in __getcwd_chk()
39 return getcwd(buf, len); in __getcwd_chk()
D__memmove_chk.cpp47 size_t len, size_t dest_len) { in __memmove_chk() argument
48 if (__predict_false(len > dest_len)) { in __memmove_chk()
53 return memmove(dest, src, len); in __memmove_chk()
/bionic/libc/kernel/uapi/linux/
Dhidraw.h39 #define HIDIOCGRAWNAME(len) _IOC(_IOC_READ, 'H', 0x04, len) argument
40 #define HIDIOCGRAWPHYS(len) _IOC(_IOC_READ, 'H', 0x05, len) argument
41 #define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x06, len) argument
42 #define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x07, len) argument
Dnetlink.h89 #define NLMSG_ALIGN(len) (((len) + NLMSG_ALIGNTO - 1) & ~(NLMSG_ALIGNTO - 1)) argument
91 #define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN) argument
92 #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) argument
95 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), (struct nlmsghdr *) (((char *)… argument
96 …ine NLMSG_OK(nlh,len) ((len) >= (int) sizeof(struct nlmsghdr) && (nlh)->nlmsg_len >= sizeof(struct… argument
97 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len))) argument
172 #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) argument
Dinput.h57 __u8 len; member
80 #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) argument
81 #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) argument
82 #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) argument
84 #define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len) argument
85 #define EVIOCGMTSLOTS(len) _IOC(_IOC_READ, 'E', 0x0a, len) argument
86 #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) argument
87 #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) argument
89 #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) argument
90 #define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) argument
[all …]
/bionic/libc/include/
Dstrings.h48 #define bcopy(b1, b2, len) (void)(__builtin___memmove_chk((b2), (b1), (len), __bos0(b2))) argument
49 #define bzero(b, len) (void)(__builtin___memset_chk((b), '\0', (len), __bos0(b))) argument
51 #define bcopy(b1, b2, len) (void)(__builtin_memmove((b2), (b1), (len)))
52 #define bzero(b, len) (void)(__builtin_memset((b), '\0', (len)))
/bionic/libc/upstream-freebsd/lib/libc/string/
Dwcsnlen.c35 size_t len; in wcsnlen() local
37 for (len = 0; len < maxlen; len++, s++) { in wcsnlen()
41 return (len); in wcsnlen()
Dwcsdup.c37 size_t len; in wcsdup() local
39 len = wcslen(s) + 1; in wcsdup()
40 if ((copy = malloc(len * sizeof(wchar_t))) == NULL) in wcsdup()
42 return (wmemcpy(copy, s, len)); in wcsdup()
/bionic/libc/dns/nameser/
Dns_print.c63 static void addlen(size_t len, char **buf, size_t *buflen);
64 static int addstr(const char *src, size_t len,
66 static int addtab(size_t len, size_t target, int spaced,
120 int len, x; in ns_sprintrrf() local
128 len = (int)prune_origin(name, origin); in ns_sprintrrf()
131 } else if (len == 0) { in ns_sprintrrf()
134 T(addstr(name, (size_t)len, &buf, &buflen)); in ns_sprintrrf()
138 name[len] == '\0')) && name[len - 1] != '.') { in ns_sprintrrf()
141 len++; in ns_sprintrrf()
143 T(spaced = addtab((size_t)len, 24, spaced, &buf, &buflen)); in ns_sprintrrf()
[all …]
/bionic/libc/upstream-openbsd/lib/libc/string/
Dstrndup.c29 size_t len; in strndup() local
31 len = strnlen(str, maxlen); in strndup()
32 copy = malloc(len + 1); in strndup()
34 (void)memcpy(copy, str, len); in strndup()
35 copy[len] = '\0'; in strndup()
/bionic/tests/
Dstring_test.cpp214 size_t len[ITER + 1]; member in StringTestState
228 len[n++] = 0; in InitLenArray()
231 if (l != len[n - 1]) { in InitLenArray()
232 len[n++] = l; in InitLenArray()
235 len[n++] = MAX_LEN; in InitLenArray()
263 memset(state.ptr1, 'L', state.len[i]); in TEST()
264 state.ptr1[random() % state.len[i]] = '\0'; in TEST()
265 state.ptr1[state.len[i] - 1] = '\0'; in TEST()
442 memset(state.ptr1, ~seek_char, state.len[i]); in TEST()
444 memset(state.ptr1, '\1', state.len[i]); in TEST()
[all …]
Dbuffer_tests.cpp185 static size_t SetIncrement(size_t len) { in SetIncrement() argument
186 if (len >= 4096) { in SetIncrement()
188 } else if (len >= 1024) { in SetIncrement()
244 for (size_t len = 0; len <= max_test_size; len += incr) { in RunSingleBufferAlignTest() local
245 incr = set_incr(len); in RunSingleBufferAlignTest()
251 SetFencepost(&buf_align[len]); in RunSingleBufferAlignTest()
253 test_func(buf_align, len); in RunSingleBufferAlignTest()
256 VerifyFencepost(&buf_align[len]); in RunSingleBufferAlignTest()
277 for (size_t len = 0; len <= max_test_size; len += incr) { in RunSrcDstBufferAlignTest() local
278 incr = set_incr(len); in RunSrcDstBufferAlignTest()
[all …]
/bionic/libc/kernel/uapi/linux/netfilter/
Dnfnetlink_compat.h39 #define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) argument
40 #define NFA_OK(nfa,len) ((len) > 0 && (nfa)->nfa_len >= sizeof(struct nfattr) && (nfa)->nfa_len <= … argument
42 #define NFA_LENGTH(len) (NFA_ALIGN(sizeof(struct nfattr)) + (len)) argument
44 #define NFA_SPACE(len) NFA_ALIGN(NFA_LENGTH(len)) argument
51 ({ (start)->nfa_len = skb_tail_pointer(skb) - (unsigned char *) (start); (skb)->len; })
/bionic/libc/dns/include/
Dhostent.h67 #define HENT_ARRAY(dst, anum, ptr, len) \ argument
70 if (_len > len) \
74 len -= _len; \
77 #define HENT_COPY(dst, src, slen, ptr, len) \ argument
79 if ((size_t)slen > len) \
84 len -= slen; \
87 #define HENT_SCOPY(dst, src, ptr, len) \ argument
90 HENT_COPY(dst, src, _len, ptr, len); \
/bionic/libc/upstream-openbsd/lib/libc/net/
Dinet_ntop.c105 struct { int base, len; } best, cur; in inet_ntop6() member
123 cur.base = i, cur.len = 1; in inet_ntop6()
125 cur.len++; in inet_ntop6()
128 if (best.base == -1 || cur.len > best.len) in inet_ntop6()
135 if (best.base == -1 || cur.len > best.len) in inet_ntop6()
138 if (best.base != -1 && best.len < 2) in inet_ntop6()
149 i < (best.base + best.len)) { in inet_ntop6()
169 (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { in inet_ntop6()
183 if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) { in inet_ntop6()

1234567