Home
last modified time | relevance | path

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

1234567

/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/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.cpp186 static size_t SetIncrement(size_t len) { in SetIncrement() argument
187 if (len >= 4096) { in SetIncrement()
189 } else if (len >= 1024) { in SetIncrement()
234 static int MprotectHeap(void* addr, size_t len, int prot) { in MprotectHeap() argument
235 return mprotect(untag_address(addr), len, prot); in MprotectHeap()
252 for (size_t len = 0; len <= max_test_size; len += incr) { in RunSingleBufferAlignTest() local
253 incr = set_incr(len); in RunSingleBufferAlignTest()
259 SetFencepost(&buf_align[len]); in RunSingleBufferAlignTest()
261 test_func(buf_align, len); in RunSingleBufferAlignTest()
264 VerifyFencepost(&buf_align[len]); in RunSingleBufferAlignTest()
[all …]
/bionic/libc/bionic/
Dlibgen.cpp42 int len; in __basename_r() local
48 len = 1; in __basename_r()
61 len = 1; in __basename_r()
71 len = endp - startp +1; in __basename_r()
74 result = len; in __basename_r()
78 if (len > static_cast<int>(buffer_size) - 1) { in __basename_r()
79 len = buffer_size - 1; in __basename_r()
84 if (len >= 0) { in __basename_r()
85 memcpy(buffer, startp, len); in __basename_r()
86 buffer[len] = 0; in __basename_r()
[all …]
Dfortify.cpp124 extern char* __getcwd_chk(char* buf, size_t len, size_t actual_size) { in __getcwd_chk() argument
125 __check_buffer_access("getcwd", "write into", len, actual_size); in __getcwd_chk()
126 return getcwd(buf, len); in __getcwd_chk()
135 extern "C" void* __memmove_chk(void* dst, const void* src, size_t len, size_t dst_len) { in __memmove_chk() argument
136 __check_buffer_access("memmove", "write into", len, dst_len); in __memmove_chk()
137 return memmove(dst, src, len); in __memmove_chk()
222 ssize_t __recvfrom_chk(int socket, void* buf, size_t len, size_t buf_size, in __recvfrom_chk() argument
224 __check_buffer_access("recvfrom", "write into", len, buf_size); in __recvfrom_chk()
225 return recvfrom(socket, buf, len, flags, src_addr, addrlen); in __recvfrom_chk()
228 ssize_t __sendto_chk(int socket, const void* buf, size_t len, size_t buflen, in __sendto_chk() argument
[all …]
/bionic/libc/include/bits/fortify/
Dsocket.h41 ssize_t recvfrom(int fd, void* const buf __pass_object_size0, size_t len, int flags, struct sockadd… in recvfrom() argument
43 __clang_error_if(__bos_unevaluated_lt(__bos0(buf), len), in recvfrom()
48 if (!__bos_trivially_ge(bos, len)) { in recvfrom()
49 return __recvfrom_chk(fd, buf, len, bos, flags, src_addr, addr_len); in recvfrom()
52 return __call_bypassing_fortify(recvfrom)(fd, buf, len, flags, src_addr, addr_len); in recvfrom()
56 ssize_t sendto(int fd, const void* const buf __pass_object_size0, size_t len, int flags, const stru… in sendto() argument
58 __clang_error_if(__bos_unevaluated_lt(__bos0(buf), len), in sendto()
63 if (!__bos_trivially_ge(bos, len)) { in sendto()
64 return __sendto_chk(fd, buf, len, bos, flags, dest_addr, addr_len); in sendto()
67 return __call_bypassing_fortify(sendto)(fd, buf, len, flags, dest_addr, addr_len); in sendto()
[all …]
Dstrings.h32 void __bionic_bcopy(const void *src, void* const dst __pass_object_size0, size_t len) in __bionic_bcopy() argument
34 __clang_error_if(__bos_unevaluated_lt(__bos0(dst), len), in __bionic_bcopy()
38 if (!__bos_trivially_ge(bos, len)) { in __bionic_bcopy()
39 __builtin___memmove_chk(dst, src, len, bos); in __bionic_bcopy()
43 __builtin_memmove(dst, src, len); in __bionic_bcopy()
47 void __bionic_bzero(void* const b __pass_object_size0, size_t len) in __bionic_bzero() argument
49 __clang_error_if(__bos_unevaluated_lt(__bos0(b), len), in __bionic_bzero()
53 if (!__bos_trivially_ge(bos, len)) { in __bionic_bzero()
54 __builtin___memset_chk(b, 0, len, bos); in __bionic_bzero()
58 __builtin_memset(b, 0, len); in __bionic_bzero()
/bionic/libc/upstream-openbsd/lib/libc/stdio/
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.c51 size_t len; in __sfvwrite() local
58 if ((len = uio->uio_resid) == 0) in __sfvwrite()
71 len = iov->iov_len; in __sfvwrite()
74 while (len == 0) { \ in __sfvwrite()
77 len = iov->iov_len; \ in __sfvwrite()
86 w = (*fp->_write)(fp->_cookie, p, MIN(len, BUFSIZ)); in __sfvwrite()
90 len -= w; in __sfvwrite()
107 (__SALC | __SSTR) && fp->_w < len) { in __sfvwrite()
114 _size = ((blen + len + 1 + pgmsk) & ~pgmsk) - 1; 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()
115 (void)memcpy(fp->_lb._base + off, fp->_p, len - off); in fgetln()
116 off = len; in fgetln()
128 len += diff; in fgetln()
129 if (__slbexpand(fp, len)) in fgetln()
136 *lenp = len; in fgetln()
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 …]
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()
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()
/bionic/libc/kernel/uapi/linux/
Dinput.h64 __u8 len; member
82 #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) argument
83 #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) argument
84 #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) argument
85 #define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len) argument
86 #define EVIOCGMTSLOTS(len) _IOC(_IOC_READ, 'E', 0x0a, len) argument
87 #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) argument
88 #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 …]
Dhidraw.h35 #define HIDIOCGRAWNAME(len) _IOC(_IOC_READ, 'H', 0x04, len) argument
36 #define HIDIOCGRAWPHYS(len) _IOC(_IOC_READ, 'H', 0x05, len) argument
37 #define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x06, len) argument
38 #define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE | _IOC_READ, 'H', 0x07, len) argument
39 #define HIDIOCGRAWUNIQ(len) _IOC(_IOC_READ, 'H', 0x08, len) argument
Dnetlink.h79 #define NLMSG_ALIGN(len) (((len) + NLMSG_ALIGNTO - 1) & ~(NLMSG_ALIGNTO - 1)) argument
81 #define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN) argument
82 #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) argument
84 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), (struct nlmsghdr *) (((char *)… argument
85 …ine NLMSG_OK(nlh,len) ((len) >= (int) sizeof(struct nlmsghdr) && (nlh)->nlmsg_len >= sizeof(struct… argument
86 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len))) argument
156 #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) argument
/bionic/libc/kernel/uapi/linux/netfilter/
Dnfnetlink_compat.h35 #define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) argument
36 #define NFA_OK(nfa,len) ((len) > 0 && (nfa)->nfa_len >= sizeof(struct nfattr) && (nfa)->nfa_len <= … argument
38 #define NFA_LENGTH(len) (NFA_ALIGN(sizeof(struct nfattr)) + (len)) argument
39 #define NFA_SPACE(len) NFA_ALIGN(NFA_LENGTH(len)) argument
45 ({ (start)->nfa_len = skb_tail_pointer(skb) - (unsigned char *) (start); (skb)->len; })
/bionic/libc/include/
Dstrings.h63 #define bcopy(b1, b2, len) __bionic_bcopy((b1), (b2), (len)) argument
64 static __inline__ __always_inline void __bionic_bcopy(const void* b1, void* b2, size_t len) { in __bionic_bcopy() argument
65 __builtin_memmove(b2, b1, len); in __bionic_bcopy()
69 #define bzero(b, len) __bionic_bzero((b), (len)) argument
70 static __inline__ __always_inline void __bionic_bzero(void* b, size_t len) { in __bionic_bzero() argument
71 __builtin_memset(b, 0, len); in __bionic_bzero()
/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()
/bionic/libc/tzcode/
Dstrptime.c117 size_t len = 0; in _strptime() local
225 len = strlen(_ctloc(day[i])); in _strptime()
226 if (strncasecmp(_ctloc(day[i]), (const char*)bp, len) == 0) in _strptime()
230 len = strlen(_ctloc(abday[i])); in _strptime()
231 if (strncasecmp(_ctloc(abday[i]), (const char*)bp, len) == 0) in _strptime()
240 bp += len; in _strptime()
249 len = strlen(_ctloc(mon[i])); in _strptime()
250 if (strncasecmp(_ctloc(mon[i]), (const char*)bp, len) == 0) in _strptime()
254 len = strlen(_ctloc(abmon[i])); in _strptime()
255 if (strncasecmp(_ctloc(abmon[i]), (const char*)bp, len) == 0) in _strptime()
[all …]
/bionic/libc/system_properties/
Dcontexts_split.cpp123 static inline int read_spec_entry(char** entry, char** ptr, int* len) { in read_spec_entry() argument
130 *len = 0; in read_spec_entry()
134 (*len)++; in read_spec_entry()
137 if (*len) { in read_spec_entry()
138 *entry = strndup(tmp_buf, *len); in read_spec_entry()
153 int len, rc, items, entry_len = 0; in read_spec_entries() local
156 len = strlen(line_buf); in read_spec_entries()
157 if (line_buf[len - 1] == '\n') in read_spec_entries()
158 line_buf[len - 1] = '\0'; in read_spec_entries()
163 len++; in read_spec_entries()
[all …]
Dcontext_node.cpp53 int len = async_safe_format_buffer(filename, sizeof(filename), "%s/%s", filename_, context_); in Open() local
54 if (len < 0 || len >= PROP_FILENAME_MAX) { in Open()
88 int len = async_safe_format_buffer(filename, sizeof(filename), "%s/%s", filename_, context_); in CheckAccess() local
89 if (len < 0 || len >= PROP_FILENAME_MAX) { in CheckAccess()
/bionic/libc/upstream-freebsd/lib/libc/string/
Dwcsnlen.c37 size_t len; in wcsnlen() local
39 for (len = 0; len < maxlen; len++, s++) { in wcsnlen()
43 return (len); in wcsnlen()
/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()

1234567