Home
last modified time | relevance | path

Searched refs:rc (Results 1 – 25 of 359) sorted by relevance

12345678910>>...15

/system/core/trusty/storage/tests/
Dmain.cpp85 int rc = storage_open_session(TRUSTY_DEVICE_NAME, &session_, port_); in SetUp() local
86 ASSERT_EQ(0, rc); in SetUp()
128 int rc; in WriteZeroChunk() local
136 rc = storage_write(handle, off, data_buf, sizeof(data_buf), in WriteZeroChunk()
138 ASSERT_EQ((int)chunk_len, rc); in WriteZeroChunk()
144 int rc; in WritePatternChunk() local
152 rc = storage_write(handle, off, data_buf, sizeof(data_buf), in WritePatternChunk()
154 ASSERT_EQ((int)chunk_len, rc); in WritePatternChunk()
178 int rc; in ReadChunk() local
186 rc = storage_read(handle, off, data_buf, chunk_len); in ReadChunk()
[all …]
/system/core/trusty/utils/spiproxyd/
Dmain.c29 int rc; in handle_msg() local
34 rc = read(trusty_dev_fd, &msg_buf, sizeof(msg_buf)); in handle_msg()
35 if (rc < 0) { in handle_msg()
36 ALOGE("failed (%d) to read request from TA\n", rc); in handle_msg()
37 return rc; in handle_msg()
39 msg_len = rc; in handle_msg()
42 rc = write(spi_dev_fd, &msg_buf, msg_len); in handle_msg()
43 if (rc < 0 || (size_t)rc != msg_len) { in handle_msg()
44 ALOGE("failed (%d) to forward request to host\n", rc); in handle_msg()
45 return rc < 0 ? rc : -1; in handle_msg()
[all …]
/system/security/keystore/tests/
Dauth_token_table_test.cpp99 AuthTokenTable::Error rc; in TEST() local
104 (std::tie(rc, found) = table.FindAuthorization(make_set(1), KeyPurpose::SIGN, 0), rc)); in TEST()
110 (std::tie(rc, found) = table.FindAuthorization(make_set(2), KeyPurpose::SIGN, 0), rc)); in TEST()
116 (std::tie(rc, found) = table.FindAuthorization(make_set(3), KeyPurpose::SIGN, 0), rc)); in TEST()
122 (std::tie(rc, found) = table.FindAuthorization(make_set(4), KeyPurpose::SIGN, 0), rc)); in TEST()
128 (std::tie(rc, found) = table.FindAuthorization(make_set(5), KeyPurpose::SIGN, 0), rc)); in TEST()
138 AuthTokenTable::Error rc; in TEST() local
145 (std::tie(rc, found) = table.FindAuthorization(make_set(1), KeyPurpose::SIGN, 0), rc)); in TEST()
148 (std::tie(rc, found) = table.FindAuthorization(make_set(2), KeyPurpose::SIGN, 0), rc)); in TEST()
151 (std::tie(rc, found) = table.FindAuthorization(make_set(3), KeyPurpose::SIGN, 0), rc)); in TEST()
[all …]
/system/core/trusty/storage/lib/
Dstorage.c108 ssize_t rc; in send_reqv() local
110 rc = writev(session, tx_iovs, tx_iovcnt); in send_reqv()
111 if (rc < 0) { in send_reqv()
112 rc = -errno; in send_reqv()
114 return rc; in send_reqv()
117 rc = readv(session, rx_iovs, rx_iovcnt); in send_reqv()
118 if (rc < 0) { in send_reqv()
119 rc = -errno; in send_reqv()
121 return rc; in send_reqv()
124 return rc; in send_reqv()
[all …]
/system/core/trusty/storage/proxy/
Dproxy.c113 int rc; in handle_req() local
126 rc = storage_sync_checkpoint(); in handle_req()
127 if (rc < 0) { in handle_req()
135 rc = storage_file_delete(msg, req, req_len); in handle_req()
139 rc = storage_file_open(msg, req, req_len); in handle_req()
143 rc = storage_file_close(msg, req, req_len); in handle_req()
147 rc = storage_file_write(msg, req, req_len); in handle_req()
151 rc = storage_file_read(msg, req, req_len); in handle_req()
155 rc = storage_file_get_size(msg, req, req_len); in handle_req()
159 rc = storage_file_set_size(msg, req, req_len); in handle_req()
[all …]
Dstorage.c128 ssize_t rc; in write_with_retry() local
132 rc = TEMP_FAILURE_RETRY(pwrite(fd, buf, size, offset)); in write_with_retry()
133 if (rc < 0) in write_with_retry()
134 return rc; in write_with_retry()
135 size -= rc; in write_with_retry()
136 buf += rc; in write_with_retry()
137 offset += rc; in write_with_retry()
144 ssize_t rc; in read_with_retry() local
149 rc = TEMP_FAILURE_RETRY(pread(fd, buf, size, offset)); in read_with_retry()
150 if (rc < 0) in read_with_retry()
[all …]
Dipc.c37 int rc; in ipc_connect() local
43 rc = tipc_connect(device, port); in ipc_connect()
44 if (rc >= 0) in ipc_connect()
47 ALOGE("failed (%d) to connect to storage server\n", rc); in ipc_connect()
55 tipc_fd = rc; in ipc_connect()
69 ssize_t rc; in ipc_get_msg() local
74 rc = readv(tipc_fd, iovs, 2); in ipc_get_msg()
75 if (rc < 0) { in ipc_get_msg()
77 return rc; in ipc_get_msg()
81 if ((size_t)rc < sizeof(*msg)) { in ipc_get_msg()
[all …]
Drpmb.c144 int rc; in send_mmc_rpmb_req() local
192 rc = ioctl(mmc_fd, MMC_IOC_MULTI_CMD, &mmc.multi); in send_mmc_rpmb_req()
193 if (rc < 0) { in send_mmc_rpmb_req()
194 ALOGE("%s: mmc ioctl failed: %d, %s\n", __func__, rc, strerror(errno)); in send_mmc_rpmb_req()
196 return rc; in send_mmc_rpmb_req()
200 int rc; in send_ufs_rpmb_req() local
223 rc = ioctl(sg_fd, SG_IO, &io_hdr); in send_ufs_rpmb_req()
224 if (rc < 0) { in send_ufs_rpmb_req()
225 ALOGE("%s: ufs ioctl failed: %d, %s\n", __func__, rc, strerror(errno)); in send_ufs_rpmb_req()
237 rc = ioctl(sg_fd, SG_IO, &io_hdr); in send_ufs_rpmb_req()
[all …]
/system/security/keystore/
DKeyAttestationPackageInfo.cpp34 auto rc = parcel->writeString16(packageName_); in writeToParcel() local
35 if (rc != NO_ERROR) return rc; in writeToParcel()
36 rc = parcel->writeInt64(versionCode_); in writeToParcel()
37 if (rc != NO_ERROR) return rc; in writeToParcel()
42 auto rc = parcel->readString16(&packageName_); in readFromParcel() local
43 if (rc != NO_ERROR) return rc; in readFromParcel()
44 rc = parcel->readInt64(&versionCode_); in readFromParcel()
45 if (rc != NO_ERROR) return rc; in readFromParcel()
48 rc = parcel->readParcelableVector(&temp_vector); in readFromParcel()
49 if (rc != NO_ERROR) return rc; in readFromParcel()
Dkeystore_cli_v2.cpp113 auto rc = keystore->getSecurityLevel(securitylevel, &sec_level); in GetSecurityLevelInterface() local
114 if (rc.isOk()) return sec_level; in GetSecurityLevelInterface()
115 std::cerr << "Unable to get security level interface from Keystore: " << rc.getDescription(); in GetSecurityLevelInterface()
234 auto rc = keystore->getKeyEntry(keyDescriptor(name), &keyEntryResponse); in loadOrCreateAndVerifyEncryptionKey() local
235 if (!rc.isOk()) { in loadOrCreateAndVerifyEncryptionKey()
236 auto error = unwrapError(rc); in loadOrCreateAndVerifyEncryptionKey()
240 std::cerr << "Failed to get key entry: " << rc.getDescription() << std::endl; in loadOrCreateAndVerifyEncryptionKey()
255 rc = sec_level->generateKey(keyDescriptor(name), {} /* attestationKey */, in loadOrCreateAndVerifyEncryptionKey()
258 if (!rc.isOk()) { in loadOrCreateAndVerifyEncryptionKey()
259 std::cerr << "Failed to generate key: " << rc.getDescription() << std::endl; in loadOrCreateAndVerifyEncryptionKey()
[all …]
/system/core/trusty/libtrusty/
Dtrusty.c34 int rc; in tipc_connect() local
38 rc = -errno; in tipc_connect()
40 return rc < 0 ? rc : -1; in tipc_connect()
43 rc = TEMP_FAILURE_RETRY(ioctl(fd, TIPC_IOC_CONNECT, srv_name)); in tipc_connect()
44 if (rc < 0) { in tipc_connect()
45 rc = -errno; in tipc_connect()
48 return rc < 0 ? rc : -1; in tipc_connect()
63 int rc = TEMP_FAILURE_RETRY(ioctl(fd, TIPC_IOC_SEND_MSG, &req)); in tipc_send() local
64 if (rc < 0) { in tipc_send()
65 ALOGE("%s: failed to send message (err=%d)\n", __func__, rc); in tipc_send()
[all …]
/system/extras/tests/pagingtest/
Dpagingtest.c23 ssize_t rc; in create_tmp_file() local
58 rc = read(urandom, tmp_buf, tmp_size); in create_tmp_file()
60 if (rc < 0) { in create_tmp_file()
65 tmp_buf += rc; in create_tmp_file()
66 tmp_size -= rc; in create_tmp_file()
79 rc = posix_fadvise(fd, 0, size, POSIX_FADV_DONTNEED); in create_tmp_file()
80 if (rc) { in create_tmp_file()
144 int rc; in main() local
166 rc = mmap_test(test_runs, alloc_size); in main()
167 if (rc) { in main()
[all …]
/system/sepolicy/tools/
Dversion_policy.c31 int rc = SEPOL_ERR; in read_cil_file() local
43 rc = stat(path, &filedata); in read_cil_file()
44 if (rc == -1) { in read_cil_file()
52 rc = SEPOL_ERR; in read_cil_file()
55 rc = fread(buff, file_size, 1, file); in read_cil_file()
56 if (rc != 1) { in read_cil_file()
58 rc = SEPOL_ERR; in read_cil_file()
65 rc = cil_add_file(*db, path, buff, file_size); in read_cil_file()
66 if (rc != SEPOL_OK) { in read_cil_file()
79 return rc; in read_cil_file()
[all …]
/system/core/trusty/libtrusty/tipc-test/
Dtipc_test.c283 ssize_t rc; in closer3_test() local
303 rc = write(fd[j], buf, sizeof(buf)); in closer3_test()
304 if (rc != sizeof(buf)) { in closer3_test()
307 __func__, j, fd[j], rc); in closer3_test()
321 rc = write(fd[j], buf, sizeof(buf)); in closer3_test()
322 if (rc != sizeof(buf)) { in closer3_test()
325 __func__, j, fd[j], rc); in closer3_test()
350 ssize_t rc; in echo_test() local
376 rc = write(echo_fd, tx_buf, msg_len); in echo_test()
377 if ((size_t)rc != msg_len) { in echo_test()
[all …]
/system/core/trusty/gatekeeper/
Dtrusty_gatekeeper_ipc.c36 int rc = tipc_connect(TRUSTY_DEVICE_NAME, GATEKEEPER_PORT); in trusty_gatekeeper_connect() local
37 if (rc < 0) { in trusty_gatekeeper_connect()
38 return rc; in trusty_gatekeeper_connect()
41 handle_ = rc; in trusty_gatekeeper_connect()
57 ssize_t rc = write(handle_, msg, msg_size); in trusty_gatekeeper_call() local
60 if (rc < 0) { in trusty_gatekeeper_call()
66 rc = read(handle_, out, *out_size); in trusty_gatekeeper_call()
67 if (rc < 0) { in trusty_gatekeeper_call()
73 if ((size_t) rc < sizeof(struct gatekeeper_message)) { in trusty_gatekeeper_call()
74 ALOGE("invalid response size (%d)\n", (int) rc); in trusty_gatekeeper_call()
[all …]
/system/core/trusty/confirmationui/
DNotSoSecureInput.cpp128 teeui::ResponseCode rc; in handleEvent() local
130 auto response = std::tie(rc, ir); in handleEvent()
133 if (rc != ResponseCode::OK) { in handleEvent()
134 LOG(ERROR) << "DeliverInputEvent returned with " << uint32_t(rc); in handleEvent()
135 inputResultCb_(rc); in handleEvent()
139 inputResultCb_(rc); in handleEvent()
142 rc = performDTUPHandshake(); in handleEvent()
143 if (rc != ResponseCode::OK) { in handleEvent()
144 inputResultCb_(rc); in handleEvent()
148 inputResultCb_(rc); in handleEvent()
[all …]
/system/core/trusty/metrics/
Dmetrics.cpp45 int rc = fcntl(fd, F_SETFL, flags | O_NONBLOCK); in Open() local
46 if (rc < 0) { in Open()
64 int rc = poll(&pfd, 1, timeout_ms); in WaitForEvent() local
65 if (rc != 1) { in WaitForEvent()
83 auto rc = read(metrics_fd_, msg, sizeof(msg)); in HandleEvent() local
84 if (rc < 0) { in HandleEvent()
87 size_t msg_len = rc; in HandleEvent()
90 return Error() << "message too small: " << rc; in HandleEvent()
99 return Error() << "message too small: " << rc; in HandleEvent()
105 return Error() << "message too small: " << rc; in HandleEvent()
[all …]
/system/logging/logd/
Dlibaudit.cpp38 int rc = audit_get_reply(fd, &rep, GET_REPLY_BLOCKING, MSG_PEEK); in get_ack() local
39 if (rc < 0) { in get_ack()
40 return rc; in get_ack()
45 rc = reinterpret_cast<struct nlmsgerr*>(rep.data)->error; in get_ack()
46 if (rc) { in get_ack()
47 return -rc; in get_ack()
106 ssize_t rc = TEMP_FAILURE_RETRY( in audit_send() local
110 if (rc < 0) { in audit_send()
112 } else if ((uint32_t)rc != req.nlh.nlmsg_len) { in audit_send()
117 rc = get_ack(fd); in audit_send()
[all …]
/system/core/trusty/keymaster/ipc/
Dtrusty_keymaster_ipc.cpp40 int rc = tipc_connect(TRUSTY_DEVICE_NAME, KEYMASTER_PORT); in trusty_keymaster_connect() local
41 if (rc < 0) { in trusty_keymaster_connect()
42 return rc; in trusty_keymaster_connect()
45 handle_ = rc; in trusty_keymaster_connect()
66 ssize_t rc = write(handle_, msg, msg_size); in trusty_keymaster_call() local
69 if (rc < 0) { in trusty_keymaster_call()
82 rc = readv(handle_, iov, 2); in trusty_keymaster_call()
83 if (rc < 0) { in trusty_keymaster_call()
89 if ((size_t)rc < sizeof(struct keymaster_message)) { in trusty_keymaster_call()
90 ALOGE("invalid response size (%d)\n", (int)rc); in trusty_keymaster_call()
[all …]
/system/vold/fs/
DVfat.cpp61 int rc = 0; in Check() local
71 rc = ForkExecvp(cmd, nullptr, sFsckUntrustedContext); in Check()
73 if (rc < 0) { in Check()
79 switch (rc) { in Check()
104 LOG(ERROR) << "Filesystem check failed (unknown exit code " << rc << ")"; in Check()
115 int rc; in Mount() local
131 rc = mount(c_source, c_target, "vfat", flags, mountData.c_str()); in Mount()
133 if (rc && errno == EROFS) { in Mount()
136 rc = mount(c_source, c_target, "vfat", flags, mountData.c_str()); in Mount()
139 if (rc == 0 && createLost) { in Mount()
[all …]
/system/vold/
DKeymaster.cpp54 static bool logKeystore2ExceptionIfPresent(::ndk::ScopedAStatus& rc, const std::string& func_name) { in logKeystore2ExceptionIfPresent() argument
55 if (rc.isOk()) return false; in logKeystore2ExceptionIfPresent()
57 auto exception_code = rc.getExceptionCode(); in logKeystore2ExceptionIfPresent()
60 << " returned service specific error: " << rc.getServiceSpecificError(); in logKeystore2ExceptionIfPresent()
79 auto rc = ks2Operation->update(input_vec, &output); in updateCompletely() local
81 if (logKeystore2ExceptionIfPresent(rc, "update")) { in updateCompletely()
95 auto rc = ks2Operation->finish(std::nullopt, std::nullopt, &out_vec); in finish() local
96 if (logKeystore2ExceptionIfPresent(rc, "finish")) { in finish()
124 auto rc = keystore2Service->getSecurityLevel(km::SecurityLevel::TRUSTED_ENVIRONMENT, in Keymaster() local
126 if (logKeystore2ExceptionIfPresent(rc, "getSecurityLevel")) in Keymaster()
[all …]
/system/core/fs_mgr/
Dfs_mgr_format.cpp63 int rc = 0; in format_ext4() local
65 rc = get_dev_sz(fs_blkdev, &dev_sz); in format_ext4()
66 if (rc) { in format_ext4()
67 return rc; in format_ext4()
104 rc = logwrap_fork_execvp(mke2fs_args.size(), mke2fs_args.data(), nullptr, false, LOG_KLOG, in format_ext4()
106 if (rc) { in format_ext4()
107 LERROR << "mke2fs returned " << rc; in format_ext4()
108 return rc; in format_ext4()
114 rc = logwrap_fork_execvp(arraysize(e2fsdroid_args), e2fsdroid_args, nullptr, false, LOG_KLOG, in format_ext4()
116 if (rc) { in format_ext4()
[all …]
/system/core/trusty/apploader/
Dapploader.cpp92 int rc; in read_file() local
103 rc = fstat64(file_fd, &st); in read_file()
104 if (rc < 0) { in read_file()
183 ssize_t rc = read(tipc_fd, &resp, sizeof(resp)); in read_response() local
184 if (rc < 0) { in read_response()
186 return rc; in read_response()
189 if (rc < sizeof(resp)) { in read_response()
190 LOG(ERROR) << "Not enough data in response: " << rc; in read_response()
232 ssize_t rc = 0; in send_app_package() local
238 rc = -1; in send_app_package()
[all …]
/system/nvram/hal/
Dtesting_nvram_implementation.cpp82 int rc = in Connect() local
85 if (rc < 0) { in Connect()
90 nvram_socket_fd_ = rc; in Connect()
106 ssize_t rc = TEMP_FAILURE_RETRY( in SendRequest() local
108 if (rc < 0) { in SendRequest()
113 rc = TEMP_FAILURE_RETRY( in SendRequest()
115 if (rc < 0 || static_cast<size_t>(rc) > sizeof(command_buffer_)) { in SendRequest()
120 if (!nvram::Decode(command_buffer_, static_cast<size_t>(rc), response)) { in SendRequest()
/system/core/trusty/utils/trusty-ut-ctrl/
Dut-ctrl.c101 int rc; in run_trusty_unitest() local
113 rc = read(fd, rx_buf, sizeof(rx_buf)); in run_trusty_unitest()
114 if (rc <= 0 || rc >= (int)sizeof(rx_buf)) { in run_trusty_unitest()
115 fprintf(stderr, "%s: Read failed: %d\n", __func__, rc); in run_trusty_unitest()
125 write(STDOUT_FILENO, rx_buf + 1, rc - 1); in run_trusty_unitest()
139 int rc = 0; in main() local
156 rc = run_trusty_unitest(ut_app); in main()
158 return rc == 0 ? EXIT_SUCCESS : EXIT_FAILURE; in main()

12345678910>>...15