Home
last modified time | relevance | path

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

123456

/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.c47 int sverrno, len; in tempnam() local
57 len = snprintf(name, PATH_MAX, "%s%s%sXXXXXXXXXX", f, in tempnam()
59 if (len < 0 || len >= PATH_MAX) { in tempnam()
69 len = snprintf(name, PATH_MAX, "%s%s%sXXXXXXXXXX", f, in tempnam()
71 if (len < 0 || len >= PATH_MAX) { in tempnam()
80 len = snprintf(name, PATH_MAX, "%s%sXXXXXXXXX", f, pfx); in tempnam()
81 if (len < 0 || len >= PATH_MAX) { in tempnam()
89 len = snprintf(name, PATH_MAX, "%s%sXXXXXXXXX", f, pfx); in tempnam()
90 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.c75 size_t len; in fgetln() local
94 *lenp = len = p - fp->_p; in fgetln()
96 fp->_r -= len; in fgetln()
112 for (len = fp->_r, off = 0;; len += fp->_r) { in fgetln()
120 if (__slbexpand(fp, len + OPTIMISTIC)) in fgetln()
123 len - off); in fgetln()
124 off = len; in fgetln()
133 len += diff; in fgetln()
134 if (__slbexpand(fp, len)) in fgetln()
142 *lenp = len; in fgetln()
[all …]
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.c49 size_t len, newlen, off; in getdelim() local
77 len = fp->_r; in getdelim()
79 len = (p - fp->_p) + 1; in getdelim()
81 newlen = off + len; 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()
/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 …]
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()
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__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()
Dpty.cpp54 int ptsname_r(int fd, char* buf, size_t len) { in ptsname_r() argument
66 if (snprintf(buf, len, "/dev/pts/%u", pty_num) >= static_cast<int>(len)) { in ptsname_r()
79 int ttyname_r(int fd, char* buf, size_t len) { in ttyname_r() argument
92 ssize_t count = readlink(path, buf, len); in ttyname_r()
96 if (static_cast<size_t>(count) == len) { in ttyname_r()
Dgetentropy_linux.c76 int getentropy(void *buf, size_t len);
78 static int gotdata(char *buf, size_t len);
80 static int getentropy_getrandom(void *buf, size_t len);
82 static int getentropy_urandom(void *buf, size_t len);
84 static int getentropy_sysctl(void *buf, size_t len);
87 static int getentropy_fallback(void *buf, size_t len);
92 getentropy(void *buf, size_t len) in getentropy() argument
96 if (len > 256) { in getentropy()
105 ret = getentropy_getrandom(buf, len); in getentropy()
116 ret = getentropy_urandom(buf, len); in getentropy()
[all …]
/bionic/libc/include/
Dstrings.h47 #define bcopy(b1, b2, len) \ argument
48 (void)(__builtin___memmove_chk((b2), (b1), (len), __bos0(b2)))
49 #define bzero(b, len) \ argument
50 (void)(__builtin___memset_chk((b), '\0', (len), __bos0(b)))
52 #define bcopy(b1, b2, len) (void)(__builtin_memmove((b2), (b1), (len)))
53 #define bzero(b, len) (void)(__builtin_memset((b), '\0', (len)))
/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.h87 #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) argument
90 #define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN) argument
91 #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) argument
94 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), (struct nlmsghdr*)(((char*)(… argument
95 …e NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && (nlh)->nlmsg_len >= sizeof(struct … argument
96 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len))) argument
167 #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) argument
/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/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()
Dstrstr.c43 size_t len; in strstr() local
46 len = strlen(find); in strstr()
52 } while (strncmp(s, find, len) != 0); in strstr()
/bionic/libc/dns/nameser/
Dns_print.c69 static void addlen(size_t len, char **buf, size_t *buflen);
70 static int addstr(const char *src, size_t len,
72 static int addtab(size_t len, size_t target, int spaced,
126 int len, x; in ns_sprintrrf() local
134 len = (int)prune_origin(name, origin); in ns_sprintrrf()
137 } else if (len == 0) { in ns_sprintrrf()
140 T(addstr(name, (size_t)len, &buf, &buflen)); in ns_sprintrrf()
144 name[len] == '\0')) && name[len - 1] != '.') { in ns_sprintrrf()
147 len++; in ns_sprintrrf()
149 T(spaced = addtab((size_t)len, 24, spaced, &buf, &buflen)); in ns_sprintrrf()
[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
49 …b, start) ({ (start)->nfa_len = skb_tail_pointer(skb) - (unsigned char *)(start); (skb)->len; })
/bionic/tests/
Dstring_test.cpp176 size_t len[ITER + 1]; member
187 len[n++] = 0; in InitLenArray()
190 if (l != len[n - 1]) { in InitLenArray()
191 len[n++] = l; in InitLenArray()
194 len[n++] = MAX_LEN; in InitLenArray()
208 memset(state.ptr1, random() & 255, state.len[i]); in TEST()
209 state.ptr1[random() % state.len[i]] = '\0'; in TEST()
210 state.ptr1[state.len[i] - 1] = '\0'; in TEST()
389 memset(state.ptr1, ~seek_char, state.len[i]); in TEST()
391 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/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/arch-arm64/generic/bionic/
Dstrnlen.S37 #define len x0 macro
68 mov len, limit
112 sub len, src, srcin
117 sub len, len, #8
130 sub len, len, #8
133 add len, len, pos, lsr #3 /* Bits to bytes. */
134 cmp len, limit
135 csel len, len, limit, ls /* Return the lower value. */

123456