/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 …]
|
/system/core/libutils/ |
D | SharedBufferTest.cpp | 32 android::SharedBuffer* buf = in TEST() local 34 ASSERT_EQ(nullptr, buf); in TEST() 36 buf = android::SharedBuffer::alloc(0); in TEST() 37 ASSERT_NE(nullptr, 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 | 67 SharedBuffer* buf = SharedBuffer::alloc(1); in initialize_string8() local 68 char* str = (char*)buf->data(); in initialize_string8() 70 gEmptyStringBuf = buf; in initialize_string8() 89 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8() local 90 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF8() 91 if (buf) { in allocFromUTF8() 92 char* str = (char*)buf->data(); in allocFromUTF8() 112 SharedBuffer* buf = SharedBuffer::alloc(bytes+1); in allocFromUTF16() local 113 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF16() 114 if (!buf) { in allocFromUTF16() [all …]
|
D | String16.cpp | 43 SharedBuffer* buf = SharedBuffer::alloc(sizeof(char16_t)); in initialize_string16() local 44 char16_t* str = (char16_t*)buf->data(); in initialize_string16() 46 gEmptyStringBuf = buf; in initialize_string16() 70 SharedBuffer* buf = SharedBuffer::alloc(sizeof(char16_t)*(u16len+1)); in allocFromUTF8() local 71 if (buf) { in allocFromUTF8() 73 char16_t* u16str = (char16_t*)buf->data(); in allocFromUTF8() 122 SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); in String16() local 123 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in String16() 124 if (buf) { in String16() 125 char16_t* str = (char16_t*)buf->data(); in String16() [all …]
|
/system/tpm/trunks/ftdi/ |
D | support.c | 32 int raw_write(struct mpsse_context* mpsse, uint8_t* buf, int size) { 36 if (ftdi_write_data(&mpsse->ftdi, buf, size) == size) { 45 int raw_read(struct mpsse_context* mpsse, uint8_t* buf, int size) { in raw_read() argument 50 r = ftdi_read_data(&mpsse->ftdi, buf, size); in raw_read() 97 uint8_t* buf = NULL; in build_block_buffer() local 124 buf = malloc(total_size); in build_block_buffer() 125 if (buf) { in build_block_buffer() 126 memset(buf, 0, total_size); in build_block_buffer() 140 buf[i++] = SET_BITS_LOW; in build_block_buffer() 141 buf[i++] = mpsse->pstart & ~SK; in build_block_buffer() [all …]
|
/system/bt/bta/hf_client/ |
D | bta_hf_client_at.c | 120 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 130 memcpy(new_cmd->buf, buf, buf_len); in bta_hf_client_queue_at() 169 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 178 APPL_TRACE_DEBUG("%s %.*s", __FUNCTION__, buf_len - 1, buf); in bta_hf_client_send_at() 191 PORT_WriteData(bta_hf_client_cb.scb.conn_handle, buf, buf_len, &len); in bta_hf_client_send_at() 198 bta_hf_client_queue_at(cmd, buf, buf_len); in bta_hf_client_send_at() 211 bta_hf_client_send_at(cur->cmd, cur->buf, cur->buf_len); in bta_hf_client_send_queued_at() 585 #define AT_CHECK_EVENT(buf, event) \ argument 586 if (strncmp("\r\n"event, buf,sizeof("\r\n"event) - 1) != 0) return buf; \ 587 buf += sizeof("\r\n"event) - 1; \ [all …]
|
/system/bt/osi/src/ |
D | buffer.c | 48 buffer_t *buffer_new_ref(const buffer_t *buf) { in buffer_new_ref() argument 49 assert(buf != NULL); in buffer_new_ref() 50 return buffer_new_slice(buf, buf->length); in buffer_new_ref() 53 buffer_t *buffer_new_slice(const buffer_t *buf, size_t slice_size) { in buffer_new_slice() argument 54 assert(buf != NULL); in buffer_new_slice() 56 assert(slice_size <= buf->length); in buffer_new_slice() 60 ret->root = buf->root; in buffer_new_slice() 64 ++buf->root->refcount; in buffer_new_slice() 84 void *buffer_ptr(const buffer_t *buf) { in buffer_ptr() argument 85 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 ssize_t written = write(config.fd, buf, len); in dev_write_fd() 114 free(bi->buf); in flush_sparse_buffs() 119 static int dev_write_sparse(void *buf, __u64 byte_offset, size_t byte_len) in dev_write_sparse() argument 126 bi->buf = malloc(byte_len); in dev_write_sparse() 127 if (bi->buf == NULL) { in dev_write_sparse() 133 memcpy(bi->buf, buf, byte_len); in dev_write_sparse() 137 sparse_file_add_data(f2fs_sparse_file, bi->buf, byte_len, byte_offset/F2FS_BLKSIZE); in dev_write_sparse() 153 int dev_read_version(void *buf, __u64 offset, size_t len) in dev_read_version() argument [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 | trace-dev.c | 71 char buf[PROPERTY_KEY_MAX]; in atrace_is_cmdline_match() local 75 snprintf(buf, sizeof(buf), "debug.atrace.app_%d", i); in atrace_is_cmdline_match() 76 property_get(buf, value, ""); in atrace_is_cmdline_match() 189 char buf[ATRACE_MESSAGE_LENGTH]; in atrace_begin_body() local 191 int len = snprintf(buf, sizeof(buf), "B|%d|%s", getpid(), name); in atrace_begin_body() 192 if (len >= (int) sizeof(buf)) { in atrace_begin_body() 194 len = sizeof(buf) - 1; in atrace_begin_body() 196 write(atrace_marker_fd, buf, len); in atrace_begin_body() 200 char buf[ATRACE_MESSAGE_LENGTH]; \ 201 int len = snprintf(buf, sizeof(buf), format_begin "%s" format_end, pid, \ [all …]
|
/system/core/logd/ |
D | CommandListener.cpp | 39 CommandListener::CommandListener(LogBuffer *buf, LogReader * /*reader*/, in CommandListener() argument 43 registerCmd(new ClearCmd(buf)); in CommandListener() 44 registerCmd(new GetBufSizeCmd(buf)); in CommandListener() 45 registerCmd(new SetBufSizeCmd(buf)); in CommandListener() 46 registerCmd(new GetBufSizeUsedCmd(buf)); in CommandListener() 47 registerCmd(new GetStatisticsCmd(buf)); in CommandListener() 48 registerCmd(new SetPruneListCmd(buf)); in CommandListener() 49 registerCmd(new GetPruneListCmd(buf)); in CommandListener() 68 CommandListener::ClearCmd::ClearCmd(LogBuffer *buf) : in ClearCmd() argument 70 mBuf(*buf) { in ClearCmd() [all …]
|
/system/core/liblog/ |
D | pmsg_reader.c | 147 } buf; in pmsgRead() local 171 if (preread_count < sizeof(buf)) { in pmsgRead() 173 &buf.p.magic + preread_count, in pmsgRead() 174 sizeof(buf) - preread_count)); in pmsgRead() 180 if (preread_count != sizeof(buf)) { in pmsgRead() 183 if ((buf.p.magic != LOGGER_MAGIC) in pmsgRead() 184 || (buf.p.len <= sizeof(buf)) in pmsgRead() 185 || (buf.p.len > (sizeof(buf) + LOGGER_ENTRY_MAX_PAYLOAD)) in pmsgRead() 186 || (buf.l.id >= LOG_ID_MAX) in pmsgRead() 187 || (buf.l.realtime.tv_nsec >= NS_PER_SEC)) { in pmsgRead() [all …]
|
D | logd_reader.c | 69 char *buf, size_t len); 72 char *buf, size_t len); 75 char *buf, size_t len); 264 const char *msg, char *buf, size_t buf_size) in send_log_msg() argument 277 snprintf(buf, buf_size, msg, logger ? logger->logId : (unsigned) -1); in send_log_msg() 280 len = strlen(buf) + 1; in send_log_msg() 281 ret = TEMP_FAILURE_RETRY(write(sock, buf, len)); in send_log_msg() 287 cp = buf; in send_log_msg() 330 static int check_log_success(char *buf, ssize_t ret) in check_log_success() argument 336 if (strncmp(buf, "success", 7)) { in check_log_success() [all …]
|
/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; 79 uint8_t* append_to_buf(uint8_t* buf, const uint8_t* end, const void* data, size_t data_len); 88 inline uint8_t* append_uint32_to_buf(uint8_t* buf, const uint8_t* end, T value) { in append_uint32_to_buf() argument 90 return append_to_buf(buf, end, &val, sizeof(val)); in append_uint32_to_buf() 96 inline uint8_t* append_uint64_to_buf(uint8_t* buf, const uint8_t* end, uint64_t value) { in append_uint64_to_buf() argument 97 return append_to_buf(buf, end, &value, sizeof(value)); in append_uint64_to_buf() 106 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 108 buf = append_uint32_to_buf(buf, end, data_len); in append_size_and_data_to_buf() 109 return append_to_buf(buf, end, data, data_len); in append_size_and_data_to_buf() 119 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/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 | 49 char buf[sizeof(expected)] = {}; in TEST() local 50 ASSERT_TRUE(ReadFdExactly(tf.fd, buf, sizeof(buf) - 1)) << strerror(errno); in TEST() 51 EXPECT_STREQ(expected, buf); in TEST() 63 char buf[sizeof(expected) + 1] = {}; in TEST() local 64 ASSERT_FALSE(ReadFdExactly(tf.fd, buf, sizeof(buf))); in TEST() 77 char buf[sizeof(input) - 1] = {}; in TEST() local 78 ASSERT_TRUE(ReadFdExactly(tf.fd, buf, sizeof(buf) - 1)); in TEST() 82 EXPECT_STREQ(expected.c_str(), buf); in TEST() 101 const char buf[] = "Foobar"; in TEST() local 106 ASSERT_TRUE(WriteFdExactly(tf.fd, buf, sizeof(buf) - 2)) << strerror(errno); in TEST() [all …]
|
D | adb_io.cpp | 43 char buf[5]; in ReadProtocolString() local 44 if (!ReadFdExactly(fd, buf, 4)) { in ReadProtocolString() 48 buf[4] = 0; in ReadProtocolString() 50 unsigned long len = strtoul(buf, 0, 16); in ReadProtocolString() 68 bool ReadFdExactly(int fd, void* buf, size_t len) { in ReadFdExactly() argument 69 char* p = reinterpret_cast<char*>(buf); in ReadFdExactly() 90 << " " << dump_hex(reinterpret_cast<const unsigned char*>(buf), len0); in ReadFdExactly() 95 bool WriteFdExactly(int fd, const void* buf, size_t len) { in WriteFdExactly() argument 96 const char* p = reinterpret_cast<const char*>(buf); in WriteFdExactly() 100 << " " << dump_hex(reinterpret_cast<const unsigned char*>(buf), len); in WriteFdExactly() [all …]
|
/system/connectivity/shill/net/ |
D | netlink_message.cc | 96 void NetlinkMessage::PrintBytes(int log_level, const unsigned char* buf, in PrintBytes() argument 99 if (!buf) { in PrintBytes() 105 PrintHeader(log_level, reinterpret_cast<const nlmsghdr*>(buf)); in PrintBytes() 106 buf += sizeof(nlmsghdr); in PrintBytes() 114 PrintPayload(log_level, buf, num_bytes); in PrintBytes() 132 const unsigned char* buf = reinterpret_cast<const unsigned char*>(header); in PrintHeader() local 135 buf[0], buf[1], buf[2], buf[3], header->nlmsg_len); in PrintHeader() 139 buf[4], buf[5], buf[6], buf[7], header->nlmsg_type, in PrintHeader() 148 buf[8], buf[9], buf[10], buf[11], header->nlmsg_seq); in PrintHeader() 151 buf[12], buf[13], buf[14], buf[15], header->nlmsg_pid); in PrintHeader() [all …]
|
/system/core/init/ |
D | log.cpp | 35 char buf[1024]; in init_klog_vwrite() local 36 size_t prefix_size = snprintf(buf, sizeof(buf), "<%d>%s: ", level, tag); in init_klog_vwrite() 37 size_t msg_size = vsnprintf(buf + prefix_size, sizeof(buf) - prefix_size, fmt, ap); in init_klog_vwrite() 38 if (msg_size >= sizeof(buf) - prefix_size) { in init_klog_vwrite() 39 msg_size = snprintf(buf + prefix_size, sizeof(buf) - prefix_size, in init_klog_vwrite() 44 iov[0].iov_base = buf; in init_klog_vwrite()
|