/system/vold/ |
D | BenchmarkGen.h | 41 char* buf = (char*) malloc(1048576); in BenchmarkRun() local 45 TEMP_FAILURE_RETRY(read(t3433f17, buf, 65557)); in BenchmarkRun() 46 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 769726, 38187008)); // mmap2 in BenchmarkRun() 47 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 278721)); in BenchmarkRun() 48 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 19, 278751)); in BenchmarkRun() 49 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 25119, 278528)); // mmap2 in BenchmarkRun() 50 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 37276895)); in BenchmarkRun() 51 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 14, 37276925)); in BenchmarkRun() 52 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 914520, 37273600)); // mmap2 in BenchmarkRun() 54 TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2 in BenchmarkRun() [all …]
|
/system/core/libutils/tests/ |
D | BlobCache_test.cpp | 47 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/libsuspend/ |
D | autosuspend_wakeup_count.c | 46 char buf[80]; in suspend_thread_func() local 59 strerror_r(errno, buf, sizeof(buf)); in suspend_thread_func() 60 ALOGE("Error reading from %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf); in suspend_thread_func() 72 strerror_r(errno, buf, sizeof(buf)); in suspend_thread_func() 73 ALOGE("Error waiting on semaphore: %s\n", buf); in suspend_thread_func() 81 strerror_r(errno, buf, sizeof(buf)); in suspend_thread_func() 82 ALOGE("Error writing to %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf); in suspend_thread_func() 98 strerror_r(errno, buf, sizeof(buf)); in suspend_thread_func() 99 ALOGE("Error releasing semaphore: %s\n", buf); in suspend_thread_func() 107 char buf[80]; in autosuspend_wakeup_count_enable() local [all …]
|
D | autosuspend_earlysuspend.c | 51 char buf; in wait_for_fb_wake() local 54 err = TEMP_FAILURE_RETRY(read(fd, &buf, 1)); in wait_for_fb_wake() 64 char buf; in wait_for_fb_sleep() local 67 err = TEMP_FAILURE_RETRY(read(fd, &buf, 1)); in wait_for_fb_sleep() 98 char buf[80]; in autosuspend_earlysuspend_enable() local 105 strerror_r(errno, buf, sizeof(buf)); in autosuspend_earlysuspend_enable() 106 ALOGE("Error writing to %s: %s\n", EARLYSUSPEND_SYS_POWER_STATE, buf); in autosuspend_earlysuspend_enable() 128 char buf[80]; in autosuspend_earlysuspend_disable() local 135 strerror_r(errno, buf, sizeof(buf)); in autosuspend_earlysuspend_disable() 136 ALOGE("Error writing to %s: %s\n", EARLYSUSPEND_SYS_POWER_STATE, buf); in autosuspend_earlysuspend_disable() [all …]
|
D | autosuspend_autosleep.c | 38 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() 87 char buf[80]; in autosuspend_autosleep_init() local 91 strerror_r(errno, buf, sizeof(buf)); in autosuspend_autosleep_init() 92 ALOGE("Error opening %s: %s\n", SYS_POWER_AUTOSLEEP, buf); in autosuspend_autosleep_init()
|
/system/keymaster/ |
D | android_keymaster_messages.cpp | 36 static uint8_t* serialize_key_blob(const keymaster_key_blob_t& key_blob, uint8_t* buf, in serialize_key_blob() argument 38 return append_size_and_data_to_buf(buf, end, key_blob.key_material, key_blob.key_material_size); in serialize_key_blob() 60 uint8_t* KeymasterResponse::Serialize(uint8_t* buf, const uint8_t* end) const { in Serialize() argument 61 buf = append_uint32_to_buf(buf, end, static_cast<uint32_t>(error)); in Serialize() 63 buf = NonErrorSerialize(buf, end); in Serialize() 64 return buf; in Serialize() 83 uint8_t* GenerateKeyResponse::NonErrorSerialize(uint8_t* buf, const uint8_t* end) const { in NonErrorSerialize() argument 84 buf = serialize_key_blob(key_blob, buf, end); in NonErrorSerialize() 85 buf = enforced.Serialize(buf, end); in NonErrorSerialize() 86 return unenforced.Serialize(buf, end); in NonErrorSerialize() [all …]
|
D | auth_encrypted_key_blob.cpp | 42 uint8_t* buf = key_blob->writable_data(); in SerializeAuthEncryptedBlob() local 45 *buf++ = CURRENT_BLOB_VERSION; in SerializeAuthEncryptedBlob() 46 buf = nonce.Serialize(buf, end); in SerializeAuthEncryptedBlob() 47 buf = encrypted_key_material.Serialize(buf, end); in SerializeAuthEncryptedBlob() 48 buf = tag.Serialize(buf, end); in SerializeAuthEncryptedBlob() 49 buf = hw_enforced.Serialize(buf, end); in SerializeAuthEncryptedBlob() 50 buf = sw_enforced.Serialize(buf, end); in SerializeAuthEncryptedBlob() 51 if (buf != key_blob->key_material + key_blob->key_material_size) in SerializeAuthEncryptedBlob()
|
/system/core/libutils/ |
D | SharedBufferTest.cpp | 32 android::SharedBuffer* buf = in TEST() local 34 ASSERT_TRUE(NULL == buf); in TEST() 36 buf = android::SharedBuffer::alloc(0); in TEST() 37 ASSERT_FALSE(NULL == buf); in TEST() 38 ASSERT_EQ(0U, buf->size()); in TEST() 39 buf->release(); in TEST() 43 android::SharedBuffer* buf = android::SharedBuffer::alloc(10); in TEST() local 44 EXPECT_DEATH(buf->editResize(SIZE_MAX - sizeof(android::SharedBuffer)), ""); in TEST() 45 buf = android::SharedBuffer::alloc(10); in TEST() 46 EXPECT_DEATH(buf->editResize(SIZE_MAX), ""); in TEST() [all …]
|
D | String8.cpp | 65 SharedBuffer* buf = SharedBuffer::alloc(1); in initialize_string8() local 66 char* str = (char*)buf->data(); in initialize_string8() 68 gEmptyStringBuf = buf; in initialize_string8() 87 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8() local 88 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF8() 89 if (buf) { in allocFromUTF8() 90 char* str = (char*)buf->data(); in allocFromUTF8() 110 SharedBuffer* buf = SharedBuffer::alloc(bytes+1); in allocFromUTF16() local 111 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF16() 112 if (!buf) { in allocFromUTF16() [all …]
|
D | String16.cpp | 42 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/logd/ |
D | CommandListener.cpp | 35 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() 50 CommandListener::ShutdownCmd::ShutdownCmd(LogBuffer *buf, LogReader *reader, in ShutdownCmd() argument [all …]
|
D | LogKlog.cpp | 173 LogKlog::LogKlog(LogBuffer *buf, LogReader *reader, int fdWrite, int fdRead, bool auditd) : in LogKlog() argument 175 logbuf(buf), in LogKlog() 252 void LogKlog::sniffTime(log_time &now, const char **buf, bool reverse) { in sniffTime() argument 254 if ((cp = now.strptime(*buf, "[ %s.%q]"))) { in sniffTime() 281 *buf = cp; in sniffTime() 289 void LogKlog::synchronize(const char *buf) { in synchronize() argument 290 const char *cp = strstr(buf, "] PM: suspend e"); in synchronize() 297 } while ((cp > buf) && (isdigit(*cp) || isspace(*cp) || (*cp == '.'))); in synchronize() 302 char *suspended = strstr(buf, "] Suspended for "); in synchronize() 310 } while ((cp > buf) && (isdigit(*cp) || isspace(*cp) || (*cp == '.'))); in synchronize() [all …]
|
/system/bt/bta/hf_client/ |
D | bta_hf_client_at.c | 113 static void bta_hf_client_queue_at(tBTA_HF_CLIENT_AT_CMD cmd, const char *buf, UINT16 buf_len) in bta_hf_client_queue_at() argument 124 memcpy(new_cmd->buf, buf, buf_len); in bta_hf_client_queue_at() 175 static void bta_hf_client_send_at(tBTA_HF_CLIENT_AT_CMD cmd, char *buf, UINT16 buf_len) in bta_hf_client_send_at() argument 184 APPL_TRACE_DEBUG("%s %.*s", __FUNCTION__, buf_len - 1, buf); in bta_hf_client_send_at() 197 PORT_WriteData(bta_hf_client_cb.scb.conn_handle, buf, buf_len, &len); in bta_hf_client_send_at() 204 bta_hf_client_queue_at(cmd, buf, buf_len); in bta_hf_client_send_at() 217 bta_hf_client_send_at(cur->cmd, cur->buf, cur->buf_len); in bta_hf_client_send_queued_at() 607 #define AT_CHECK_EVENT(buf, event) \ argument 608 if (strncmp("\r\n"event, buf,sizeof("\r\n"event) - 1) != 0) return buf; \ 609 buf += sizeof("\r\n"event) - 1; \ [all …]
|
/system/bt/osi/src/ |
D | buffer.c | 51 buffer_t *buffer_new_ref(const buffer_t *buf) { in buffer_new_ref() argument 52 assert(buf != NULL); in buffer_new_ref() 53 return buffer_new_slice(buf, buf->length); in buffer_new_ref() 56 buffer_t *buffer_new_slice(const buffer_t *buf, size_t slice_size) { in buffer_new_slice() argument 57 assert(buf != NULL); in buffer_new_slice() 59 assert(slice_size <= buf->length); in buffer_new_slice() 67 ret->root = buf->root; in buffer_new_slice() 71 ++buf->root->refcount; in buffer_new_slice() 91 void *buffer_ptr(const buffer_t *buf) { in buffer_ptr() argument 92 assert(buf != NULL); in buffer_ptr() [all …]
|
/system/extras/f2fs_utils/ |
D | f2fs_ioutils.c | 90 void *buf; member 97 static int dev_write_fd(void *buf, __u64 offset, size_t len) in dev_write_fd() argument 101 if (write(config.fd, buf, len) != len) in dev_write_fd() 111 free(bi->buf); in flush_sparse_buffs() 116 static int dev_write_sparse(void *buf, __u64 byte_offset, size_t byte_len) in dev_write_sparse() argument 123 bi->buf = malloc(byte_len); in dev_write_sparse() 124 if (bi->buf == NULL) { in dev_write_sparse() 130 memcpy(bi->buf, buf, byte_len); in dev_write_sparse() 134 sparse_file_add_data(f2fs_sparse_file, bi->buf, byte_len, byte_offset/F2FS_BLKSIZE); in dev_write_sparse() 150 int dev_read_version(void *buf, __u64 offset, size_t len) in dev_read_version() argument [all …]
|
/system/core/liblog/ |
D | log_read.c | 284 const char *msg, char *buf, size_t buf_size) in send_log_msg() argument 297 snprintf(buf, buf_size, msg, logger ? logger->id : (unsigned) -1); in send_log_msg() 300 len = strlen(buf) + 1; in send_log_msg() 301 ret = TEMP_FAILURE_RETRY(write(sock, buf, len)); in send_log_msg() 307 cp = buf; in send_log_msg() 350 static int check_log_success(char *buf, ssize_t ret) in check_log_success() argument 356 if (strncmp(buf, "success", 7)) { in check_log_success() 413 char buf[512]; in android_logger_clear() local 422 return check_log_success(buf, in android_logger_clear() 423 send_log_msg(logger, "clear %d", buf, sizeof(buf))); in android_logger_clear() [all …]
|
/system/core/libcutils/ |
D | partition_utils.c | 26 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()
|
D | fs.c | 91 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 …]
|
D | trace-dev.c | 196 char buf[ATRACE_MESSAGE_LENGTH]; in atrace_begin_body() local 199 len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "B|%d|%s", getpid(), name); in atrace_begin_body() 200 write(atrace_marker_fd, buf, len); in atrace_begin_body() 206 char buf[ATRACE_MESSAGE_LENGTH]; in atrace_async_begin_body() local 209 len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "S|%d|%s|%" PRId32, in atrace_async_begin_body() 211 write(atrace_marker_fd, buf, len); in atrace_async_begin_body() 216 char buf[ATRACE_MESSAGE_LENGTH]; in atrace_async_end_body() local 219 len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "F|%d|%s|%" PRId32, in atrace_async_end_body() 221 write(atrace_marker_fd, buf, len); in atrace_async_end_body() 226 char buf[ATRACE_MESSAGE_LENGTH]; in atrace_int_body() local [all …]
|
D | properties.c | 39 char buf[PROPERTY_VALUE_MAX] = {'\0',}; in property_get_bool() local 41 int len = property_get(key, buf, ""); in property_get_bool() 43 char ch = buf[0]; in property_get_bool() 50 if (!strcmp(buf, "no") || !strcmp(buf, "false") || !strcmp(buf, "off")) { in property_get_bool() 52 } else if (!strcmp(buf, "yes") || !strcmp(buf, "true") || !strcmp(buf, "on")) { in property_get_bool() 68 char buf[PROPERTY_VALUE_MAX] = {'\0',}; in property_get_imax() local 71 int len = property_get(key, buf, ""); in property_get_imax() 77 result = strtoimax(buf, &end, /*base*/0); in property_get_imax() 86 } else if (end == buf) { in property_get_imax()
|
/system/core/libion/tests/ |
D | device_test.cpp | 37 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/keymaster/include/keymaster/ |
D | serializable.h | 46 virtual uint8_t* Serialize(uint8_t* buf, const uint8_t* end) const = 0; 71 uint8_t* append_to_buf(uint8_t* buf, const uint8_t* end, const void* data, size_t data_len); 80 inline uint8_t* append_uint32_to_buf(uint8_t* buf, const uint8_t* end, T value) { in append_uint32_to_buf() argument 82 return append_to_buf(buf, end, &val, sizeof(val)); in append_uint32_to_buf() 88 inline uint8_t* append_uint64_to_buf(uint8_t* buf, const uint8_t* end, uint64_t value) { in append_uint64_to_buf() argument 89 return append_to_buf(buf, end, &value, sizeof(value)); in append_uint64_to_buf() 98 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 100 buf = append_uint32_to_buf(buf, end, data_len); in append_size_and_data_to_buf() 101 return append_to_buf(buf, end, data, data_len); in append_size_and_data_to_buf() 111 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/logd/tests/ |
D | logd_test.cpp | 34 static void my_android_logger_get_statistics(char *buf, size_t len) in my_android_logger_get_statistics() argument 36 snprintf(buf, len, "getStatistics 0 1 2 3 4"); in my_android_logger_get_statistics() 41 if (write(sock, buf, strlen(buf) + 1) > 0) { in my_android_logger_get_statistics() 43 while ((ret = read(sock, buf, len)) > 0) { in my_android_logger_get_statistics() 48 buf += ret; in my_android_logger_get_statistics() 69 char *buf; in alloc_statistics() local 71 for(int retry = 32; (retry >= 0); delete [] buf, --retry) { in alloc_statistics() 72 buf = new char [len]; in alloc_statistics() 73 my_android_logger_get_statistics(buf, len); in alloc_statistics() 75 buf[len-1] = '\0'; in alloc_statistics() [all …]
|
/system/core/toolbox/upstream-netbsd/bin/dd/ |
D | misc.c | 97 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/adb/ |
D | adb_io_test.cpp | 65 char buf[sizeof(expected)] = {}; in TEST() local 66 ASSERT_TRUE(ReadFdExactly(tf.fd, buf, sizeof(buf) - 1)) << strerror(errno); in TEST() 67 EXPECT_STREQ(expected, buf); in TEST() 79 char buf[sizeof(expected) + 1] = {}; in TEST() local 80 ASSERT_FALSE(ReadFdExactly(tf.fd, buf, sizeof(buf))); in TEST() 93 char buf[sizeof(input) - 1] = {}; in TEST() local 94 ASSERT_TRUE(ReadFdExactly(tf.fd, buf, sizeof(buf) - 1)); in TEST() 98 EXPECT_STREQ(expected.c_str(), buf); in TEST() 117 const char buf[] = "Foobar"; in TEST() local 122 ASSERT_TRUE(WriteFdExactly(tf.fd, buf, sizeof(buf) - 2)) << strerror(errno); in TEST() [all …]
|