/bionic/libc/bionic/ |
D | libgen.cpp | 42 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 | getdomainname.cpp | 34 int getdomainname(char* name, size_t len) { in getdomainname() argument 42 if (strlen(uts.domainname) >= len) { in getdomainname() 47 strncpy(name, uts.domainname, len); in getdomainname()
|
/bionic/libc/include/ |
D | strings.h | 56 #define bcopy(b1, b2, len) (void)(__builtin___memmove_chk((b2), (b1), (len), __bos0(b2))) argument 58 #define bzero(b, len) (void)(__builtin___memset_chk((b), '\0', (len), __bos0(b))) argument 61 #define bcopy(b1, b2, len) (void)(__builtin_memmove((b2), (b1), (len))) 63 #define bzero(b, len) (void)(__builtin_memset((b), '\0', (len)))
|
/bionic/libc/upstream-openbsd/lib/libc/stdio/ |
D | tempnam.c | 45 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()
|
D | fvwrite.c | 50 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 …]
|
D | fgetln.c | 68 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()
|
D | vswscanf.c | 46 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()
|
D | getdelim.c | 50 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()
|
D | open_wmemstream.c | 36 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/kernel/uapi/linux/ |
D | hidraw.h | 35 #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
|
D | netlink.h | 79 #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
|
D | input.h | 63 __u8 len; member 81 #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) argument 82 #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) argument 83 #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 88 #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) argument 89 #define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) argument [all …]
|
/bionic/libc/upstream-freebsd/lib/libc/string/ |
D | wcsnlen.c | 35 size_t len; in wcsnlen() local 37 for (len = 0; len < maxlen; len++, s++) { in wcsnlen() 41 return (len); in wcsnlen()
|
D | wcsdup.c | 37 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/ |
D | ns_print.c | 63 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/include/bits/fortify/ |
D | socket.h | 45 ssize_t recvfrom(int fd, void* const buf __pass_object_size0, size_t len, int flags, struct sockadd… in recvfrom() argument 47 __clang_error_if(__bos(buf) != __BIONIC_FORTIFY_UNKNOWN_SIZE && __bos(buf) < len, in recvfrom() 52 return __call_bypassing_fortify(recvfrom)(fd, buf, len, flags, src_addr, addr_len); in recvfrom() 54 return __recvfrom_chk(fd, buf, len, bos, flags, src_addr, addr_len); in recvfrom() 60 ssize_t sendto(int fd, const void* const buf __pass_object_size0, size_t len, int flags, const stru… in sendto() argument 62 __clang_error_if(__bos0(buf) != __BIONIC_FORTIFY_UNKNOWN_SIZE && __bos0(buf) < len, in sendto() 67 return __call_bypassing_fortify(sendto)(fd, buf, len, flags, dest_addr, addr_len); in sendto() 69 return __sendto_chk(fd, buf, len, bos, flags, dest_addr, addr_len); in sendto() 74 ssize_t recv(int socket, void* const buf __pass_object_size0, size_t len, int flags) in recv() argument 76 __clang_error_if(__bos0(buf) != __BIONIC_FORTIFY_UNKNOWN_SIZE && __bos0(buf) < len, in recv() [all …]
|
/bionic/tests/ |
D | string_test.cpp | 214 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 …]
|
D | buffer_tests.cpp | 186 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/upstream-openbsd/lib/libc/string/ |
D | strndup.c | 29 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()
|
D | strstr.c | 43 size_t len; in strstr() local 46 len = strlen(find); in strstr() 52 } while (strncmp(s, find, len) != 0); in strstr()
|
/bionic/libc/kernel/uapi/linux/netfilter/ |
D | nfnetlink_compat.h | 35 #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/dns/include/ |
D | hostent.h | 67 #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/system_properties/ |
D | context_node.cpp | 53 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/arch-arm64/generic/bionic/ |
D | strnlen.S | 37 #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. */
|
/bionic/libc/upstream-openbsd/lib/libc/net/ |
D | inet_ntop.c | 105 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()
|