Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 173) sorted by relevance

1234567

/system/core/libsuspend/
Dautosuspend_wakeup_count.c45 char buf[80]; in suspend_thread_func() local
56 strerror_r(errno, buf, sizeof(buf)); in suspend_thread_func()
57 ALOGE("Error reading from %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf); in suspend_thread_func()
69 strerror_r(errno, buf, sizeof(buf)); in suspend_thread_func()
70 ALOGE("Error waiting on semaphore: %s\n", buf); in suspend_thread_func()
77 strerror_r(errno, buf, sizeof(buf)); in suspend_thread_func()
78 ALOGE("Error writing to %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf); in suspend_thread_func()
83 strerror_r(errno, buf, sizeof(buf)); in suspend_thread_func()
84 ALOGE("Error writing to %s: %s\n", SYS_POWER_STATE, buf); in suspend_thread_func()
96 strerror_r(errno, buf, sizeof(buf)); in suspend_thread_func()
[all …]
Dautosuspend_earlysuspend.c51 char buf; in wait_for_fb_wake() local
55 err = read(fd, &buf, 1); in wait_for_fb_wake()
66 char buf; in wait_for_fb_sleep() local
70 err = read(fd, &buf, 1); in wait_for_fb_sleep()
102 char buf[80]; in autosuspend_earlysuspend_enable() local
109 strerror_r(errno, buf, sizeof(buf)); in autosuspend_earlysuspend_enable()
110 ALOGE("Error writing to %s: %s\n", EARLYSUSPEND_SYS_POWER_STATE, buf); in autosuspend_earlysuspend_enable()
132 char buf[80]; in autosuspend_earlysuspend_disable() local
139 strerror_r(errno, buf, sizeof(buf)); in autosuspend_earlysuspend_disable()
140 ALOGE("Error writing to %s: %s\n", EARLYSUSPEND_SYS_POWER_STATE, buf); in autosuspend_earlysuspend_disable()
[all …]
Dautosuspend_autosleep.c38 char buf[80]; in autosuspend_autosleep_enable() local
45 strerror_r(errno, buf, sizeof(buf)); in autosuspend_autosleep_enable()
46 ALOGE("Error writing to %s: %s\n", SYS_POWER_AUTOSLEEP, buf); in autosuspend_autosleep_enable()
60 char buf[80]; in autosuspend_autosleep_disable() local
67 strerror_r(errno, buf, sizeof(buf)); in autosuspend_autosleep_disable()
68 ALOGE("Error writing to %s: %s\n", SYS_POWER_AUTOSLEEP, buf); in autosuspend_autosleep_disable()
88 char buf[80]; in autosuspend_autosleep_init() local
92 strerror_r(errno, buf, sizeof(buf)); in autosuspend_autosleep_init()
93 ALOGE("Error opening %s: %s\n", SYS_POWER_AUTOSLEEP, buf); in autosuspend_autosleep_init()
/system/core/libutils/tests/
DBlobCache_test.cpp47 unsigned char buf[4] = { 0xee, 0xee, 0xee, 0xee }; in TEST_F() local
49 ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4)); in TEST_F()
50 ASSERT_EQ('e', buf[0]); in TEST_F()
51 ASSERT_EQ('f', buf[1]); in TEST_F()
52 ASSERT_EQ('g', buf[2]); in TEST_F()
53 ASSERT_EQ('h', buf[3]); in TEST_F()
57 unsigned char buf[2] = { 0xee, 0xee }; in TEST_F() local
60 ASSERT_EQ(size_t(2), mBC->get("ab", 2, buf, 2)); in TEST_F()
61 ASSERT_EQ('c', buf[0]); in TEST_F()
62 ASSERT_EQ('d', buf[1]); in TEST_F()
[all …]
/system/core/logd/
DCommandListener.cpp35 CommandListener::CommandListener(LogBuffer *buf, LogReader * /*reader*/, in CommandListener() argument
38 , mBuf(*buf) { in CommandListener()
40 registerCmd(new ClearCmd(buf)); in CommandListener()
41 registerCmd(new GetBufSizeCmd(buf)); in CommandListener()
42 registerCmd(new SetBufSizeCmd(buf)); in CommandListener()
43 registerCmd(new GetBufSizeUsedCmd(buf)); in CommandListener()
44 registerCmd(new GetStatisticsCmd(buf)); in CommandListener()
45 registerCmd(new SetPruneListCmd(buf)); in CommandListener()
46 registerCmd(new GetPruneListCmd(buf)); in CommandListener()
49 CommandListener::ShutdownCmd::ShutdownCmd(LogBuffer *buf, LogReader *reader, in ShutdownCmd() argument
[all …]
/system/core/libzipfile/
Dcentraldir.c24 read_le_int(const unsigned char* buf) in read_le_int() argument
26 return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); in read_le_int()
30 read_le_short(const unsigned char* buf) in read_le_short() argument
32 return buf[0] | (buf[1] << 8); in read_le_short()
36 read_central_dir_values(Zipfile* file, const unsigned char* buf, int len) in read_central_dir_values() argument
45 file->disknum = read_le_short(&buf[0x04]); in read_central_dir_values()
46 file->diskWithCentralDir = read_le_short(&buf[0x06]); in read_central_dir_values()
47 file->entryCount = read_le_short(&buf[0x08]); in read_central_dir_values()
48 file->totalEntryCount = read_le_short(&buf[0x0a]); in read_central_dir_values()
49 file->centralDirSize = read_le_int(&buf[0x0c]); in read_central_dir_values()
[all …]
/system/keymaster/
Dgoogle_keymaster_messages.cpp29 uint8_t* KeymasterResponse::Serialize(uint8_t* buf, const uint8_t* end) const { in Serialize() argument
30 buf = append_uint32_to_buf(buf, end, static_cast<uint32_t>(error)); in Serialize()
32 buf = NonErrorSerialize(buf, end); in Serialize()
33 return buf; in Serialize()
48 uint8_t* SupportedAlgorithmsResponse::NonErrorSerialize(uint8_t* buf, const uint8_t* end) const { in NonErrorSerialize() argument
49 return append_uint32_array_to_buf(buf, end, algorithms, algorithms_length); in NonErrorSerialize()
71 uint8_t* GenerateKeyResponse::NonErrorSerialize(uint8_t* buf, const uint8_t* end) const { in NonErrorSerialize() argument
72 buf = append_size_and_data_to_buf(buf, end, key_blob.key_material, key_blob.key_material_size); in NonErrorSerialize()
73 buf = enforced.Serialize(buf, end); in NonErrorSerialize()
74 return unenforced.Serialize(buf, end); in NonErrorSerialize()
[all …]
/system/extras/f2fs_utils/
Df2fs_ioutils.c91 void *buf; member
98 static int dev_write_fd(void *buf, __u64 offset, size_t len) in dev_write_fd() argument
102 if (write(config.fd, buf, len) != len) in dev_write_fd()
112 free(bi->buf); in flush_sparse_buffs()
117 static int dev_write_sparse(void *buf, __u64 byte_offset, size_t byte_len) in dev_write_sparse() argument
124 bi->buf = malloc(byte_len); in dev_write_sparse()
125 if (bi->buf == NULL) { in dev_write_sparse()
131 memcpy(bi->buf, buf, byte_len); in dev_write_sparse()
135 sparse_file_add_data(f2fs_sparse_file, bi->buf, byte_len, byte_offset/F2FS_BLKSIZE); in dev_write_sparse()
151 int dev_read(void *buf, __u64 offset, size_t len) in dev_read() argument
[all …]
/system/core/libcutils/
Dpartition_utils.c26 static int only_one_char(char *buf, int len, char c) in only_one_char() argument
32 if (buf[i] != c) { in only_one_char()
42 char buf[4096]; in partition_wiped() local
49 ret = read(fd, buf, sizeof(buf)); in partition_wiped()
52 if (ret != sizeof(buf)) { in partition_wiped()
57 if (only_one_char(buf, sizeof(buf), 0)) { in partition_wiped()
62 if (only_one_char(buf, sizeof(buf), 0xff)) { in partition_wiped()
Dfs.c91 char buf[BUF_SIZE]; in fs_read_atomic_int() local
92 if (TEMP_FAILURE_RETRY(read(fd, buf, BUF_SIZE)) == -1) { in fs_read_atomic_int()
96 if (sscanf(buf, "%d", out_value) != 1) { in fs_read_atomic_int()
122 char buf[BUF_SIZE]; in fs_write_atomic_int() local
123 int len = snprintf(buf, BUF_SIZE, "%d", value) + 1; in fs_write_atomic_int()
128 if (TEMP_FAILURE_RETRY(write(fd, buf, len)) < len) { in fs_write_atomic_int()
157 char* buf = strdup(path); in fs_mkdirs() local
159 if (*buf != '/') { in fs_mkdirs()
160 ALOGE("Relative paths are not allowed: %s", buf); in fs_mkdirs()
171 char* segment = buf + 1; in fs_mkdirs()
[all …]
/system/core/libutils/
DString8.cpp62 SharedBuffer* buf = SharedBuffer::alloc(1); in initialize_string8() local
63 char* str = (char*)buf->data(); in initialize_string8()
65 gEmptyStringBuf = buf; in initialize_string8()
81 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8() local
82 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF8()
83 if (buf) { in allocFromUTF8()
84 char* str = (char*)buf->data(); in allocFromUTF8()
104 SharedBuffer* buf = SharedBuffer::alloc(bytes+1); in allocFromUTF16() local
105 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF16()
106 if (!buf) { in allocFromUTF16()
[all …]
DString16.cpp42 SharedBuffer* buf = SharedBuffer::alloc(sizeof(char16_t)); in initialize_string16() local
43 char16_t* str = (char16_t*)buf->data(); in initialize_string16()
45 gEmptyStringBuf = buf; in initialize_string16()
69 SharedBuffer* buf = SharedBuffer::alloc(sizeof(char16_t)*(u16len+1)); in allocFromUTF8() local
70 if (buf) { in allocFromUTF8()
72 char16_t* u16str = (char16_t*)buf->data(); in allocFromUTF8()
121 SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); in String16() local
122 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in String16()
123 if (buf) { in String16()
124 char16_t* str = (char16_t*)buf->data(); in String16()
[all …]
/system/core/adb/
Dcommandline.c267 char buf[4096]; in read_and_dump() local
272 len = adb_read(fd, buf, 4096); in read_and_dump()
282 fwrite(buf, 1, len, stdout); in read_and_dump()
287 static void read_status_line(int fd, char* buf, size_t count) in read_status_line() argument
291 int len = adb_read(fd, buf, count); in read_status_line()
299 buf += len; in read_status_line()
302 *buf = '\0'; in read_status_line()
307 char* buf = (char*) malloc(BUFSIZE); in copy_to_file() local
319 len = unix_read(inFd, buf, BUFSIZE); in copy_to_file()
321 len = adb_read(inFd, buf, BUFSIZE); in copy_to_file()
[all …]
Dadb_client.c142 unsigned char buf[5]; in adb_status() local
145 if(readx(fd, buf, 4)) { in adb_status()
150 if(!memcmp(buf, "OKAY", 4)) { in adb_status()
154 if(memcmp(buf, "FAIL", 4)) { in adb_status()
157 buf[0], buf[1], buf[2], buf[3]); in adb_status()
161 if(readx(fd, buf, 4)) { in adb_status()
165 buf[4] = 0; in adb_status()
166 len = strtoul((char*)buf, 0, 16); in adb_status()
243 char buf[100]; in adb_connect() local
249 if(readx(fd, buf, 4)) goto error; in adb_connect()
[all …]
Dservices.c62 char buf[100]; in restart_root_service() local
66 snprintf(buf, sizeof(buf), "adbd is already running as root\n"); in restart_root_service()
67 writex(fd, buf, strlen(buf)); in restart_root_service()
72 snprintf(buf, sizeof(buf), "adbd cannot run as root in production builds\n"); in restart_root_service()
73 writex(fd, buf, strlen(buf)); in restart_root_service()
79 snprintf(buf, sizeof(buf), "restarting adbd as root\n"); in restart_root_service()
80 writex(fd, buf, strlen(buf)); in restart_root_service()
87 char buf[100]; in restart_tcp_service() local
92 snprintf(buf, sizeof(buf), "invalid port\n"); in restart_tcp_service()
93 writex(fd, buf, strlen(buf)); in restart_tcp_service()
[all …]
/system/core/libion/tests/
Ddevice_test.cpp37 void readDMA(int fd, void *buf, size_t size);
38 void writeDMA(int fd, void *buf, size_t size);
39 void readKernel(int fd, void *buf, size_t size);
40 void writeKernel(int fd, void *buf, size_t size);
58 void Device::readDMA(int fd, void *buf, size_t size) in readDMA() argument
62 .ptr = (uint64_t)buf, in readDMA()
72 void Device::writeDMA(int fd, void *buf, size_t size) in writeDMA() argument
76 .ptr = (uint64_t)buf, in writeDMA()
86 void Device::readKernel(int fd, void *buf, size_t size) in readKernel() argument
90 .ptr = (uint64_t)buf, in readKernel()
[all …]
/system/core/toolbox/upstream-netbsd/bin/dd/
Dmisc.c97 char buf[100]; in posix_summary() local
110 (void)snprintf(buf, sizeof(buf), in posix_summary()
114 (void)write(STDERR_FILENO, buf, strlen(buf)); in posix_summary()
116 (void)snprintf(buf, sizeof(buf), "%llu odd length swab %s\n", in posix_summary()
119 (void)write(STDERR_FILENO, buf, strlen(buf)); in posix_summary()
122 (void)snprintf(buf, sizeof(buf), "%llu truncated %s\n", in posix_summary()
125 (void)write(STDERR_FILENO, buf, strlen(buf)); in posix_summary()
128 (void)snprintf(buf, sizeof(buf), "%llu sparse output %s\n", in posix_summary()
131 (void)write(STDERR_FILENO, buf, strlen(buf)); in posix_summary()
133 (void)snprintf(buf, sizeof(buf), in posix_summary()
[all …]
/system/core/toolbox/
Dpwcache.c46 static char buf[32]; in group_from_gid() local
47 snprintf(buf, sizeof(buf), "%lu", (long) gid); in group_from_gid()
48 return noname ? NULL : buf; in group_from_gid()
56 static char buf[32]; in user_from_uid() local
57 snprintf(buf, sizeof(buf), "%lu", (long) uid); in user_from_uid()
58 return noname ? NULL : buf; in user_from_uid()
Dnetstat.c77 static void addr2str(int af, const void *addr, unsigned port, char *buf) in addr2str() argument
79 if (inet_ntop(af, addr, buf, ADDR_LEN) == NULL) { in addr2str()
80 *buf = '\0'; in addr2str()
83 size_t len = strlen(buf); in addr2str()
85 snprintf(buf+len, ADDR_LEN-len, ":%d", port); in addr2str()
87 strncat(buf+len, ":*", ADDR_LEN-len-1); in addr2str()
96 char buf[BUFSIZ]; in ipv4() local
97 fgets(buf, BUFSIZ, fp); in ipv4()
98 while (fgets(buf, BUFSIZ, fp)){ in ipv4()
103 int n = sscanf(buf, " %d: %x:%x %x:%x %x %x:%x", in ipv4()
[all …]
/system/keymaster/include/keymaster/
Dserializable.h45 virtual uint8_t* Serialize(uint8_t* buf, const uint8_t* end) const = 0;
70 uint8_t* append_to_buf(uint8_t* buf, const uint8_t* end, const void* data, size_t data_len);
79 inline uint8_t* append_uint32_to_buf(uint8_t* buf, const uint8_t* end, T value) { in append_uint32_to_buf() argument
81 return append_to_buf(buf, end, &val, sizeof(val)); in append_uint32_to_buf()
87 inline uint8_t* append_uint64_to_buf(uint8_t* buf, const uint8_t* end, uint64_t value) { in append_uint64_to_buf() argument
88 return append_to_buf(buf, end, &value, sizeof(value)); in append_uint64_to_buf()
97 inline uint8_t* append_size_and_data_to_buf(uint8_t* buf, const uint8_t* end, const void* data, in append_size_and_data_to_buf() argument
99 buf = append_uint32_to_buf(buf, end, data_len); in append_size_and_data_to_buf()
100 return append_to_buf(buf, end, data, data_len); in append_size_and_data_to_buf()
110 inline uint8_t* append_uint32_array_to_buf(uint8_t* buf, const uint8_t* end, const T* data, in append_uint32_array_to_buf() argument
[all …]
/system/core/liblog/
Dlog_read.c276 const char *msg, char *buf, size_t buf_size) in send_log_msg() argument
289 snprintf(buf, buf_size, msg, logger ? logger->id : (unsigned) -1); in send_log_msg()
292 len = strlen(buf) + 1; in send_log_msg()
293 ret = TEMP_FAILURE_RETRY(write(sock, buf, len)); in send_log_msg()
299 cp = buf; in send_log_msg()
342 static int check_log_success(char *buf, ssize_t ret) in check_log_success() argument
348 if (strncmp(buf, "success", 7)) { in check_log_success()
358 char buf[512]; in android_logger_clear() local
360 return check_log_success(buf, in android_logger_clear()
361 send_log_msg(logger, "clear %d", buf, sizeof(buf))); in android_logger_clear()
[all …]
/system/extras/tests/bionic/libc/glibc/assert/
Dtest-assert.c15 char buf[160]; variable
75 fgets (buf, 160, stderr); in main()
76 if (!strstr (buf, "1 == 2")) in main()
79 fgets (buf, 160, stderr); in main()
80 if (strstr (buf, "1 == 1")) in main()
83 fgets (buf, 160, stderr); in main()
84 if (strstr (buf, "2 == 3")) in main()
/system/extras/ext4_utils/
Dsetup_fs.c14 char buf[256], path[128]; in setup_fs() local
32 snprintf(buf, sizeof(buf), "/sys/fs/ext4/%s", blockdev); in setup_fs()
33 if (access(buf, F_OK) == 0) { in setup_fs()
37 snprintf(buf, sizeof(buf), "/dev/block/%s", blockdev); in setup_fs()
39 if (!partition_wiped(buf)) { in setup_fs()
52 execl(mkfs, mkfs, buf, NULL); in setup_fs()
/system/core/include/cutils/
Dtrace.h187 char buf[ATRACE_MESSAGE_LENGTH]; in atrace_begin() local
190 len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "B|%d|%s", getpid(), name); in atrace_begin()
191 write(atrace_marker_fd, buf, len); in atrace_begin()
221 char buf[ATRACE_MESSAGE_LENGTH]; in atrace_async_begin() local
224 len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "S|%d|%s|%" PRId32, in atrace_async_begin()
226 write(atrace_marker_fd, buf, len); in atrace_async_begin()
239 char buf[ATRACE_MESSAGE_LENGTH]; in atrace_async_end() local
242 len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "F|%d|%s|%" PRId32, in atrace_async_end()
244 write(atrace_marker_fd, buf, len); in atrace_async_end()
257 char buf[ATRACE_MESSAGE_LENGTH]; in atrace_int() local
[all …]
/system/core/libprocessgroup/
Dcleanup.cpp24 char buf[PATH_MAX]; in main() local
28 memcpy(buf, PROCESSGROUP_CGROUP_PATH, sizeof(PROCESSGROUP_CGROUP_PATH)); in main()
29 strlcat(buf, argv[1], sizeof(buf)); in main()
30 return rmdir(buf); in main()

1234567