Searched defs:fd (Results 151 - 175 of 337) sorted by relevance

1234567891011>>

/system/core/toolbox/
H A Dnandread.c28 int fd; local
103 fd = open(devname, O_RDONLY);
104 if (fd < 0) {
125 ret = ioctl(fd, MEMGETINFO, &mtdinfo);
151 ret = ioctl(fd, ECCGETLAYOUT, &ecclayout);
164 ret = ioctl(fd, ECCGETSTATS, &initial_ecc);
181 ret = ioctl(fd, MTDFILEMODE, MTD_FILE_MODE_RAW);
194 lseek64(fd, pos, SEEK_SET);
195 ret = read(fd, buffer, mtdinfo.writesize + rawmode);
202 ret = ioctl(fd, MEMREADOO
[all...]
/system/extras/boot_control_copy/
H A Dboot_control_copy.c44 int fd; local
47 fd = boot_info_open_partition(name, NULL, O_RDONLY);
48 if (fd == -1)
50 if (fstat(fd, &statbuf) != 0) {
53 close(fd);
56 close(fd);
/system/extras/ext4_utils/
H A Dext2simg.c56 static int build_sparse_ext(int fd, const char *filename) argument
76 ret = lseek64(fd, (u64)info.block_size * aux_info.bg_desc[i].bg_block_bitmap,
81 ret = read(fd, block_bitmap, info.block_size);
H A Dext4_crypt.cpp110 int fd = open(directory, O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC); local
111 if (fd == -1) {
122 if (ioctl(fd, EXT4_IOC_SET_ENCRYPTION_POLICY, &eep)) {
124 close(fd);
127 close(fd);
142 int fd = open(directory, O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC); local
143 if (fd == -1) {
150 if (ioctl(fd, EXT4_IOC_GET_ENCRYPTION_POLICY, &eep) != 0) {
152 close(fd);
155 close(fd);
[all...]
/system/extras/mmap-perf/
H A DmmapPerf.cpp24 void set(int fd) { m_fd = fd; } argument
26 Fd(int fd) : m_fd{fd} {} argument
58 int fd = open(name.c_str(), O_CREAT | O_RDWR, S_IRWXU); variable
59 if (fd < 0) {
63 m_fileFd.set(fd);
/system/extras/multinetwork/
H A Dhttpurl.cpp141 int fd = socket(address_family, SOCK_STREAM, IPPROTO_TCP); local
142 if (fd < 0) {
150 setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeo, sizeof(timeo));
151 setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &timeo, sizeof(timeo));
154 if (android_setsocknetwork(nethandle, fd) != 0) {
159 close(fd);
163 return fd;
167 int doHttpQuery(int fd, const struct Parameters& parameters) { argument
169 if (connect(fd,
189 const ssize_t sent = write(fd, reques
[all...]
/system/extras/pagecache/
H A Ddumpcache.c75 int fd; local
76 fd = open (fpath, O_RDONLY);
78 if (fd == -1) {
83 void* mapped_addr = mmap(NULL, sb->st_size, PROT_NONE, MAP_SHARED, fd, 0);
103 close(fd);
/system/extras/tests/audio/alsa/
H A Dpcmtest.cpp218 int fd = open("/dev/snd/timer", O_RDWR | O_NONBLOCK); local
219 ASSERT_GE(fd, 0);
220 int ret = ioctl(fd, SNDRV_TIMER_IOCTL_PVERSION, &ver);
223 close(fd);
/system/extras/tests/ext4/
H A Drand_emmc_perf.c110 static void stats_test(int fd, int write_mode, off64_t max_blocks, int stats_count, argument
126 if (lseek64(fd, (rand() % max_blocks) * TST_BLK_SIZE, SEEK_SET) < 0) {
131 if (write(fd, buf, sizeof(buf)) != sizeof(buf)) {
135 if (read(fd, buf, sizeof(buf)) != sizeof(buf)) {
146 static void perf_test(int fd, int write_mode, off64_t max_blocks) argument
156 if (lseek64(fd, (rand() % max_blocks) * TST_BLK_SIZE, SEEK_SET) < 0) {
160 if (write(fd, buf, sizeof(buf)) != sizeof(buf)) {
164 if (read(fd, buf, sizeof(buf)) != sizeof(buf)) {
172 close(fd);
185 int fd, fd local
[all...]
/system/extras/tests/kernel.config/
H A Daslr_test.cpp66 int fd[2]; local
69 if(pipe(fd)) {
76 close(fd[0]);
77 close(fd[1]);
81 close(fd[1]);
85 close(fd[0]);
88 len = read(fd[0], buff, MAX_ADDR_LEN - 1);
91 close(fd[0]);
95 close(fd[0]);
98 close(fd[
[all...]
/system/extras/verity/
H A Dverify_boot_signature.c89 * @param fd File descriptor to the boot image
92 static int get_signature_offset(int fd, off64_t *offset) argument
101 if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) {
126 * @param fd File descriptor to the boot image
130 static int read_signature(int fd, off64_t offset, BootSignature **bs) argument
138 if (lseek64(fd, offset, SEEK_SET) == -1) {
142 if ((in = BIO_new_fd(fd, BIO_NOCLOSE)) == NULL) {
217 * @param fd File descriptor to the boot image
222 static int hash_image(int fd, uint64_t length, const AuthAttrs *aa, argument
242 if (lseek64(fd,
313 verify_signature(int fd, uint64_t length, const BootSignature *bs) argument
365 int fd = -1; local
[all...]
/system/media/alsa_utils/
H A Dalsa_device_proxy.c224 void proxy_dump(const alsa_device_proxy* proxy, int fd) argument
227 dprintf(fd, " channels: %d\n", proxy->alsa_config.channels);
228 dprintf(fd, " rate: %d\n", proxy->alsa_config.rate);
229 dprintf(fd, " period_size: %d\n", proxy->alsa_config.period_size);
230 dprintf(fd, " period_count: %d\n", proxy->alsa_config.period_count);
231 dprintf(fd, " format: %d\n", proxy->alsa_config.format);
/system/tools/aidl/tests/
H A Daidl_test_client_file_descriptors.cpp50 bool DoWrite(string name, const ScopedFd& fd, const string& buf) { argument
53 while ((wrote = write(fd.get(), buf.data(), buf.size())) < 0 && errno == EINTR);
69 bool DoRead(string name, const ScopedFd& fd, const string& expected) { argument
75 while ((got = read(fd.get(), &buf[0], length)) < 0 && errno == EINTR);
/system/update_engine/common/
H A Dsubprocess.cc59 int fd = HANDLE_EINTR(open("/dev/null", O_RDONLY)); local
60 if (fd < 0)
62 if (HANDLE_EINTR(dup2(fd, STDIN_FILENO)) != STDIN_FILENO)
64 IGNORE_EINTR(close(fd));
90 for (const int fd : output_pipes) {
91 proc->RedirectUsingPipe(fd, false);
196 LOG(ERROR) << "Unable to set non-blocking I/O mode on fd "
224 int Subprocess::GetPipeFd(pid_t pid, int fd) const {
228 return pid_record->second->proc.GetPipe(fd);
260 int fd local
[all...]
H A Dsubprocess_unittest.cc109 int fd = subprocess->GetPipeFd(*pid, child_fd); local
110 EXPECT_NE(-1, fd);
113 HANDLE_EINTR(read(fd, buf.data(), buf.size())));
175 base::StringPrintf("echo on pipe >/proc/self/fd/%d", pipe.writer)};
/system/update_engine/
H A Dp2p_manager_unittest.cc316 int fd = open(path.c_str(), O_CREAT|O_RDWR, 0644); local
317 if (fd == -1) {
321 if (ftruncate(fd, size) != 0) {
323 close(fd);
329 if (fsetxattr(fd, "user.cros-p2p-filesize",
332 close(fd);
337 close(fd);
/system/update_engine/payload_generator/
H A Dblock_mapping.cc47 BlockMapping::BlockId BlockMapping::AddDiskBlock(int fd, off_t byte_offset) { argument
50 if (!utils::PReadAll(fd, blob.data(), block_size_, byte_offset, &bytes_read))
54 return AddBlock(fd, byte_offset, blob);
57 bool BlockMapping::AddManyDiskBlocks(int fd, argument
65 fd, initial_byte_offset + block * block_size_);
71 BlockMapping::BlockId BlockMapping::AddBlock(int fd, argument
103 new_ublock->fd = fd;
107 if (fd == -1)
122 if (!utils::PReadAll(fd, blo
[all...]
H A Dfull_update_generator.cc49 // Read a chunk of |size| bytes from |fd| starting at offset |offset|.
51 int fd,
57 fd_(fd),
67 // Run() handles the read from |fd| in a thread-safe way, and stores the
50 ChunkProcessor(const PayloadVersion& version, int fd, off_t offset, size_t size, BlobFileWriter* blob_file, AnnotatedOperation* aop) argument
/system/vold/
H A DDevmapper.cpp57 int fd; local
58 if ((fd = open("/dev/device-mapper", O_RDWR | O_CLOEXEC)) < 0) {
68 if (ioctl(fd, DM_LIST_DEVICES, io)) {
72 close(fd);
80 close(fd);
91 if (ioctl(fd, DM_DEV_STATUS, io2)) {
113 close(fd);
140 int fd; local
141 if ((fd = open("/dev/device-mapper", O_RDWR | O_CLOEXEC)) < 0) {
150 if (ioctl(fd, DM_DEV_STATU
174 int fd; local
271 int fd; local
[all...]
H A DLoop.cpp43 int fd; local
52 if ((fd = open(filename, O_RDWR | O_CLOEXEC)) < 0) {
61 rc = ioctl(fd, LOOP_GET_STATUS64, &li);
62 close(fd);
85 int fd; local
96 if ((fd = open(filename, O_RDWR | O_CLOEXEC)) < 0) {
105 rc = ioctl(fd, LOOP_GET_STATUS64, &li);
107 close(fd);
110 close(fd);
132 int fd; local
257 int fd; local
274 int fd; local
302 int fd; local
[all...]
H A DProcess.cpp67 int fd; local
69 fd = open(buffer, O_RDONLY | O_CLOEXEC);
70 if (fd < 0) {
73 int length = read(fd, buffer, max - 1);
75 close(fd);
88 sprintf(path, "/proc/%d/fd", pid);
H A Dsecdiscard.cpp51 bool overwrite_with_zeros(int fd, off64_t start, off64_t length);
131 AutoCloseFD fd(path);
132 if (!fd) {
141 if (ioctl(fd.get(), FS_IOC_FIEMAP, fiemap.get()) != 0) {
213 bool overwrite_with_zeros(int fd, off64_t start, off64_t length) { argument
214 if (lseek64(fd, start, SEEK_SET) != start) {
222 auto written = write(fd, buf, wlen);
/system/bt/btif/co/
H A Dbta_hh_co.c47 void uhid_set_non_blocking(int fd) argument
49 int opts = fcntl(fd, F_GETFL);
55 if (fcntl(fd, F_SETFL, opts) < 0)
60 static int uhid_write(int fd, const struct uhid_event *ev) argument
63 OSI_NO_INTR(ret = write(fd, ev, sizeof(*ev)));
88 OSI_NO_INTR(ret = read(p_dev->fd, &ev, sizeof(ev)));
200 APPL_TRACE_DEBUG("%s: Thread created fd = %d", __func__, p_dev->fd);
203 pfds[0].fd = p_dev->fd;
238 bta_hh_co_destroy(int fd) argument
248 bta_hh_co_write(int fd, UINT8* rpt, UINT16 len) argument
[all...]
/system/bt/osi/src/
H A Dwakelock.c122 LOG_ERROR(LOG_TAG, "%s lock not acquired, invalid fd", __func__);
166 LOG_ERROR(LOG_TAG, "%s lock not released, invalid fd", __func__);
344 void wakelock_debug_dump(int fd) { argument
372 dprintf(fd, "\nBluetooth Wakelock Statistics:\n");
373 dprintf(fd, " Is acquired : %s\n",
375 dprintf(fd, " Acquired/released count : %zu / %zu\n",
377 dprintf(fd, " Acquired/released error count : %zu / %zu\n",
379 dprintf(fd, " Last acquire/release error code: %d / %d\n",
381 dprintf(fd, " Last acquired time (ms) : %llu\n",
383 dprintf(fd, " Acquire
[all...]
/system/connectivity/dhcp_client/
H A Ddhcpv4.cc166 int fd = sockets_->Socket(PF_PACKET, local
169 if (fd == kInvalidSocketDescriptor) {
173 shill::ScopedSocketCloser socket_closer(sockets_.get(), fd);
181 if (sockets_->AttachFilter(fd, &pf) != 0) {
186 if (sockets_->ReuseAddress(fd) == -1) {
191 if (sockets_->BindToDevice(fd, interface_name_) < 0) {
202 if (sockets_->Bind(fd,

Completed in 494 milliseconds

1234567891011>>