Searched refs:fd (Results 101 - 125 of 218) sorted by relevance

123456789

/system/core/debuggerd/
H A Dgetevent.c22 int fd; local
30 fd = open(device, O_RDWR);
31 if(fd < 0) {
35 if(ioctl(fd, EVIOCGVERSION, &version)) {
38 if(ioctl(fd, EVIOCGID, &id)) {
44 if(ioctl(fd, EVIOCGNAME(sizeof(name) - 1), &name) < 1) {
48 if(ioctl(fd, EVIOCGPHYS(sizeof(location) - 1), &location) < 1) {
52 if(ioctl(fd, EVIOCGUNIQ(sizeof(idstr) - 1), &idstr) < 1) {
69 ufds[nfds].fd = fd;
[all...]
/system/extras/tests/directiotest/
H A Ddirectiotest.c70 static ssize_t do_read(int fd, void *buf, off64_t start, size_t count) argument
75 lseek64(fd, start, SEEK_SET);
78 ret = read(fd, (char *)buf + bytes_read, count - bytes_read);
92 static ssize_t do_write(int fd, const void *buf, off64_t start, size_t count) argument
97 lseek64(fd, start, SEEK_SET);
100 ret = write(fd, (char *)buf + bytes_out, count - bytes_out);
173 int fd; local
187 fd = open(path, O_RDWR | O_DIRECT | O_LARGEFILE);
188 if (fd == -1) {
192 if (fstat(fd,
[all...]
/system/core/adb/
H A Dusb_linux_client.c50 int fd; member in struct:usb_handle
152 int fd; local
157 while (usb->fd != -1)
164 fd = unix_open("/dev/android_adb", O_RDWR);
165 if (fd < 0) {
167 fd = unix_open("/dev/android", O_RDWR);
169 if (fd < 0) {
172 } while (fd < 0);
175 close_on_exec(fd);
176 usb->fd
232 int fd; local
[all...]
H A Dtest_track_devices.c17 unix_write( int fd, const char* buf, int len ) argument
21 int len2 = write(fd, buf, len);
35 unix_read( int fd, char* buf, int len ) argument
39 int len2 = read(fd, buf, len);
H A Dtest_track_jdwp.c17 unix_write( int fd, const char* buf, int len ) argument
21 int len2 = write(fd, buf, len);
35 unix_read( int fd, char* buf, int len ) argument
39 int len2 = read(fd, buf, len);
/system/core/toolbox/grep/
H A Dfile.c107 if (lseek(f->fd, 0, SEEK_SET) == -1)
109 nr = read(f->fd, buffer, MAXBUFSIZ);
117 nr = read(f->fd, buffer, MAXBUFSIZ);
207 (gzbufdesc = gzdopen(f->fd, "r")) == NULL)
211 (bzbufdesc = BZ2_bzdopen(f->fd, "r")) == NULL)
226 close(f->fd);
244 f->fd = STDIN_FILENO;
245 } else if ((f->fd = open(path, O_RDONLY)) == -1) {
260 close(f->fd);
/system/vold/
H A Dmain.cpp103 int dfd, fd; local
107 fd = openat(dfd, "uevent", O_WRONLY);
108 if(fd >= 0) {
109 write(fd, "add\n", 4);
110 close(fd);
122 fd = openat(dfd, de->d_name, O_RDONLY | O_DIRECTORY);
123 if(fd < 0)
126 d2 = fdopendir(fd);
128 close(fd);
/system/core/libcutils/
H A Dqtaguid.c61 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 Dselector.c49 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 Dbuffer.h92 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 Dsched_policy.c70 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 Drecord_stream.c34 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);
/system/core/toolbox/
H A Ddate.c16 int fd; local
37 fd = open("/dev/alarm", O_RDWR);
40 ioctl(fd, ANDROID_ALARM_SET_RTC, &ts);
52 int fd; local
118 fd = open("/dev/alarm", O_RDWR);
121 res = ioctl(fd, ANDROID_ALARM_SET_RTC, &ts);
H A Dioctl.c16 int fd; local
66 fd = open(argv[optind], O_RDWR | O_SYNC);
67 if (fd < 0) {
109 res = ioctl(fd, ioctl_nr, *(uint32_t*)ioctl_args);
111 res = ioctl(fd, ioctl_nr, ioctl_args);
113 res = ioctl(fd, ioctl_nr, 0);
H A Dps.c41 int fd, r; local
60 fd = open(cmdline, O_RDONLY);
61 if(fd == 0) {
64 r = read(fd, cmdline, 1023);
65 close(fd);
71 fd = open(statline, O_RDONLY);
72 if(fd == 0) return -1;
73 r = read(fd, statline, 1023);
74 close(fd);
149 fd
[all...]
H A Dtouch.c17 int i, fd, aflag = 0, mflag = 0, debug = 0, flags = 0; local
62 if ((fd=creat(file, 0666)) != -1)
63 close(fd);
H A Dsendevent.c51 int fd; local
61 fd = open(argv[1], O_RDWR);
62 if(fd < 0) {
66 if (ioctl(fd, EVIOCGVERSION, &version)) {
74 ret = write(fd, &event, sizeof(event));
/system/extras/ext4_utils/
H A Dmake_ext4fs_main.c62 int fd; local
169 fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
170 if (fd < 0) {
175 fd = STDOUT_FILENO;
178 exitcode = make_ext4fs_internal(fd, directory, mountpoint, fs_config_func, gzip,
180 close(fd);
H A Dmake_ext4fs.h40 int make_ext4fs_internal(int fd, const char *directory,
/system/core/init/
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...]
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...]
/system/core/libsparse/
H A Dbacked_block.c39 int fd; member in struct:backed_block::__anon460::__anon463
41 } fd; member in union:backed_block::__anon460
90 return bb->fd.fd;
99 return bb->fd.offset;
230 if (a->fd.fd != b->fd.fd ||
231 a->fd
343 backed_block_add_fd(struct backed_block_list *bbl, int fd, int64_t offset, unsigned int len, unsigned int block) argument
[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...]
/system/core/libdiskconfig/
H A Dwrite_lst.c70 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/extras/sane_schedstat/
H A Dsane_schedstat.c143 int fd; local
147 fd = open("/proc/schedstat", O_RDONLY);
148 if (fd < 0) return -1;
149 i = read(fd, buf, sizeof(buf) - 1);
150 close(fd);

Completed in 91 milliseconds

123456789