/system/connectivity/shill/ |
H A D | icmp_unittest.cc | 78 bool StartIcmpWithFD(int fd) { argument 80 .WillOnce(Return(fd)); 81 EXPECT_CALL(*sockets_, SetNonBlocking(fd)).WillOnce(Return(0)); 84 EXPECT_EQ(fd, icmp_.socket_);
|
/system/core/adb/ |
H A D | adb_client.cpp | 72 static int switch_socket_transport(int fd, std::string* error) { argument 97 if (!SendProtocolString(fd, service)) { 99 adb_close(fd); 104 if (!adb_status(fd, error)) { 105 adb_close(fd); 113 bool adb_status(int fd, std::string* error) { argument 115 if (!ReadFdExactly(fd, buf, 4)) { 130 ReadProtocolString(fd, error, error); 142 int fd; local 145 fd 185 int fd = _adb_connect("host:version", error); local 276 int fd = adb_connect(service, &error); local 295 int fd = adb_connect(service, error); local [all...] |
H A D | adb_listeners.cpp | 40 int fd = adb_socket_accept(_fd, addrp, &alen); local 41 if (fd < 0) return; 44 adb_setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &rcv_buf_size, sizeof(rcv_buf_size)); 46 asocket* s = create_local_socket(fd); 52 adb_close(fd); 65 int fd; local 68 fd = adb_socket_accept(_fd, addrp, &alen); 69 if (fd < 0) { 73 s = create_local_socket(fd); 80 adb_close(fd); [all...] |
H A D | adb_trace.cpp | 66 int fd = unix_open(get_log_file_name().c_str(), local 68 if (fd == -1) { 73 dup2(fd, STDOUT_FILENO); 74 dup2(fd, STDERR_FILENO); 76 unix_close(fd);
|
H A D | adb_utils.cpp | 55 int fd = unix_open(kNullFileName, O_RDONLY); local 56 if (fd == -1) { 60 if (TEMP_FAILURE_RETRY(dup2(fd, STDIN_FILENO)) == -1) { 63 unix_close(fd); 227 bool set_file_block_mode(int fd, bool block) { argument 228 int flags = fcntl(fd, F_GETFL, 0); 230 PLOG(ERROR) << "failed to fcntl(F_GETFL) for fd " << fd; 234 if (fcntl(fd, F_SETFL, flags) != 0) { 235 PLOG(ERROR) << "failed to fcntl(F_SETFL) for fd " << f [all...] |
H A D | framebuffer_service.cpp | 57 void framebuffer_service(int fd, void *cookie) argument 168 if(!WriteFdExactly(fd, &fbinfo, sizeof(fbinfo))) goto done; 176 if(!WriteFdExactly(fd, buf, bsize)) goto done; 184 adb_close(fd);
|
H A D | shell_service_test.cpp | 67 int fd[2]; local 68 ASSERT_TRUE(adb_socketpair(fd) >= 0); 69 SHELL_EXIT_NOTIFY_FD = fd[0]; 70 shell_exit_receiver_fd_ = fd[1]; 97 // Reads raw data from |fd| until it closes or errors. 98 std::string ReadRaw(int fd) { argument 103 int bytes = adb_read(fd, cur_ptr, end_ptr - cur_ptr); 111 // Reads shell protocol data from |fd| until it closes or errors. Fills 114 int ReadShellProtocol(int fd, std::string* stdout, std::string* stderr) { argument 119 ShellProtocol* protocol = new ShellProtocol(fd); [all...] |
H A D | transport.h | 71 int fd = -1; member in class:atransport 80 // USB handle or socket fd as needed.
|
/system/core/base/ |
H A D | file.cpp | 38 bool ReadFdToString(int fd, std::string* content) { argument 43 while ((n = TEMP_FAILURE_RETRY(read(fd, &buf[0], sizeof(buf)))) > 0) { 52 int fd = TEMP_FAILURE_RETRY(open(path.c_str(), O_RDONLY | O_CLOEXEC | O_NOFOLLOW | O_BINARY)); local 53 if (fd == -1) { 56 bool result = ReadFdToString(fd, content); 57 close(fd); 61 bool WriteStringToFd(const std::string& content, int fd) { argument 65 ssize_t n = TEMP_FAILURE_RETRY(write(fd, p, left)); 87 int fd = TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode)); local 88 if (fd 114 int fd = TEMP_FAILURE_RETRY(open(path.c_str(), flags, DEFFILEMODE)); local 124 ReadFully(int fd, void* data, size_t byte_count) argument 136 WriteFully(int fd, const void* data, size_t byte_count) argument [all...] |
/system/core/debuggerd/ |
H A D | getevent.cpp | 37 int fd; local 45 fd = open(device, O_RDWR); 46 if (fd < 0) { 50 if (ioctl(fd, EVIOCGVERSION, &version)) { 53 if (ioctl(fd, EVIOCGID, &id)) { 59 if (ioctl(fd, EVIOCGNAME(sizeof(name) - 1), &name) < 1) { 62 if (ioctl(fd, EVIOCGPHYS(sizeof(location) - 1), &location) < 1) { 65 if (ioctl(fd, EVIOCGUNIQ(sizeof(idstr) - 1), &idstr) < 1) { 82 ufds[nfds].fd = fd; [all...] |
/system/core/libcutils/ |
H A D | android_reboot.c | 134 int fd, cnt; local 148 fd = TEMP_FAILURE_RETRY(open("/proc/sysrq-trigger", O_WRONLY)); 149 if (fd < 0) { 156 if (TEMP_FAILURE_RETRY(write(fd, "u", 1)) != 1) { 157 close(fd); 162 close(fd);
|
H A D | fs.c | 121 int fd = TEMP_FAILURE_RETRY(open(path, O_RDONLY)); local 122 if (fd == -1) { 128 if (TEMP_FAILURE_RETRY(read(fd, buf, BUF_SIZE)) == -1) { 136 close(fd); 140 close(fd); 152 int fd = TEMP_FAILURE_RETRY(mkstemp(temp)); local 153 if (fd == -1) { 164 if (TEMP_FAILURE_RETRY(write(fd, buf, len)) < len) { 168 if (close(fd) == -1) { 181 close(fd); 191 int fd = 0; local [all...] |
H A D | fs_config.c | 169 int fd = -1; local 182 fd = TEMP_FAILURE_RETRY(open(name, O_RDONLY | O_BINARY)); 186 if (fd < 0) { 187 fd = TEMP_FAILURE_RETRY(open(dir ? conf_dir : conf_file, O_RDONLY | O_BINARY)); 189 return fd; 215 int fd, plen; local 223 fd = fs_config_open(dir, target_out_path); 224 if (fd >= 0) { 227 while (TEMP_FAILURE_RETRY(read(fd, &header, sizeof(header))) == sizeof(header)) { 240 if (TEMP_FAILURE_RETRY(read(fd, prefi [all...] |
H A D | qtaguid.c | 62 int fd, res, savedErrno; local 66 fd = TEMP_FAILURE_RETRY(open(CTRL_PROCPATH, O_WRONLY)); 67 if (fd < 0) { 71 res = TEMP_FAILURE_RETRY(write(fd, cmd, strlen(cmd))); 81 close(fd);
|
/system/core/libdiskconfig/ |
H A D | diskconfig.c | 240 sync_ptable(int fd) argument 247 if (fstat(fd, &stat)) { 252 if (S_ISBLK(stat.st_mode) && ((rv = ioctl(fd, BLKRRPART, NULL)) < 0)) { 274 int fd; local 284 if ((fd = open(dinfo->device, O_RDWR)) < 0) { 289 if (fstat(fd, &stat)) { 302 if (ioctl(fd, BLKSSZGET, §_sz) < 0) { 314 if (ioctl(fd, BLKGETSIZE64, &disk_size) < 0) { 380 return fd; 383 close(fd); 388 validate_and_config(struct disk_info *dinfo, int *fd, struct write_list **lst) argument 423 int fd; local 437 int fd; local [all...] |
/system/core/libion/ |
H A D | ion.c | 36 int fd = open("/dev/ion", O_RDWR); local 37 if (fd < 0) 39 return fd; 42 int ion_close(int fd) argument 44 int ret = close(fd); 50 static int ion_ioctl(int fd, int req, void *arg) argument 52 int ret = ioctl(fd, req, arg); 61 int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, argument 75 ret = ion_ioctl(fd, ION_IOC_ALLOC, &data); 82 int ion_free(int fd, ion_user_handle_ argument 90 ion_map(int fd, ion_user_handle_t handle, size_t length, int prot, int flags, off_t offset, unsigned char **ptr, int *map_fd) argument 121 ion_share(int fd, ion_user_handle_t handle, int *share_fd) argument 142 ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask, unsigned int flags, int *handle_fd) argument 155 ion_import(int fd, int share_fd, ion_user_handle_t *handle) argument 172 ion_sync_fd(int fd, int handle_fd) argument [all...] |
H A D | ion_test.c | 41 int _ion_alloc_test(int *fd, ion_user_handle_t *handle) argument 45 *fd = ion_open(); 46 if (*fd < 0) 47 return *fd; 49 ret = ion_alloc(*fd, len, align, heap_mask, alloc_flags, handle); 58 int fd, ret; local 61 if(_ion_alloc_test(&fd, &handle)) 64 ret = ion_free(fd, handle); 69 ion_close(fd); 75 int fd, map_f local 136 int fd, share_fd, ret; local 172 int fd, recv_fd; local [all...] |
/system/core/libion/kernel-headers/linux/ |
H A D | ion.h | 56 int fd; member in struct:ion_fd_data
|
/system/core/libion/original-kernel-headers/linux/ |
H A D | ion.h | 95 * struct ion_fd_data - metadata passed to/from userspace for a handle/fd pair 97 * @fd: a file descriptor representing that handle 101 * descriptor to share or map in the fd field. For ION_IOC_IMPORT, userspace 106 int fd; member in struct:ion_fd_data 152 * opaque handle. Returns the struct with the fd field set to a file 162 * opaque handle. Returns the struct with the fd field set to a file 172 * Takes an ion_fd_data struct with the fd field populated with a valid file
|
/system/core/liblog/ |
H A D | pmsg_writer.c | 46 .context.fd = -1, 56 if (pmsgLoggerWrite.context.fd < 0) { 57 pmsgLoggerWrite.context.fd = TEMP_FAILURE_RETRY(open("/dev/pmsg0", O_WRONLY | O_CLOEXEC)); 60 return pmsgLoggerWrite.context.fd; 65 if (pmsgLoggerWrite.context.fd >= 0) { 66 close(pmsgLoggerWrite.context.fd); 67 pmsgLoggerWrite.context.fd = -1; 81 if (pmsgLoggerWrite.context.fd < 0) { 118 if (pmsgLoggerWrite.context.fd < 0) { 172 ret = TEMP_FAILURE_RETRY(writev(pmsgLoggerWrite.context.fd, newVe 209 int fd; local [all...] |
/system/core/libmemunreachable/ |
H A D | LeakPipe.h | 55 int fd = ReceiveFd(sv_[0]); local 56 if (fd < 0) { 60 receiver_.SetFd(fd); 84 void SetFd(int fd) { argument 85 fd_ = fd; 195 bool SendFd(int sock, int fd);
|
/system/core/libsysutils/src/ |
H A D | SocketListener.cpp | 176 int fd = (*it)->getSocket(); local 177 FD_SET(fd, &read_fds); 178 if (fd > max) { 179 max = fd; 229 int fd = c->getSocket(); local 230 if (FD_ISSET(fd, &read_fds)) {
|
/system/core/libutils/ |
H A D | Looper.cpp | 57 int SimpleLooperCallback::handleEvent(int fd, int events, void* data) { argument 58 return mCallback(fd, events, data); 78 LOG_ALWAYS_FATAL_IF(mWakeEventFd < 0, "Could not make wake event fd: %s", 159 eventItem.data.fd = mWakeEventFd; 161 LOG_ALWAYS_FATAL_IF(result != 0, "Could not add wake event fd to epoll instance: %s", 169 int epollResult = epoll_ctl(mEpollFd, EPOLL_CTL_ADD, request.fd, & eventItem); 171 ALOGE("Error adding epoll events for fd %d while rebuilding epoll set: %s", 172 request.fd, strerror(errno)); 194 int fd = response.request.fd; [all...] |
H A D | Tokenizer.cpp | 56 int fd = ::open(filename.string(), O_RDONLY); local 57 if (fd < 0) { 62 if (fstat(fd, &stat)) { 71 if (fileMap->create(NULL, fd, 0, length, true)) { 83 ssize_t nrd = read(fd, buffer, length); 98 close(fd);
|
/system/core/logd/ |
H A D | LogBufferElement.cpp | 68 int fd = open(buffer, O_RDONLY); local 69 if (fd >= 0) { 70 ssize_t ret = read(fd, buffer, sizeof(buffer)); 81 close(fd);
|