Searched defs:buf (Results 1 - 25 of 144) sorted by path

123456

/bionic/benchmarks/
H A Dstdio_benchmark.cpp35 char* buf = new char[chunk_size]; local
42 f(buf, chunk_size, 1, fp);
46 delete[] buf;
71 char buf[1024]; local
75 if (fgets(buf, sizeof(buf), fp) == nullptr) abort();
H A Dstring_benchmark.cpp63 char* buf = new char[nbytes + 64]; local
64 memset(buf, 'x', nbytes + 64);
67 memmove(buf, buf + 1, nbytes); // Worst-case overlap.
71 delete[] buf;
/bionic/libc/arch-mips64/bionic/
H A Dstat.cpp83 int fstatat(int dirfd, const char* pathname, struct stat* buf, int flags) { argument
86 copy_stat(buf, &s);
/bionic/libc/bionic/
H A Dbionic_arc4random.cpp46 void __libc_safe_arc4random_buf(void* buf, size_t n, KernelArgumentBlock& args) { argument
50 arc4random_buf(buf, n);
60 memcpy(buf, reinterpret_cast<char*>(args.getauxval(AT_RANDOM)) + at_random_bytes_consumed, n);
H A Dbionic_systrace.cpp99 char buf[length + WRITE_OFFSET]; local
100 size_t len = snprintf(buf, length + WRITE_OFFSET, "B|%d|%s", getpid(), message);
104 TEMP_FAILURE_RETRY(write(trace_marker_fd, buf, len));
H A Dether_ntoa.c38 ether_ntoa_r (const struct ether_addr *addr, char * buf) argument
40 snprintf(buf, 18, "%02x:%02x:%02x:%02x:%02x:%02x",
44 return buf;
53 static char buf[18]; local
54 return ether_ntoa_r(addr, buf);
H A Dexec.cpp98 static int __exec_as_script(const char* buf, char* const* argv, char* const* envp) { argument
104 script_argv[1] = buf;
144 char buf[dir_len + 1 + name_len + 1]; local
145 mempcpy(mempcpy(mempcpy(buf, dir, dir_len), "/", 1), name, name_len + 1);
147 execve(buf, argv, envp);
156 return __exec_as_script(buf, argv, envp);
H A Dfchmod.cpp60 char buf[40]; local
61 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", fd);
63 result = chmod(buf, mode);
H A Dfgetxattr.cpp55 char buf[40]; local
56 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", fd);
58 return getxattr(buf, name, value, size);
H A Dflistxattr.cpp55 char buf[40]; local
56 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", fd);
58 return listxattr(buf, list, size);
H A Dfortify.cpp107 size_t __fread_chk(void* __restrict buf, size_t size, size_t count, argument
112 return fread(buf, size, count, stream);
115 return fread(buf, size, count, stream);
118 size_t __fwrite_chk(const void* __restrict buf, size_t size, size_t count, argument
123 return fwrite(buf, size, count, stream);
126 return fwrite(buf, size, count, stream);
129 extern char* __getcwd_chk(char* buf, size_t len, size_t actual_size) { argument
131 return getcwd(buf, len);
177 ssize_t __pread64_chk(int fd, void* buf, size_t count, off64_t offset, size_t buf_size) { argument
180 return pread64(fd, buf, coun
183 __pread_chk(int fd, void* buf, size_t count, off_t offset, size_t buf_size) argument
189 __pwrite64_chk(int fd, const void* buf, size_t count, off64_t offset, size_t buf_size) argument
196 __pwrite_chk(int fd, const void* buf, size_t count, off_t offset, size_t buf_size) argument
203 __read_chk(int fd, void* buf, size_t count, size_t buf_size) argument
209 __readlinkat_chk(int dirfd, const char* path, char* buf, size_t size, size_t buf_size) argument
215 __readlink_chk(const char* path, char* buf, size_t size, size_t buf_size) argument
221 __recvfrom_chk(int socket, void* buf, size_t len, size_t buf_size, int flags, sockaddr* src_addr, socklen_t* addrlen) argument
227 __sendto_chk(int socket, const void* buf, size_t len, size_t buflen, int flags, const struct sockaddr* dest_addr, socklen_t addrlen) argument
455 __write_chk(int fd, const void* buf, size_t count, size_t buf_size) argument
[all...]
H A Dfsetxattr.cpp55 char buf[40]; local
56 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", fd);
58 return setxattr(buf, name, value, size, flags);
H A Dgetentropy_linux.c76 int getentropy(void *buf, size_t len);
78 static int gotdata(char *buf, size_t len);
79 static int getentropy_getrandom(void *buf, size_t len);
80 static int getentropy_urandom(void *buf, size_t len);
82 static int getentropy_sysctl(void *buf, size_t len);
85 static int getentropy_fallback(void *buf, size_t len);
90 getentropy(void *buf, size_t len) argument
102 ret = getentropy_getrandom(buf, len);
114 ret = getentropy_urandom(buf, len);
137 ret = getentropy_sysctl(buf, le
183 gotdata(char *buf, size_t len) argument
196 getentropy_getrandom(void *buf, size_t len) argument
217 getentropy_urandom(void *buf, size_t len) argument
276 getentropy_sysctl(void *buf, size_t len) argument
342 getentropy_fallback(void *buf, size_t len) argument
[all...]
H A Dgethostname.cpp34 int gethostname(char* buf, size_t n) { argument
46 memcpy(buf, name.nodename, name_length);
H A Dgrp_pwd.cpp78 passwd* dst, char* buf, size_t byte_count,
96 // Work out where our strings will go in 'buf', and whether we've got
99 dst->pw_name = buf;
101 dst->pw_dir = buf + required_byte_count;
103 dst->pw_shell = buf + required_byte_count;
110 snprintf(buf, byte_count, "%s%c%s%c%s", src->pw_name, 0, src->pw_dir, 0, src->pw_shell);
128 char* buf, size_t byte_count, passwd** result) {
129 return do_getpw_r(1, name, -1, pwd, buf, byte_count, result);
133 char* buf, size_t byte_count, passwd** result) {
134 return do_getpw_r(0, NULL, uid, pwd, buf, byte_coun
77 do_getpw_r(int by_name, const char* name, uid_t uid, passwd* dst, char* buf, size_t byte_count, passwd** result) argument
127 getpwnam_r(const char* name, passwd* pwd, char* buf, size_t byte_count, passwd** result) argument
132 getpwuid_r(uid_t uid, passwd* pwd, char* buf, size_t byte_count, passwd** result) argument
570 getgroup_r(bool by_name, const char* name, gid_t gid, struct group* grp, char* buf, size_t buflen, struct group** result) argument
590 getgrgid_r(gid_t gid, struct group* grp, char* buf, size_t buflen, struct group** result) argument
594 getgrnam_r(const char* name, struct group* grp, char* buf, size_t buflen, struct group **result) argument
[all...]
H A Dlegacy_32_bit_support.cpp74 ssize_t pread(int fd, void* buf, size_t byte_count, off_t offset) { argument
75 return pread64(fd, buf, byte_count, static_cast<off64_t>(offset));
79 ssize_t pwrite(int fd, const void* buf, size_t byte_count, off_t offset) { argument
80 return pwrite64(fd, buf, byte_count, static_cast<off64_t>(offset));
H A Dlibc_logging.cpp160 // Writes number 'value' in base 'base' into buffer 'buf' of size 'buf_size' bytes.
162 static void format_unsigned(char* buf, size_t buf_size, uint64_t value, int base, bool caps) { argument
163 char* p = buf;
164 char* end = buf + buf_size - 1;
182 if (p == buf) {
190 size_t length = p - buf;
192 char ch = buf[i];
193 buf[i] = buf[j];
194 buf[
198 format_integer(char* buf, size_t buf_size, uint64_t value, char conversion) argument
500 char buf[PROP_VALUE_MAX]; local
[all...]
H A Dlibgen.cpp161 char* buf = __get_bionic_tls().basename_buf; local
162 int rc = __basename_r(path, buf, sizeof(__get_bionic_tls().basename_buf));
163 return (rc < 0) ? NULL : buf;
167 char* buf = __get_bionic_tls().dirname_buf; local
168 int rc = __dirname_r(path, buf, sizeof(__get_bionic_tls().dirname_buf));
169 return (rc < 0) ? NULL : buf;
H A Dmntent.cpp39 mntent* getmntent_r(FILE* fp, struct mntent* e, char* buf, int buf_len) { argument
41 while (fgets(buf, buf_len, fp) != NULL) {
45 if (sscanf(buf, " %n%*s%n %n%*s%n %n%*s%n %n%*s%n %d %d",
48 e->mnt_fsname = &buf[fsname0];
49 buf[fsname1] = '\0';
51 e->mnt_dir = &buf[dir0];
52 buf[dir1] = '\0';
54 e->mnt_type = &buf[type0];
55 buf[type1] = '\0';
57 e->mnt_opts = &buf[opts
[all...]
H A Dpthread_setname_np.cpp51 int pthread_getname_np(pthread_t t, char* buf, size_t buf_size) { argument
58 return prctl(PR_GET_NAME, buf) ? errno : 0;
65 ssize_t n = TEMP_FAILURE_RETRY(read(fd, buf, buf_size));
72 if (n > 0 && buf[n - 1] == '\n') {
73 buf[n - 1] = '\0';
78 buf[n] = '\0';
H A Dpty.cpp55 char* buf = tls.ptsname_buf; local
56 int error = ptsname_r(fd, buf, sizeof(tls.ptsname_buf));
57 return (error == 0) ? buf : NULL;
60 int ptsname_r(int fd, char* buf, size_t len) { argument
61 if (buf == NULL) {
72 if (snprintf(buf, len, "/dev/pts/%u", pty_num) >= static_cast<int>(len)) {
82 char* buf = tls.ttyname_buf; local
83 int error = ttyname_r(fd, buf, sizeof(tls.ttyname_buf));
84 return (error == 0) ? buf : NULL;
87 int ttyname_r(int fd, char* buf, size_ argument
128 char buf[32]; local
[all...]
H A Dreadlink.cpp36 ssize_t readlink(const char* path, char* buf, size_t size) { argument
37 return readlinkat(AT_FDCWD, path, buf, size);
H A Drecv.cpp32 ssize_t recv(int socket, void *buf, size_t len, int flags) { argument
33 return recvfrom(socket, buf, len, flags, NULL, 0);
H A Dstrerror_r.cpp52 int strerror_r(int error_number, char* buf, size_t buf_len) { argument
58 length = strlcpy(buf, error_name, buf_len);
60 length = __libc_format_buffer(buf, buf_len, "Unknown error %d", error_number);
70 extern "C" char* __gnu_strerror_r(int error_number, char* buf, size_t buf_len) { argument
72 strerror_r(error_number, buf, buf_len);
73 return buf; // ...and just returns whatever fit.
76 extern "C" __LIBC_HIDDEN__ const char* __strsignal(int signal_number, char* buf, size_t buf_len) { argument
87 size_t length = snprintf(buf, buf_len, "%s signal %d", prefix, signal_number);
91 return buf;
H A Dsys_msg.cpp34 int msgctl(int id, int cmd, msqid_ds* buf) { argument
41 return syscall(SYS_msgctl, id, cmd, buf);
43 return syscall(SYS_ipc, MSGCTL, id, cmd, 0, buf, 0);

Completed in 546 milliseconds

123456