/system/core/libcutils/ |
H A D | ashmem-dev.c | 44 int fd, ret; local 46 fd = open(ASHMEM_DEVICE, O_RDWR); 47 if (fd < 0) 48 return fd; 54 ret = ioctl(fd, ASHMEM_SET_NAME, buf); 59 ret = ioctl(fd, ASHMEM_SET_SIZE, size); 63 return fd; 66 close(fd); 70 int ashmem_set_prot_region(int fd, int prot) argument 72 return ioctl(fd, ASHMEM_SET_PROT_MAS 75 ashmem_pin_region(int fd, size_t offset, size_t len) argument 81 ashmem_unpin_region(int fd, size_t offset, size_t len) argument 87 ashmem_get_size_region(int fd) argument [all...] |
H A D | ashmem-host.c | 42 int fd; local 60 fd = open(name, O_RDWR | O_CREAT | O_EXCL, 0600); 61 if (fd == -1) { 69 if (ftruncate(fd, size) == -1) 75 return fd; 77 close(fd); 81 int ashmem_set_prot_region(int fd, int prot) argument 86 int ashmem_pin_region(int fd, size_t offset, size_t len) argument 91 int ashmem_unpin_region(int fd, size_t offset, size_t len) argument 96 int ashmem_get_size_region(int fd) argument [all...] |
H A D | buffer.c | 77 ssize_t bufferRead(Buffer* buffer, int fd) { argument 80 ssize_t bytesRead = read(fd, 96 ssize_t bufferWrite(Buffer* buffer, int fd) { argument 100 ssize_t bytesWritten = write(fd,
|
H A D | buffer.h | 92 ssize_t bufferRead(Buffer* buffer, int fd); 100 * Writes data from buffer to the given fd. Returns -1 and sets errno in case 106 ssize_t bufferWrite(Buffer* buffer, int fd);
|
H A D | debugger.c | 56 int dump_backtrace_to_file(pid_t tid, int fd) { argument 78 if (TEMP_FAILURE_RETRY(write(fd, buffer, n)) != n) {
|
H A D | fs.c | 78 int fd = TEMP_FAILURE_RETRY(open(path, O_RDONLY)); local 79 if (fd == -1) { 85 if (TEMP_FAILURE_RETRY(read(fd, buf, BUF_SIZE)) == -1) { 93 close(fd); 97 close(fd); 109 int fd = TEMP_FAILURE_RETRY(mkstemp(temp)); local 110 if (fd == -1) { 121 if (TEMP_FAILURE_RETRY(write(fd, buf, len)) < len) { 125 if (close(fd) == -1) { 138 close(fd); [all...] |
H A D | load_file.c | 26 int fd; local 29 fd = open(fn, O_RDONLY); 30 if(fd < 0) return 0; 32 sz = lseek(fd, 0, SEEK_END); 35 if(lseek(fd, 0, SEEK_SET) != 0) goto oops; 40 if(read(fd, data, sz) != sz) goto oops; 41 close(fd); 48 close(fd);
|
H A D | mq.c | 173 SelectableFd* fd; member in struct:PeerProxy 211 static void setNonBlocking(int fd) { argument 213 if ((flags = fcntl(fd, F_GETFL, 0)) < 0) { 216 if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) { 221 /** Closes a fd and logs a warning if the close fails. */ 222 static void closeWithWarning(int fd) { argument 223 int result = close(fd); 408 // Remove the fd from the selector. 409 if (peerProxy->fd != NULL) { 410 peerProxy->fd 515 peerProxyWrite(SelectableFd* fd) argument 561 peerProxyBeforeSelect(SelectableFd* fd) argument 706 peerProxySetFd(PeerProxy* peerProxy, SelectableFd* fd) argument 965 peerProxyRead(SelectableFd* fd) argument [all...] |
H A D | partition_utils.c | 42 int fd, ret, wiped; local 44 if ((fd = open(source, O_RDONLY)) < 0) { 48 ret = read(fd, buf, sizeof(buf)); 49 close(fd);
|
H A D | process_name.c | 80 int fd = open(PROCESS_NAME_DEVICE, O_RDWR); local 81 if (fd < 0) 83 write(fd, process_name, strlen(process_name) + 1); 84 close(fd);
|
H A D | qtaguid.c | 61 int fd, res, savedErrno; local 65 fd = TEMP_FAILURE_RETRY(open(CTRL_PROCPATH, O_WRONLY)); 66 if (fd < 0) { 70 res = TEMP_FAILURE_RETRY(write(fd, cmd, strlen(cmd))); 79 close(fd); 147 int fd, cnt = 0, res = 0; local
|
H A D | record_stream.c | 34 int fd; member in struct:RecordStream 45 extern RecordStream *record_stream_new(int fd, size_t maxRecordLen) argument 53 ret->fd = fd; 115 * Reads the next record from stream fd 166 countRead = read (p_rs->fd, p_rs->read_end, p_rs->buffer_end - p_rs->read_end);
|
H A D | sched_policy.c | 70 int fd; local 74 fd = bg_cgroup_fd; 79 fd = fg_cgroup_fd; 83 fd = system_cgroup_fd; 87 fd = -1; 91 if (fd < 0) { 106 if (write(fd, ptr, end - ptr) < 0) { 275 int fd; local 280 fd = open(statfile, O_RDONLY); 281 if (fd > [all...] |
H A D | selector.c | 49 if (read(wakeupFd->fd, garbage, sizeof(garbage)) < 0) { 99 ALOGD("Wakeup fd: %d", selector->wakeupPipe[0]); 112 SelectableFd* selectorAdd(Selector* selector, int fd) { argument 118 selectableFd->fd = fd; 127 * Adds an fd to the given set if the callback is non-null. Returns true 128 * if the fd was added. 133 FD_SET(selectableFd->fd, fdSet); 172 ALOGD("Selecting fd %d for writing...", selectableFd->fd); 185 int fd = selectableFd->fd; local [all...] |
H A D | socket_local_client.c | 118 * connect to peer named "name" on fd 119 * returns same fd or -1 on error. 120 * fd is not closed on error. that's your job. 124 int socket_local_client_connect(int fd, const char *name, int namespaceId, argument 138 if(connect(fd, (struct sockaddr *) &addr, alen) < 0) { 142 return fd; 150 * returns fd or -1 on error
|
H A D | sockets.c | 25 bool socket_peer_is_trusted(int fd) argument 30 int n = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len);
|
H A D | tzstrftime.c | 731 int fd; local 772 fd = open(filename, O_RDONLY); 773 if (fd < 0) { 780 fd = open(filename, O_RDONLY); 781 if (fd < 0) 784 if (fstat(fd, &st) != 0) 796 if (read(fd, p, (size_t) st.st_size) != st.st_size) 798 if (close(fd) != 0) 836 (void) close(fd);
|
H A D | uio.c | 22 int readv( int fd, struct iovec* vecs, int count ) argument 31 int ret = read( fd, buf, len ); 49 int writev( int fd, const struct iovec* vecs, int count ) argument 58 int ret = write( fd, buf, len );
|
H A D | zygote.c | 45 static int send_request(int fd, int sendStdio, int argc, const char **argv) argument 93 ret = sendmsg(fd, &msg, MSG_NOSIGNAL); 100 // Only send the fd's once 125 ret = sendmsg(fd, &msg, MSG_NOSIGNAL); 145 ret = recvmsg(fd, &msg, MSG_NOSIGNAL | MSG_WAITALL); 164 int fd; local 169 fd = socket_local_client(ZYGOTE_SOCKET, 172 if (fd < 0) { 181 pid = send_request(fd, 1, argc + 1, newargv); 190 err = read(fd, 218 int fd = -1; local [all...] |
/system/core/libdiskconfig/ |
H A D | diskconfig.c | 239 sync_ptable(int fd) argument 246 if (fstat(fd, &stat)) { 251 if (S_ISBLK(stat.st_mode) && ((rv = ioctl(fd, BLKRRPART, NULL)) < 0)) { 273 int fd; local 283 if ((fd = open(dinfo->device, O_RDWR)) < 0) { 288 if (fstat(fd, &stat)) { 301 if (ioctl(fd, BLKSSZGET, §_sz) < 0) { 313 if (ioctl(fd, BLKGETSIZE64, &disk_size) < 0) { 379 return fd; 382 close(fd); 387 validate_and_config(struct disk_info *dinfo, int *fd, struct write_list **lst) argument 422 int fd; local 436 int fd; local [all...] |
H A D | write_lst.c | 70 wlist_commit(int fd, struct write_list *lst, int test) argument 73 if (lseek64(fd, lst->offset, SEEK_SET) != (loff_t)lst->offset) { 79 if (write(fd, lst->data, lst->len) != (int)lst->len) {
|
/system/core/libion/ |
H A D | ion.c | 35 int fd = open("/dev/ion", O_RDWR); local 36 if (fd < 0) 38 return fd; 41 int ion_close(int fd) argument 43 return close(fd); 46 static int ion_ioctl(int fd, int req, void *arg) argument 48 int ret = ioctl(fd, req, arg); 57 int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, argument 68 ret = ion_ioctl(fd, ION_IOC_ALLOC, &data); 75 int ion_free(int fd, struc argument 83 ion_map(int fd, struct ion_handle *handle, size_t length, int prot, int flags, off_t offset, unsigned char **ptr, int *map_fd) argument 106 ion_share(int fd, struct ion_handle *handle, int *share_fd) argument 124 ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask, unsigned int flags, int *handle_fd) argument 137 ion_import(int fd, int share_fd, struct ion_handle **handle) argument 150 ion_sync_fd(int fd, int handle_fd) argument [all...] |
H A D | ion_test.c | 26 int _ion_alloc_test(int *fd, struct ion_handle **handle) argument 30 *fd = ion_open(); 31 if (*fd < 0) 32 return *fd; 34 ret = ion_alloc(*fd, len, align, heap_mask, alloc_flags, handle); 43 int fd, ret; local 46 if(_ion_alloc_test(&fd, &handle)) 49 ret = ion_free(fd, handle); 54 ion_close(fd); 60 int fd, map_f local 121 int fd, share_fd, ret; local 156 int fd, recv_fd; local [all...] |
/system/core/liblinenoise/ |
H A D | linenoise.c | 116 static int enableRawMode(int fd) { argument 124 if (tcgetattr(fd,&orig_termios) == -1) goto fatal; 142 if (tcsetattr(fd,TCSADRAIN,&raw) < 0) goto fatal; 151 static void disableRawMode(int fd) { argument 153 if (rawmode && tcsetattr(fd,TCSADRAIN,&orig_termios) != -1) 187 static void refreshLine(int fd, const char *prompt, char *buf, size_t len, size_t pos, size_t cols) { argument 202 if (write(fd,seq,strlen(seq)) == -1) return; 204 if (write(fd,prompt,strlen(prompt)) == -1) return; 205 if (write(fd,buf,len) == -1) return; 208 if (write(fd,se 214 linenoisePrompt(int fd, char *buf, size_t buflen, const char *prompt) argument 365 int fd = STDIN_FILENO; local [all...] |
/system/core/liblog/ |
H A D | event_tag_map.c | 68 int fd = -1; local 74 fd = open(fileName, O_RDONLY); 75 if (fd < 0) { 81 end = lseek(fd, 0L, SEEK_END); 82 (void) lseek(fd, 0L, SEEK_SET); 89 fd, 0); 104 if (fd >= 0) 105 close(fd);
|