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

12345678

/system/core/debuggerd/
H A Dtombstone.c644 static char* find_and_open_tombstone(int* fd) argument
674 *fd = open(path, O_CREAT | O_EXCL | O_WRONLY, 0600);
675 if (*fd < 0)
678 fchown(*fd, AID_SYSTEM, AID_SYSTEM);
684 *fd = open(path, O_CREAT | O_TRUNC | O_WRONLY, 0600);
685 if (*fd < 0) {
689 fchown(*fd, AID_SYSTEM, AID_SYSTEM);
706 int fd; local
707 char* path = find_and_open_tombstone(&fd);
714 log.tfd = fd;
[all...]
/system/core/fastboot/
H A Dengine.c232 static void *load_buffer(int fd, off_t size) argument
247 lseek(fd, 0, SEEK_SET);
249 ssize_t actually_read = read(fd, (char*)buffer+count, size-count);
266 buffer = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
287 int fd; local
300 fd = open(filename, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0644);
303 fd = fileno(tmpfile());
308 make_ext4fs_internal(fd, NULL, NULL, NULL, 0, 1, 0, 0, 0, NULL);
310 fstat(fd, &st);
312 image->buffer = load_buffer(fd, s
324 int fd; local
[all...]
H A Dfastboot.c144 int fd; local
146 fd = open(fn, O_RDONLY);
147 if (fd < 0) return -1;
149 off = lseek64(fd, 0, SEEK_END);
150 close(fd);
159 int fd; local
163 fd = open(fn, O_RDONLY);
164 if(fd < 0) return 0;
166 sz = lseek(fd, 0, SEEK_END);
169 if(lseek(fd,
492 int fd; local
[all...]
/system/core/init/
H A Dbuiltins.c59 int fd, ret, len; local
61 fd = open(path, O_WRONLY|O_CREAT, 0622);
63 if (fd < 0)
69 ret = write(fd, value, len);
72 close(fd);
82 int fd; local
84 fd = open(path, O_RDONLY | O_NOFOLLOW);
85 if (fd < 0)
86 fd = open(path, O_WRONLY | O_NOFOLLOW);
88 return fd;
93 int fd; local
116 int fd; local
156 int fd, ret; local
409 int mode, loop, fd; local
[all...]
H A Ddevices.c417 int fd; local
840 int dfd, fd; local
844 fd = openat(dfd, "uevent", O_WRONLY);
845 if(fd >= 0) {
846 write(fd, "add\n", 4);
847 close(fd);
857 fd = openat(dfd, de->d_name, O_RDONLY | O_DIRECTORY);
858 if(fd < 0)
861 d2 = fdopendir(fd);
863 close(fd);
884 int fd; local
[all...]
H A Dinit.c125 int fd; local
126 fd = open("/dev/null", O_RDWR);
127 dup2(fd, 0);
128 dup2(fd, 1);
129 dup2(fd, 2);
130 close(fd);
135 int fd; local
136 if ((fd = open(console_name, O_RDWR)) < 0) {
137 fd = open("/dev/null", O_RDWR);
139 ioctl(fd, TIOCSCTT
146 publish_socket(const char *name, int fd) argument
243 int fd, sz; local
575 int fd; local
[all...]
/system/core/liblog/
H A Dfake_log_device.c62 /* the fake fd that's seen by the user */
89 * to both protect the fd list and to prevent LogStates from being
117 * Allocate an fd and associate a new LogState with it.
118 * The fd is available via the fakeFd field of the return value.
135 * Translate an fd to a LogState.
137 static LogState *fdToLogState(int fd) argument
139 if (fd >= FAKE_FD_BASE && fd < FAKE_FD_BASE + MAX_OPEN_LOGS) {
140 return openLogTable[fd - FAKE_FD_BASE];
146 * Unregister the fake fd an
148 deleteFakeFd(int fd) argument
322 fake_writev(int fd, const struct iovec *iov, int iovcnt) argument
542 logWritev(int fd, const struct iovec* vector, int count) argument
605 logClose(int fd) argument
617 int fd = -1; local
675 fakeLogClose(int fd) argument
681 fakeLogWritev(int fd, const struct iovec* vector, int count) argument
[all...]
H A Dlogprint.c895 int fd,
910 ret = write(fd, outBuffer, totalLen);
893 android_log_printLogLine( AndroidLogFormat *p_format, int fd, const AndroidLogEntry *entry) argument
/system/core/libusbhost/
H A Dusbhost.c62 int fd; member in struct:usb_host_context
69 int fd; member in struct:usb_device
134 wds[0] = inotify_add_watch(context->fd, USB_FS_DIR, IN_CREATE | IN_DELETE);
141 ret = inotify_add_watch(context->fd, path, IN_CREATE | IN_DELETE);
154 context->fd = inotify_init();
155 if (context->fd < 0) {
165 close(context->fd);
189 wdd = inotify_add_watch(context->fd, DEV_DIR, IN_CREATE | IN_DELETE);
205 ret = read(context->fd, event_buf, sizeof(event_buf));
216 inotify_rm_watch(context->fd, wd
259 int fd, did_retry = 0, writeable = 1; local
294 usb_device_new(const char *dev_name, int fd) argument
326 int fd = open(device->dev_name, O_RDWR); local
[all...]
/system/core/logcat/
H A Dlogcat.cpp58 int fd; member in struct:log_device_t
262 if (dev->fd > max) {
263 max = dev->fd;
272 FD_SET(dev->fd, &readset);
279 if (FD_ISSET(dev->fd, &readset)) {
282 ret = read(dev->fd, entry->buf, LOGGER_ENTRY_MAX_LEN);
595 int fd; local
601 fd = open("/proc/cmdline", O_RDONLY);
602 if (fd >= 0) {
603 int n = read(fd, cmdlin
[all...]
/system/core/sh/
H A Djobs.c110 static pid_t tcgetpgrp(int fd);
111 static int tcsetpgrp(int fd, pid_t pgrp);
114 tcgetpgrp(int fd) argument
117 if (ioctl(fd, TIOCGPGRP, (char *)&pgrp) == -1)
124 tcsetpgrp(int fd, pid_tpgrp) argument
126 return ioctl(fd, TIOCSPGRP, (char *)&pgrp);
163 /* Move to a high fd */
1355 if (n->nfile.fd != i) {
1356 s[0] = n->nfile.fd + '0';
/system/core/toolbox/
H A Ddd.c159 in.fd = STDIN_FILENO;
161 in.fd = open(in.name, O_RDONLY, 0);
162 if (in.fd < 0) {
169 /* Ensure in.fd is outside the stdio descriptor range */
170 in.fd = redup_clean_fd(in.fd);
184 out.fd = STDOUT_FILENO;
189 out.fd = open(out.name, O_RDWR | OFLAGS, DEFFILEMODE);
195 if (out.fd < 0) {
196 out.fd
272 redup_clean_fd(int fd) argument
566 bwrite(int fd, const void *buf, size_t len) argument
[all...]
H A Dgetevent.c43 static int print_input_props(int fd) argument
52 res = ioctl(fd, EVIOCGPROP(sizeof(bits)), bits);
75 static int print_possible_events(int fd, int print_flags) argument
89 res = ioctl(fd, EVIOCGBIT(i, bits_size), bits);
102 res2 = ioctl(fd, EVIOCGKEY(res), bits + bits_size);
119 res2 = ioctl(fd, EVIOCGLED(res), bits + bits_size);
124 res2 = ioctl(fd, EVIOCGSND(res), bits + bits_size);
129 res2 = ioctl(fd, EVIOCGSW(bits_size), bits + bits_size);
177 if(ioctl(fd, EVIOCGABS(j * 8 + k), &abs) == 0) {
297 int fd; local
[all...]
/system/extras/ext4_utils/
H A Dext4fixup.c87 static void read_sb(int fd, struct ext4_super_block *sb) argument
91 ret = lseek64(fd, 1024, SEEK_SET);
95 ret = read(fd, sb, sizeof(*sb));
103 static void write_sb(int fd, unsigned long long offset, struct ext4_super_block *sb) argument
111 ret = lseek64(fd, offset, SEEK_SET);
115 ret = write(fd, sb, sizeof(*sb));
122 static int get_fs_fixup_state(int fd) argument
131 lseek64(fd, 0, SEEK_SET);
132 len = read(fd, &magic, sizeof(magic));
153 static int set_fs_fixup_state(int fd, in argument
199 read_ext(int fd) argument
258 read_inode(int fd, unsigned int inum, struct ext4_inode *inode) argument
282 read_block(int fd, unsigned long long block_num, void *block) argument
301 write_block(int fd, unsigned long long block_num, void *block) argument
339 check_inode_bitmap(int fd, unsigned int bg_num) argument
371 update_superblocks_and_bg_desc(int fd, int state) argument
475 get_indirect_blocks(int fd, struct ext4_inode *inode, unsigned long long *block_list, unsigned int *count) argument
502 get_block_list_indirect(int fd, struct ext4_inode *inode, unsigned long long *block_list) argument
513 get_extent_ents(int fd, struct ext4_extent_header *ext_hdr, unsigned long long *block_list) argument
539 get_extent_idx(int fd, struct ext4_extent_header *ext_hdr, unsigned long long *block_list) argument
572 get_block_list_extents(int fd, struct ext4_inode *inode, unsigned long long *block_list) argument
593 is_entry_dir(int fd, struct ext4_dir_entry_2 *dirp, int pass) argument
621 recurse_dir(int fd, struct ext4_inode *inode, char *dirbuf, int dirsize, int mode) argument
789 int fd; local
[all...]
/system/media/camera/src/
H A Dcamera_metadata.c611 static void print_data(int fd, const uint8_t *data_ptr, int type, int count,
615 int fd,
617 dump_indented_camera_metadata(metadata, fd, verbosity, 0);
621 int fd,
625 fdprintf(fd, "%*sDumping camera metadata array: Not allocated\n",
630 fdprintf(fd,
635 fdprintf(fd, "%*sVersion: %d, Flags: %08x\n",
656 fdprintf(fd, "%*s%s.%s (%05x): %s[%d]\n",
685 print_data(fd, data_ptr, entry->type, count, indentation);
689 static void print_data(int fd, cons argument
614 dump_camera_metadata(const camera_metadata_t *metadata, int fd, int verbosity) argument
620 dump_indented_camera_metadata(const camera_metadata_t *metadata, int fd, int verbosity, int indentation) argument
[all...]
/system/netd/
H A DCommandListener.cpp207 int fd = open(path, O_WRONLY); local
208 if (fd < 0) {
213 if (write(fd, value, size) != size) {
215 close(fd);
218 close(fd);
H A DMDnsSdListener.cpp550 mPollFds[0].fd = mCtrlSocketPair[0];
612 mPollFds[0].fd = mCtrlSocketPair[0];
618 int fd = DNSServiceRefSockFD((*prevPtr)->mRef); local
619 if (fd != -1) {
620 if (DBG_RESCAN) ALOGD(" adding FD %d", fd);
621 mPollFds[i].fd = fd;
/system/core/adb/
H A Dadb.c624 int fd; local
627 fd = adb_socket_accept(_fd, &addr, &alen);
628 if(fd < 0) return;
630 adb_socket_setbufsize(fd, CHUNK_SIZE);
632 s = create_local_socket(fd);
638 adb_close(fd);
650 int fd; local
653 fd = adb_socket_accept(_fd, &addr, &alen);
654 if(fd < 0) return;
656 s = create_local_socket(fd);
872 int fd; local
1239 int port, fd; local
[all...]
H A Dadb.h101 ** us to our fd event system. For remote asockets
105 int fd; member in struct:asocket
181 int fd; member in struct:atransport
190 /* usb handle or socket fd as needed */
228 int fd; member in struct:alistener
246 asocket *create_local_socket(int fd);
329 void framebuffer_service(int fd, void *cookie);
330 void log_service(int fd, void *cookie);
331 void remount_service(int fd, void *cookie);
488 int sendfailmsg(int fd, cons
[all...]
H A Dcommandline.c203 static void stdin_raw_init(int fd) argument
207 if(tcgetattr(fd, &tio)) return;
208 if(tcgetattr(fd, &tio_save)) return;
216 tcsetattr(fd, TCSANOW, &tio);
217 tcflush(fd, TCIFLUSH);
220 static void stdin_raw_restore(int fd) argument
222 tcsetattr(fd, TCSANOW, &tio_save);
223 tcflush(fd, TCIFLUSH);
227 static void read_and_dump(int fd) argument
232 while(fd >
279 int fd, fdi; local
333 int fdi, fd; local
379 int fd; local
461 int fd; local
610 int fd, ret; local
688 int fd, outFd; local
742 int fd, tarFd; local
1083 int fd; local
1147 int fd; local
1176 int fd = adb_connect(command); local
1355 int fd = adb_connect("jdwp"); local
[all...]
H A Dtransport.c137 read_packet(int fd, const char* name, apacket** ppacket) argument
144 snprintf(buff, sizeof buff, "fd=%d", fd);
148 r = adb_read(fd, p, len);
153 D("%s: read_packet (fd=%d), error ret=%d errno=%d: %s\n", name, fd, r, errno, strerror(errno));
168 write_packet(int fd, const char* name, apacket** ppacket) argument
174 snprintf(buff, sizeof buff, "fd=%d", fd);
185 r = adb_write(fd,
198 transport_socket_events(int fd, unsigned events, void *_t) argument
523 transport_read_action(int fd, struct tmsg* m) argument
545 transport_write_action(int fd, struct tmsg* m) argument
1094 readx(int fd, void *ptr, size_t len) argument
1126 writex(int fd, const void *ptr, size_t len) argument
[all...]
/system/core/charger/
H A Dcharger.c247 int fd; local
250 fd = open(path, O_RDONLY, 0);
251 if (fd < 0)
254 cnt = read(fd, buf, sz - 1);
263 close(fd);
267 if (fd >= 0)
268 close(fd);
488 static int handle_uevent_fd(struct charger *charger, int fd) argument
493 if (fd < 0)
499 n = uevent_kernel_multicast_recv(fd, ms
515 uevent_callback(int fd, short revents, void *data) argument
530 int dfd, fd; local
894 input_callback(int fd, short revents, void *data) argument
932 int fd; local
[all...]
/system/core/libcutils/
H A Dmq.c173 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...]
/system/core/libpixelflinger/codeflinger/
H A DGGLAssembler.cpp161 int fd = i==GGLFormat::ALPHA ? mBlendDstA : mBlendDst; local
177 info.blend = (fs != int(GGL_ONE)) || (fd > int(GGL_ZERO));
493 int fd = component==GGLFormat::ALPHA ? mBlendDstA : mBlendDst; local
499 const int blending = blending_codes(fs, fd);
502 const int need_blending = (fs != int(GGL_ONE)) || (fd > int(GGL_ZERO));
/system/core/libsparse/
H A Doutput_file.c52 int fd, off64_t offset)
54 return __mmap2(addr, length, prot, flags, fd, offset >> 12);
70 int (*open)(struct output_file *, int fd);
110 int fd; member in struct:output_file_normal
125 static int file_open(struct output_file *out, int fd) argument
129 outn->fd = fd;
138 ret = lseek64(outn->fd, cnt, SEEK_CUR);
151 ret = ftruncate64(outn->fd, len);
164 ret = write(outn->fd, dat
51 mmap64(void *addr, size_t length, int prot, int flags, int fd, off64_t offset) argument
191 gz_file_open(struct output_file *out, int fd) argument
275 callback_file_open(struct output_file *out, int fd) argument
326 read_all(int fd, void *buf, size_t len) argument
667 output_file_open_fd(int fd, unsigned int block_size, int64_t len, int gz, int sparse, int chunks, int crc) argument
703 write_fd_chunk(struct output_file *out, unsigned int len, int fd, int64_t offset) argument
[all...]

Completed in 204 milliseconds

12345678