Home
last modified time | relevance | path

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

12345678910>>...18

/system/vold/
DBenchmarkGen.h43 char* buf = (char*) malloc(1048576); in BenchmarkRun() local
47 TEMP_FAILURE_RETRY(read(t3433f17, buf, 65557)); in BenchmarkRun()
48 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 769726, 38187008)); // mmap2 in BenchmarkRun()
49 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 278721)); in BenchmarkRun()
50 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 19, 278751)); in BenchmarkRun()
51 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 25119, 278528)); // mmap2 in BenchmarkRun()
52 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 37276895)); in BenchmarkRun()
53 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 14, 37276925)); in BenchmarkRun()
54 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 914520, 37273600)); // mmap2 in BenchmarkRun()
56 TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2 in BenchmarkRun()
[all …]
/system/nvram/messages/tests/
Dio_test.cpp80 TestInputStreamBuffer<10> buf; in TEST() local
81 EXPECT_FALSE(buf.Done()); in TEST()
84 EXPECT_TRUE(buf.ReadByte(&byte)); in TEST()
86 EXPECT_FALSE(buf.Done()); in TEST()
88 CheckRead(&buf, 6, 1); in TEST()
89 EXPECT_FALSE(buf.Done()); in TEST()
91 EXPECT_TRUE(buf.Skip(3)); in TEST()
92 EXPECT_TRUE(buf.Done()); in TEST()
96 InputStreamBuffer buf(nullptr, nullptr); in TEST() local
97 EXPECT_TRUE(buf.Done()); in TEST()
[all …]
/system/core/libutils/
DSharedBuffer_test.cpp32 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 …]
DString8.cpp45 SharedBuffer* buf = SharedBuffer::alloc(1); in getEmptyString() local
46 char* str = static_cast<char*>(buf->data()); in getEmptyString()
48 return buf; in getEmptyString()
63 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8() local
64 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF8()
65 if (buf) { in allocFromUTF8()
66 char* str = (char*)buf->data(); in allocFromUTF8()
87 SharedBuffer* buf = SharedBuffer::alloc(resultStrLen); in allocFromUTF16() local
88 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF16()
89 if (!buf) { in allocFromUTF16()
[all …]
/system/keymaster/android_keymaster/
Dandroid_keymaster_messages.cpp36 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()
57 static uint8_t* serialize_blob(const keymaster_blob_t& blob, uint8_t* buf, const uint8_t* end) { in serialize_blob() argument
58 return append_size_and_data_to_buf(buf, end, blob.data, blob.data_length); in serialize_blob()
78 uint8_t* KeymasterResponse::Serialize(uint8_t* buf, const uint8_t* end) const { in Serialize() argument
79 buf = append_uint32_to_buf(buf, end, static_cast<uint32_t>(error)); in Serialize()
81 buf = NonErrorSerialize(buf, end); in Serialize()
82 return buf; in Serialize()
101 uint8_t* GenerateKeyResponse::NonErrorSerialize(uint8_t* buf, const uint8_t* end) const { in NonErrorSerialize() argument
102 buf = serialize_key_blob(key_blob, buf, end); in NonErrorSerialize()
[all …]
/system/chre/util/tests/
Dbuffer_test.cc37 float buf[128]; in TEST() local
38 fillBufferWithSequentialValues(buf, ARRAY_SIZE(buf)); in TEST()
41 buffer.wrap(buf, ARRAY_SIZE(buf)); in TEST()
42 EXPECT_EQ(buffer.data(), buf); in TEST()
43 EXPECT_EQ(buffer.size(), ARRAY_SIZE(buf)); in TEST()
47 float buf[128]; in TEST() local
48 fillBufferWithSequentialValues(buf, ARRAY_SIZE(buf)); in TEST()
51 EXPECT_TRUE(buffer.copy_array(buf, ARRAY_SIZE(buf))); in TEST()
52 EXPECT_EQ(buffer.size(), ARRAY_SIZE(buf)); in TEST()
54 for (size_t i = 0; i < ARRAY_SIZE(buf); i++) { in TEST()
[all …]
/system/core/lmkd/
Dliblmkd_utils.c46 char buf[256]; in create_memcg() local
50 snprintf(buf, sizeof(buf), "/dev/memcg/apps/uid_%u", uid); in create_memcg()
51 if (mkdir(buf, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0 && in create_memcg()
56 snprintf(buf, sizeof(buf), "/dev/memcg/apps/uid_%u/pid_%u", uid, pid); in create_memcg()
57 if (mkdir(buf, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0 && in create_memcg()
62 snprintf(buf, sizeof(buf), "/dev/memcg/apps/uid_%u/pid_%u/tasks", uid, pid); in create_memcg()
63 tasks_file = open(buf, O_WRONLY); in create_memcg()
67 written = snprintf(buf, sizeof(buf), "%u", pid); in create_memcg()
68 if (__predict_false(written >= (int)sizeof(buf))) { in create_memcg()
69 written = sizeof(buf) - 1; in create_memcg()
[all …]
/system/bt/osi/src/
Dbuffer.cc49 buffer_t* buffer_new_ref(const buffer_t* buf) { in buffer_new_ref() argument
50 CHECK(buf != NULL); in buffer_new_ref()
51 return buffer_new_slice(buf, buf->length); in buffer_new_ref()
54 buffer_t* buffer_new_slice(const buffer_t* buf, size_t slice_size) { in buffer_new_slice() argument
55 CHECK(buf != NULL); in buffer_new_slice()
57 CHECK(slice_size <= buf->length); in buffer_new_slice()
61 ret->root = buf->root; in buffer_new_slice()
65 ++buf->root->refcount; in buffer_new_slice()
83 void* buffer_ptr(const buffer_t* buf) { in buffer_ptr() argument
84 CHECK(buf != NULL); in buffer_ptr()
[all …]
/system/core/libcutils/
Dpartition_utils.cpp28 static int only_one_char(uint8_t *buf, int len, uint8_t c) in only_one_char() argument
34 if (buf[i] != c) { in only_one_char()
43 uint8_t buf[4096]; in partition_wiped() local
50 ret = read(fd, buf, sizeof(buf)); in partition_wiped()
53 if (ret != sizeof(buf)) { in partition_wiped()
58 if (only_one_char(buf, sizeof(buf), 0)) { in partition_wiped()
63 if (only_one_char(buf, sizeof(buf), 0xff)) { in partition_wiped()
Dproperties.cpp39 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/bt/bta/hf_client/
Dbta_hf_client_at.cc120 tBTA_HF_CLIENT_AT_CMD cmd, const char* buf, in bta_hf_client_queue_at() argument
130 memcpy(new_cmd->buf, buf, buf_len); in bta_hf_client_queue_at()
169 tBTA_HF_CLIENT_AT_CMD cmd, const char* buf, in bta_hf_client_send_at() argument
178 APPL_TRACE_DEBUG("%s: %.*s", __func__, buf_len - 1, buf); in bta_hf_client_send_at()
192 PORT_WriteData(client_cb->conn_handle, buf, buf_len, &len); in bta_hf_client_send_at()
199 bta_hf_client_queue_at(client_cb, cmd, buf, buf_len); in bta_hf_client_send_at()
210 bta_hf_client_send_at(client_cb, cur->cmd, cur->buf, cur->buf_len); in bta_hf_client_send_queued_at()
768 #define AT_CHECK_EVENT(buf, event) \ argument
770 if (strncmp("\r\n" event, buf, sizeof("\r\n" event) - 1) != 0) return buf; \
771 (buf) += sizeof("\r\n" event) - 1; \
[all …]
/system/core/libunwindstack/tests/
DMemoryOfflineTest.cpp49 char buf = '\0'; in TEST_F() local
50 ASSERT_EQ(0U, memory->Read(offset - 1, &buf, 1)); in TEST_F()
51 ASSERT_EQ(0U, memory->Read(offset + data.size(), &buf, 1)); in TEST_F()
52 ASSERT_EQ(1U, memory->Read(offset, &buf, 1)); in TEST_F()
53 ASSERT_EQ(buf, data.front()); in TEST_F()
54 ASSERT_EQ(1U, memory->Read(offset + data.size() - 1, &buf, 1)); in TEST_F()
55 ASSERT_EQ(buf, data.back()); in TEST_F()
59 std::vector<char> buf; in TEST_F() local
60 buf.resize(2 * data.size()); in TEST_F()
61 ASSERT_EQ(data.size(), memory->Read(offset, buf.data(), buf.size())); in TEST_F()
[all …]
/system/core/liblog/
Dpmsg_reader.cpp140 } buf; in pmsgRead() local
169 if (preread_count < sizeof(buf)) { in pmsgRead()
174 ret = TEMP_FAILURE_RETRY(read(fd, &buf.p.magic + preread_count, sizeof(buf) - preread_count)); in pmsgRead()
180 if (preread_count != sizeof(buf)) { in pmsgRead()
183 if ((buf.p.magic != LOGGER_MAGIC) || (buf.p.len <= sizeof(buf)) || in pmsgRead()
184 (buf.p.len > (sizeof(buf) + LOGGER_ENTRY_MAX_PAYLOAD)) || (buf.l.id >= LOG_ID_MAX) || in pmsgRead()
185 (buf.l.realtime.tv_nsec >= NS_PER_SEC) || in pmsgRead()
186 ((buf.l.id != LOG_ID_EVENTS) && (buf.l.id != LOG_ID_SECURITY) && in pmsgRead()
187 ((buf.prio == ANDROID_LOG_UNKNOWN) || (buf.prio == ANDROID_LOG_DEFAULT) || in pmsgRead()
188 (buf.prio >= ANDROID_LOG_SILENT)))) { in pmsgRead()
[all …]
Dlogd_reader.cpp64 struct android_log_transport_context* transp, char* buf, size_t len);
66 struct android_log_transport_context* transp, char* buf, size_t len);
68 struct android_log_transport_context* transp, char* buf, size_t len);
128 static ssize_t send_log_msg(struct android_log_logger* logger, const char* msg, char* buf, in send_log_msg() argument
140 snprintf(buf, buf_size, msg, logger ? logger->logId : (unsigned)-1); in send_log_msg()
143 len = strlen(buf) + 1; in send_log_msg()
144 ret = TEMP_FAILURE_RETRY(write(sock, buf, len)); in send_log_msg()
150 cp = buf; in send_log_msg()
193 ssize_t __send_log_msg(char* buf, size_t buf_size) { in __send_log_msg() argument
194 return send_log_msg(NULL, NULL, buf, buf_size); in __send_log_msg()
[all …]
/system/core/fastboot/fuzzy_fastboot/
Dusb_transport_sniffer.cpp25 std::vector<char> buf(err, err + strlen(err)); in Read() local
26 Event e(READ_ERROR, std::move(buf)); in Read()
32 std::vector<char> buf(cdata, cdata + ret); in Read() local
33 Event e(READ, std::move(buf)); in Read()
46 std::vector<char> buf(err, err + strlen(err)); in Write() local
47 Event e(WRITE_ERROR, std::move(buf)); in Write()
53 std::vector<char> buf(cdata, cdata + len); in Write() local
54 Event e(WRITE, std::move(buf)); in Write()
68 std::vector<char> buf; in Reset() local
69 Event e(RESET, std::move(buf)); in Reset()
[all …]
/system/core/base/
Dcmsg_test.cpp73 char buf[2]; in TEST_P() local
75 ASSERT_EQ(1, ReceiveFileDescriptors(recv.get(), buf, 2, &received)); in TEST_P()
76 ASSERT_EQ('x', buf[0]); in TEST_P()
85 char buf[2]; in TEST_P() local
88 ssize_t rc = ReceiveFileDescriptors(recv.get(), buf, 1, &received1, &received2); in TEST_P()
100 ASSERT_EQ(1, read(recv.get(), buf, 2)); in TEST_P()
107 char buf[2]; in TEST_P() local
109 ASSERT_EQ(-1, ReceiveFileDescriptors(recv.get(), buf, 1, &received)); in TEST_P()
117 char buf[2]; in TEST_P() local
118 ASSERT_EQ(1, ::recv(recv.get(), buf, sizeof(buf), MSG_PEEK)); in TEST_P()
[all …]
/system/core/logd/
DCommandListener.cpp40 CommandListener::CommandListener(LogBuffer* buf, LogReader* /*reader*/, in CommandListener() argument
44 registerCmd(new ClearCmd(buf)); in CommandListener()
45 registerCmd(new GetBufSizeCmd(buf)); in CommandListener()
46 registerCmd(new SetBufSizeCmd(buf)); in CommandListener()
47 registerCmd(new GetBufSizeUsedCmd(buf)); in CommandListener()
48 registerCmd(new GetStatisticsCmd(buf)); in CommandListener()
49 registerCmd(new SetPruneListCmd(buf)); in CommandListener()
50 registerCmd(new GetPruneListCmd(buf)); in CommandListener()
51 registerCmd(new GetEventTagCmd(buf)); in CommandListener()
67 CommandListener::ClearCmd::ClearCmd(LogBuffer* buf) in ClearCmd() argument
[all …]
/system/core/libion/tests/
Ddevice_test.cpp38 void readDMA(int fd, void *buf, size_t size);
39 void writeDMA(int fd, void *buf, size_t size);
40 void readKernel(int fd, void *buf, size_t size);
41 void writeKernel(int fd, void *buf, size_t size);
59 void Device::readDMA(int fd, void *buf, size_t size) in readDMA() argument
63 .ptr = (uint64_t)buf, in readDMA()
73 void Device::writeDMA(int fd, void *buf, size_t size) in writeDMA() argument
77 .ptr = (uint64_t)buf, in writeDMA()
87 void Device::readKernel(int fd, void *buf, size_t size) in readKernel() argument
91 .ptr = (uint64_t)buf, in readKernel()
[all …]
/system/libufdt/tests/src/
Dextract_dtb.c26 int find_dtb_header_pos(const char *buf, size_t buf_size) { in find_dtb_header_pos() argument
27 if (buf == NULL || buf_size == 0) { in find_dtb_header_pos()
37 uint32_t tag = fdt32_to_cpu(*(fdt32_t *)(buf + pos)); in find_dtb_header_pos()
48 const char *buf, size_t buf_size) { in find_and_write_dtb() argument
49 int tag_pos = find_dtb_header_pos(buf, buf_size); in find_and_write_dtb()
55 const char *fdt_ptr = buf + tag_pos; in find_and_write_dtb()
98 char *buf = NULL; in extract_dtbs() local
101 buf = load_file(in_filename, &buf_size); in extract_dtbs()
102 if (!buf) { in extract_dtbs()
113 tag_pos = find_and_write_dtb(filename, buf, buf_size); in extract_dtbs()
[all …]
Dutil.c31 char *buf = malloc(len); in load_file_contents() local
32 if (buf == NULL) { in load_file_contents()
36 if (fread(buf, len, 1, fp) != 1) { in load_file_contents()
37 free(buf); in load_file_contents()
45 return buf; in load_file_contents()
54 char *buf = load_file_contents(fp, len_ptr); in load_file() local
58 return buf; in load_file()
62 const void *buf, size_t buf_size) { in write_buf_to_file() argument
71 if (fwrite(buf, 1, buf_size, fout) < 1) { in write_buf_to_file()
/system/core/adb/client/
Dadb_install.cpp121 static void read_status_line(int fd, char* buf, size_t count) { in read_status_line() argument
124 int len = adb_read(fd, buf, count); in read_status_line()
129 buf += len; in read_status_line()
132 *buf = '\0'; in read_status_line()
225 char buf[BUFSIZ]; in install_app_streamed() local
227 read_status_line(remote_fd.get(), buf, sizeof(buf)); in install_app_streamed()
229 if (!strncmp("Success", buf, 7)) { in install_app_streamed()
230 fputs(buf, stdout); in install_app_streamed()
233 fprintf(stderr, "adb: failed to install %s: %s", file, buf); in install_app_streamed()
436 char buf[BUFSIZ]; in install_multiple_app() local
[all …]
/system/keymaster/include/keymaster/
Dserializable.h47 virtual uint8_t* Serialize(uint8_t* buf, const uint8_t* end) const = 0;
83 uint8_t* append_to_buf(uint8_t* buf, const uint8_t* end, const void* data, size_t data_len);
92 inline uint8_t* append_uint32_to_buf(uint8_t* buf, const uint8_t* end, T value) { in append_uint32_to_buf() argument
94 return append_to_buf(buf, end, &val, sizeof(val)); in append_uint32_to_buf()
100 inline uint8_t* append_uint64_to_buf(uint8_t* buf, const uint8_t* end, uint64_t value) { in append_uint64_to_buf() argument
101 return append_to_buf(buf, end, &value, sizeof(value)); in append_uint64_to_buf()
110 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
112 buf = append_uint32_to_buf(buf, end, data_len); in append_size_and_data_to_buf()
113 return append_to_buf(buf, end, data, data_len); in append_size_and_data_to_buf()
123 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/extras/ioshark/
Dcompile_ioshark.c108 get_delta_ts(char *buf, struct timeval *prev) in get_delta_ts() argument
112 sscanf(buf, "%lu.%lu", &op_tv.tv_sec, &op_tv.tv_usec); in get_delta_ts()
123 get_tracetype(char *buf, char *trace_type) in get_tracetype() argument
128 s = strchr(buf, ' '); in get_tracetype()
168 progname, __func__, buf); in get_tracetype()
176 get_pathname(char *buf, char *pathname, enum file_op file_op) in get_pathname() argument
181 s = strchr(buf, '/'); in get_pathname()
184 __func__, buf); in get_pathname()
190 __func__, buf); in get_pathname()
195 s = strchr(buf, '"'); in get_pathname()
[all …]
/system/core/adb/
Dadb_io_test.cpp54 char buf[sizeof(expected)] = {}; in POSIX_TEST() local
55 ASSERT_TRUE(ReadFdExactly(tf.fd, buf, sizeof(buf) - 1)) << strerror(errno); in POSIX_TEST()
56 EXPECT_STREQ(expected, buf); in POSIX_TEST()
68 char buf[sizeof(expected) + 1] = {}; in POSIX_TEST() local
69 ASSERT_FALSE(ReadFdExactly(tf.fd, buf, sizeof(buf))); in POSIX_TEST()
82 char buf[sizeof(input) - 1] = {}; in POSIX_TEST() local
83 ASSERT_TRUE(ReadFdExactly(tf.fd, buf, sizeof(buf) - 1)); in POSIX_TEST()
87 EXPECT_STREQ(expected.c_str(), buf); in POSIX_TEST()
106 const char buf[] = "Foobar"; in POSIX_TEST() local
111 ASSERT_TRUE(WriteFdExactly(tf.fd, buf, sizeof(buf) - 2)) << strerror(errno); in POSIX_TEST()
[all …]
Dadb_io.cpp51 char buf[5]; in ReadProtocolString() local
52 if (!ReadFdExactly(fd, buf, 4)) { in ReadProtocolString()
56 buf[4] = 0; in ReadProtocolString()
58 unsigned long len = strtoul(buf, nullptr, 16); in ReadProtocolString()
76 bool ReadFdExactly(int fd, void* buf, size_t len) { in ReadFdExactly() argument
77 char* p = reinterpret_cast<char*>(buf); in ReadFdExactly()
98 << " " << dump_hex(reinterpret_cast<const unsigned char*>(buf), len0); in ReadFdExactly()
103 bool WriteFdExactly(int fd, const void* buf, size_t len) { in WriteFdExactly() argument
104 const char* p = reinterpret_cast<const char*>(buf); in WriteFdExactly()
108 << " " << dump_hex(reinterpret_cast<const unsigned char*>(buf), len); in WriteFdExactly()
[all …]

12345678910>>...18