Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 21 of 21) sorted by relevance

/test/vts-testcase/kernel/api/qtaguid/
DSocketTagUserSpace.cpp66 if (bind(sock_server.fd, (struct sockaddr *)&server, sizeof(server)) < 0) { in server_download()
70 listen(sock_server.fd, 3); in server_download()
73 if (connect(sock_client.fd, (struct sockaddr *)&server, sizeof(server)), 0) { in server_download()
77 new_socket = accept(sock_server.fd, (struct sockaddr *)&client, in server_download()
85 send(sock_client.fd, "start", 5, 0); in server_download()
96 EXPECT_GE(recv(sock_client.fd, byte_buffer, 1024, 0), 0); in server_download()
133 fd = socket(AF_INET, SOCK_STREAM, 0); in setup()
134 if (fd < 0) { in setup()
138 if (legacy_tagSocket(fd, tag, getuid()) < 0) { in setup()
140 close(fd); in setup()
[all …]
DSocketTagUserSpace.h29 SockInfo() : fd(-1) {} in SockInfo()
38 int fd; variable
/test/vts/utils/native/libprofiling/
DVtsProfilingInterface.cpp64 int fd = -1; in GetTraceFile() local
66 fd = trace_map_[fullname]; in GetTraceFile()
68 fstat(fd, &statbuf); in GetTraceFile()
71 if (statbuf.st_nlink <= 0 || fcntl(fd, F_GETFD) == -1) { in GetTraceFile()
72 fd = CreateTraceFile(package, version); in GetTraceFile()
73 trace_map_[fullname] = fd; in GetTraceFile()
77 fd = CreateTraceFile(package, version); in GetTraceFile()
78 trace_map_[fullname] = fd; in GetTraceFile()
80 return fd; in GetTraceFile()
99 int fd = open(file_path.c_str(), O_RDWR | O_CREAT | O_EXCL, in CreateTraceFile() local
[all …]
/test/vts-testcase/security/poc/target/kernel_bluetooth/30149612/
Dpoc.cpp14 int fd; in main() local
16 fd = socket(AF_BLUETOOTH, SOCK_STREAM, 3); in main()
17 if (fd == -1) { in main()
25 if (bind(fd, &sa, 2)) { in main()
27 close(fd); in main()
32 if (getsockname(fd, &sa, &len)) { in main()
34 close(fd); in main()
51 close(fd); in main()
/test/vts/hals/light/bullhead/
Dlights.c61 int fd; in write_int() local
64 fd = open(path, O_RDWR); in write_int()
65 if (fd >= 0) { in write_int()
68 int amt = write(fd, buffer, bytes); in write_int()
69 close(fd); in write_int()
82 int fd; in write_on_off() local
85 fd = open(path, O_RDWR); in write_on_off()
86 if (fd >= 0) { in write_on_off()
89 int amt = write(fd, buffer, bytes); in write_on_off()
90 close(fd); in write_on_off()
/test/vts-testcase/security/poc/target/kernel_sound/28838221/
Dpoc.cpp24 int fd; in main() local
27 fd = open(path, O_RDWR); in main()
28 if (fd < 0) { in main()
35 ret = write(fd, buf, SIZE); in main()
42 close(fd); in main()
/test/vts-testcase/security/poc/target/kernel_wifi/31707909/
Dpoc.cpp67 int fd, i, res; in poc() local
76 fd = socket(AF_INET, SOCK_STREAM, 0); in poc()
77 if (fd < 0) { in poc()
78 printf("open socket error : fd:0x%x %s \n", fd, strerror(errno)); in poc()
96 if ((res = ioctl(fd, 0x89F0, (struct ifreq *)&arg)) < 0) { in poc()
101 close(fd); in poc()
/test/vts-testcase/kernel/api/tun/
Dvts_kernel_tun_test.cpp62 int fd = open(tun_device_.c_str(), O_RDWR | O_NONBLOCK); in TunInit() local
63 if (fd < 0) { in TunInit()
66 if (ioctl(fd, TUNSETIFF, (void *) &ifr) < 0) { in TunInit()
67 close(fd); in TunInit()
70 return fd; in TunInit()
/test/vts-testcase/kernel/encryption/
Dfile_based_encryption_tests.cpp163 android::base::unique_fd fd( in IsFscryptV2Supported() local
165 if (fd < 0) { in IsFscryptV2Supported()
170 if (ioctl(fd, FS_IOC_ADD_ENCRYPTION_KEY, nullptr) == 0) { in IsFscryptV2Supported()
198 explicit ScopedF2fsFilePinning(int fd) : fd_(fd) { in ScopedF2fsFilePinning() argument
217 static bool ReadRawDataOfFile(int fd, const std::string &blk_device, in ReadRawDataOfFile() argument
226 if (fsync(fd) != 0) { in ReadRawDataOfFile()
231 ScopedF2fsFilePinning pinned_file(fd); // no-op on non-f2fs in ReadRawDataOfFile()
241 if (ioctl(fd, FS_IOC_FIEMAP, map.get()) != 0) { in ReadRawDataOfFile()
311 android::base::unique_fd fd( in WriteTestFile() local
313 if (fd < 0) { in WriteTestFile()
[all …]
Dutils.cpp143 android::base::unique_fd fd( in GetFilesystemUuid() local
145 if (fd < 0) { in GetFilesystemUuid()
154 if (pread(fd, &sb, sizeof(sb), kExt4SuperBlockOffset) != sizeof(sb)) { in GetFilesystemUuid()
170 if (pread(fd, &magic, sizeof(magic), kF2fsMagicOffset) != sizeof(magic)) { in GetFilesystemUuid()
179 if (pread(fd, fs_uuid->bytes, kFilesystemUuidSize, kF2fsUuidOffset) != in GetFilesystemUuid()
Dmetadata_encryption_tests.cpp110 android::base::unique_fd fd( in ReadBlockDevice() local
112 if (fd < 0) { in ReadBlockDevice()
116 if (!android::base::ReadFully(fd, buffer, count)) { in ReadBlockDevice()
/test/vts-testcase/kernel/bow/
DBowTest.cpp233 unique_fd fd( in PrepareFile() local
235 ASSERT_NE(fd.get(), -1); in PrepareFile()
239 write(fd.get(), buffer, sizeof(buffer)); in PrepareFile()
276 unique_fd fd; in FindChanged() local
278 fd = unique_fd(open(loop_device_.c_str(), O_RDONLY)); in FindChanged()
280 fd = unique_fd(open(bow_device_.c_str(), O_RDONLY)); in FindChanged()
281 EXPECT_NE(fd.get(), -1); in FindChanged()
282 if (fd.get() == -1) return; in FindChanged()
297 EXPECT_NE(lseek(fd.get(), i * sector_size_, SEEK_SET), -1); in FindChanged()
298 EXPECT_EQ(read(fd.get(), buffer, sizeof(buffer)), sizeof(buffer)); in FindChanged()
[all …]
/test/vts/drivers/resource/hidl_handle_driver/
DVtsHidlHandleDriver.cpp104 int fd = native_handle->data[0]; in ReadFile() local
105 ssize_t read_result = read(fd, read_data, num_bytes); in ReadFile()
108 << fd << " failure: " << strerror(errno); in ReadFile()
126 int fd = native_handle->data[0]; in WriteFile() local
127 ssize_t write_result = write(fd, write_data, num_bytes); in WriteFile()
129 LOG(ERROR) << "Write to file failure: write to file with descriptor " << fd in WriteFile()
/test/vts/drivers/hal/replayer/
DVtsHidlHalReplayer.cpp44 int fd = open(trace_file.c_str(), O_RDONLY); in ListTestServices() local
45 if (fd < 0) { in ListTestServices()
51 google::protobuf::io::FileInputStream input(fd); in ListTestServices()
80 int fd = open(trace_file.c_str(), O_RDONLY); in ReplayTrace() local
81 if (fd < 0) { in ReplayTrace()
87 google::protobuf::io::FileInputStream input(fd); in ReplayTrace()
/test/framework/harnesses/host_controller/command_processor/
Dcommand_config.py143 with open(full_path, "r") as fd:
144 context = fd.read()
150 with open(full_path, "r") as fd:
151 context = fd.read()
Dcommand_upload.py337 with open(report_file_path, "w") as fd:
338 fd.write(suite_res_msg.SerializeToString())
339 fd.close()
/test/vts-testcase/security/avb/
DVtsSecurityAvbTest.cpp500 android::base::unique_fd fd(open(boot_path.c_str(), O_RDONLY)); in TEST() local
501 ASSERT_GE(fd, 0) << "Fail to open boot partition. Try 'adb root'."; in TEST()
518 ASSERT_TRUE(android::base::ReadFully(fd, boot_partition_vector.data(), in TEST()
554 android::base::unique_fd fd(open(system_path.c_str(), O_RDONLY)); in TEST() local
555 ASSERT_GE(fd, 0) << "Fail to open system partition. Try 'adb root'."; in TEST()
577 fd, descriptor->image_size, salt, descriptor->data_block_size, in TEST()
/test/vts/utils/native/trace_processor/
DVtsTraceProcessor.cpp47 int fd = in ParseBinaryTrace() local
49 if (fd < 0) { in ParseBinaryTrace()
54 google::protobuf::io::FileInputStream input(fd); in ParseBinaryTrace()
118 int fd = open(output_file.c_str(), O_WRONLY | O_CREAT | O_EXCL, in WriteProfilingMsg() local
120 if (fd < 0) { in WriteProfilingMsg()
125 google::protobuf::io::FileOutputStream output(fd); in WriteProfilingMsg()
/test/vts-testcase/security/system_property/
DVtsTrebleSysPropTest.py186 fd, downloaded = tempfile.mkstemp(dir=self._temp_dir)
187 os.close(fd)
Dvts_treble_sys_prop_test.py248 fd, downloaded = tempfile.mkstemp(dir=self._temp_dir)
249 os.close(fd)
/test/vts/compilation_tools/vtsc/test/golden/DRIVER/
DBar.driver.cpp1177 … int fd = open(file_name.c_str(), fd_val.flags() | O_CREAT, fd_val.mode()); in CallFunction() local
1178 if (fd == -1) { in CallFunction()
1182 handle->data[fd_index] = fd; in CallFunction()