Home
last modified time | relevance | path

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

12345678910>>...20

/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 …]
DString16.cpp36 SharedBuffer* buf = SharedBuffer::alloc(size); in alloc() local
37 buf->mClientMetadata = kIsSharedBufferAllocated; in alloc()
38 return buf; in alloc()
52 SharedBuffer* buf = static_cast<SharedBuffer*>(alloc(sizeof(char16_t) * (u16len + 1))); in allocFromUTF8() local
53 if (buf) { in allocFromUTF8()
55 char16_t* u16str = (char16_t*)buf->data(); in allocFromUTF8()
75 SharedBuffer* buf = static_cast<SharedBuffer*>(alloc((u16len + 1) * sizeof(char16_t))); in allocFromUTF16() local
76 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF16()
77 if (buf) { in allocFromUTF16()
78 char16_t* str = (char16_t*)buf->data(); in allocFromUTF16()
[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/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/bt/osi/test/fuzzers/ringbuffer/
Dfuzz_ringbuffer.cc39 ringbuffer_t* buf = nullptr; in callArbitraryFunction() local
48 buf = ringbuffer_init(size); in callArbitraryFunction()
49 if (buf) { in callArbitraryFunction()
50 ringbuf_vector->push_back(buf); in callArbitraryFunction()
60 buf = ringbuf_vector->at(index); in callArbitraryFunction()
61 if (buf) { in callArbitraryFunction()
62 ringbuffer_free(buf); in callArbitraryFunction()
68 buf = getArbitraryRingBuf(ringbuf_vector, dataProvider); in callArbitraryFunction()
69 if (buf) { in callArbitraryFunction()
70 ringbuffer_available(buf); in callArbitraryFunction()
[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/liblog/
Dpmsg_reader.cpp38 } buf; in PmsgRead() local
66 if (preread_count < sizeof(buf)) { in PmsgRead()
71 ret = TEMP_FAILURE_RETRY(read(fd, &buf.p.magic + preread_count, sizeof(buf) - preread_count)); in PmsgRead()
77 if (preread_count != sizeof(buf)) { in PmsgRead()
80 if ((buf.p.magic != LOGGER_MAGIC) || (buf.p.len <= sizeof(buf)) || in PmsgRead()
81 (buf.p.len > (sizeof(buf) + LOGGER_ENTRY_MAX_PAYLOAD)) || (buf.l.id >= LOG_ID_MAX) || in PmsgRead()
82 (buf.l.realtime.tv_nsec >= NS_PER_SEC) || in PmsgRead()
83 ((buf.l.id != LOG_ID_EVENTS) && (buf.l.id != LOG_ID_SECURITY) && in PmsgRead()
84 ((buf.prio == ANDROID_LOG_UNKNOWN) || (buf.prio == ANDROID_LOG_DEFAULT) || in PmsgRead()
85 (buf.prio >= ANDROID_LOG_SILENT)))) { in PmsgRead()
[all …]
Dlogd_reader.cpp67 ssize_t SendLogdControlMessage(char* buf, size_t buf_size) { in SendLogdControlMessage() argument
77 len = strlen(buf) + 1; in SendLogdControlMessage()
78 ret = TEMP_FAILURE_RETRY(write(sock, buf, len)); in SendLogdControlMessage()
84 cp = buf; in SendLogdControlMessage()
127 static int check_log_success(char* buf, ssize_t ret) { in check_log_success() argument
132 if (strncmp(buf, "success", 7)) { in check_log_success()
145 char buf[512]; in android_logger_clear() local
146 snprintf(buf, sizeof(buf), "clear %" PRIu32, log_id); in android_logger_clear()
148 return check_log_success(buf, SendLogdControlMessage(buf, sizeof(buf))); in android_logger_clear()
158 char buf[512]; in android_logger_get_log_size() local
[all …]
/system/memory/libmeminfo/libdmabufinfo/tools/
Ddmabuf_dump.cpp67 for (auto& buf : bufs) { in PrintDmaBufTable() local
68 pid_set.insert(buf.pids().begin(), buf.pids().end()); in PrintDmaBufTable()
83 for (auto& buf : bufs) { in PrintDmaBufTable() local
85 static_cast<uintmax_t>(buf.inode()), buf.size() / 1024, buf.fdrefs().size(), in PrintDmaBufTable()
86 buf.maprefs().size()); in PrintDmaBufTable()
91 if (buf.fdrefs().count(pid) == 1) { in PrintDmaBufTable()
94 pid_refs += buf.fdrefs().at(pid); in PrintDmaBufTable()
95 if (buf.maprefs().count(pid) == 1) { in PrintDmaBufTable()
96 pid_refs += buf.maprefs().at(pid); in PrintDmaBufTable()
107 per_pid_size[pid] += buf.size() / 1024; in PrintDmaBufTable()
[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()
Dashmem-host.cpp37 static bool ashmem_validate_stat(int fd, struct stat* buf) { in ashmem_validate_stat() argument
38 int result = fstat(fd, buf); in ashmem_validate_stat()
48 if (!(buf->st_nlink == 0 && S_ISREG(buf->st_mode))) { in ashmem_validate_stat()
56 struct stat buf; in ashmem_valid() local
57 return ashmem_validate_stat(fd, &buf); in ashmem_valid()
90 struct stat buf; in ashmem_get_size_region() local
91 if (!ashmem_validate_stat(fd, &buf)) { in ashmem_get_size_region()
95 return buf.st_size; in ashmem_get_size_region()
/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()
168 tBTA_HF_CLIENT_AT_CMD cmd, const char* buf, in bta_hf_client_send_at() argument
177 APPL_TRACE_DEBUG("%s: %.*s", __func__, buf_len - 1, buf); in bta_hf_client_send_at()
191 PORT_WriteData(client_cb->conn_handle, buf, buf_len, &len); in bta_hf_client_send_at()
198 bta_hf_client_queue_at(client_cb, cmd, buf, buf_len); in bta_hf_client_send_at()
209 bta_hf_client_send_at(client_cb, cur->cmd, cur->buf, cur->buf_len); in bta_hf_client_send_queued_at()
777 #define AT_CHECK_EVENT(buf, event) \ argument
779 if (strncmp("\r\n" event, buf, sizeof("\r\n" event) - 1) != 0) return buf; \
780 (buf) += sizeof("\r\n" event) - 1; \
[all …]
/system/memory/lmkd/
Dliblmkd_utils.cpp81 char buf[256]; in create_memcg() local
85 snprintf(buf, sizeof(buf), "/dev/memcg/apps/uid_%u", uid); in create_memcg()
86 if (mkdir(buf, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0 && in create_memcg()
91 snprintf(buf, sizeof(buf), "/dev/memcg/apps/uid_%u/pid_%u", uid, pid); in create_memcg()
92 if (mkdir(buf, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0 && in create_memcg()
97 snprintf(buf, sizeof(buf), "/dev/memcg/apps/uid_%u/pid_%u/tasks", uid, pid); in create_memcg()
98 tasks_file = open(buf, O_WRONLY); in create_memcg()
102 written = snprintf(buf, sizeof(buf), "%u", pid); in create_memcg()
103 if (__predict_false(written >= (int)sizeof(buf))) { in create_memcg()
104 written = sizeof(buf) - 1; in create_memcg()
[all …]
/system/core/libunwindstack/tests/
DMemoryOfflineTest.cpp50 char buf = '\0'; in TEST_F() local
51 ASSERT_EQ(0U, memory->Read(offset - 1, &buf, 1)); in TEST_F()
52 ASSERT_EQ(0U, memory->Read(offset + data.size(), &buf, 1)); in TEST_F()
53 ASSERT_EQ(1U, memory->Read(offset, &buf, 1)); in TEST_F()
54 ASSERT_EQ(buf, data.front()); in TEST_F()
55 ASSERT_EQ(1U, memory->Read(offset + data.size() - 1, &buf, 1)); in TEST_F()
56 ASSERT_EQ(buf, data.back()); in TEST_F()
60 std::vector<char> buf; in TEST_F() local
61 buf.resize(2 * data.size()); in TEST_F()
62 ASSERT_EQ(data.size(), memory->Read(offset, buf.data(), buf.size())); in TEST_F()
[all …]
/system/core/fastboot/fuzzy_fastboot/
Dtransport_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/libbase/
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/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/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 …]
/system/core/libstats/socket/
Dstats_event.c41 uint8_t* buf; member
60 event->buf = (uint8_t*)calloc(MAX_EVENT_PAYLOAD, 1); in stats_event_obtain()
61 event->buf[0] = OBJECT_TYPE; in stats_event_obtain()
69 event->buf[POS_TIMESTAMP] = INT64_TYPE; in stats_event_obtain()
70 memcpy(&event->buf[POS_TIMESTAMP + sizeof(uint8_t)], &timestampNs, sizeof(timestampNs)); in stats_event_obtain()
80 free(event->buf); in stats_event_release()
86 event->buf[POS_ATOM_ID] = INT32_TYPE; in stats_event_set_atom_id()
87 memcpy(&event->buf[POS_ATOM_ID + sizeof(uint8_t)], &atomId, sizeof(atomId)); in stats_event_set_atom_id()
104 event->buf[event->size] = value; in append_byte()
115 memcpy(&event->buf[event->size], &value, sizeof(value)); in append_int32()
[all …]

12345678910>>...20