Searched refs:fd (Results 76 - 100 of 218) sorted by relevance

123456789

/system/core/libsparse/
H A Doutput_file.h24 struct output_file *output_file_open_fd(int fd, unsigned int block_size, int64_t len,
35 int fd, int64_t offset);
39 int read_all(int fd, void *buf, size_t len);
/system/core/toolbox/
H A Dcat.c189 int fd; local
191 fd = fileno(stdin);
196 fd = fileno(stdin);
199 fd = open(*argv, O_RDONLY|O_NONBLOCK, 0);
200 if (fd < 0)
203 if (fstat(fd, &st) == -1) {
204 close(fd);
208 close(fd);
213 else if ((fd = open(*argv, O_RDONLY, 0)) < 0) {
223 raw_cat(fd);
[all...]
H A Dinsmod.c15 int ret, fd; local
21 fd = open(filename, O_RDONLY);
22 if (fd < 0)
26 if (fstat(fd, &sb) < 0)
36 ret = read(fd, buffer, size);
44 close(fd);
H A Dr.c15 int width = 4, set = 0, fd; local
53 fd = open("/dev/mem", O_RDWR | O_SYNC);
54 if(fd < 0) {
64 MAP_SHARED, fd, mmap_start);
H A Dsyren.c68 int fd; local
97 fd = open("/dev/eac", O_RDONLY);
98 if (fd < 0) {
113 if (ioctl(fd, cmd, &sio) < 0) {
120 close(fd);
139 if (ioctl(fd, cmd, &sio) < 0) {
150 close(fd);
H A Dhd.c13 int fd; local
53 fd = open(argv[optind], O_RDONLY);
54 if(fd < 0) {
61 lseek(fd, base, SEEK_SET);
70 res = read(fd, &buf, read_len);
/system/core/init/
H A Dproperty_service.c117 int fd; member in struct:__anon374
123 int fd; local
128 fd = open("/dev/__properties__", O_RDWR | O_CREAT, 0600);
129 if (fd < 0)
132 if (ftruncate(fd, size) < 0)
135 data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
139 close(fd);
141 fd = open("/dev/__properties__", O_RDONLY);
142 if (fd < 0)
149 w->fd
325 int fd, length; local
484 get_property_workspace(int *fd, int *sz) argument
536 int fd, length; local
609 int fd; local
[all...]
/system/core/adb/
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 Dadb_client.h7 ** a valid fd for interacting with that service upon success
51 int adb_status(int fd);
H A Dadb_auth_client.c155 static void adb_auth_event(int fd, unsigned events, void *data) argument
162 ret = unix_read(fd, response, sizeof(response));
207 static void adb_auth_listener(int fd, unsigned events, void *data) argument
215 s = adb_socket_accept(fd, &addr, &alen);
226 int fd, ret; local
231 fd = android_get_control_socket("adbd");
232 if (fd < 0) {
237 ret = listen(fd, 4);
239 D("Failed to listen on '%d'\n", fd);
243 fdevent_install(&listener_fde, fd, adb_auth_listene
[all...]
/system/extras/tests/ext4/
H A Drand_emmc_perf.c45 int fd, fd2, write_mode = 0, iops = 0; local
86 if ((fd = open(argv[optind + 1], O_RDWR | o_sync)) < 0) {
104 if (lseek64(fd, (rand() % max_blocks) * TST_BLK_SIZE, SEEK_SET) < 0) {
108 if (write(fd, buf, sizeof(buf)) != sizeof(buf)) {
112 if (read(fd, buf, sizeof(buf)) != sizeof(buf)) {
120 close(fd);
/system/core/include/cutils/
H A Dabort_socket.h38 * asocket_create() sets the fd to non-blocking mode. It must not be changed to
59 int fd; /* primary socket fd */ member in struct:asocket
63 /* Create an asocket from fd.
67 struct asocket *asocket_init(int fd);
H A Dselector.h53 int fd; member in struct:SelectableFd
95 * The selector which selected this fd. Set by the selector itself.
106 * Creates a new selectable fd, adds it to the given selector and returns a
107 * pointer. Outside of 'selector' and 'fd', all fields are set to 0 or NULL
110 * The selectable fd should only be modified from the selector loop thread.
112 SelectableFd* selectorAdd(Selector* selector, int fd);
H A Ddebugger.h52 int dump_backtrace_to_file(pid_t tid, int fd);
/system/core/sh/
H A Dredir.c112 int fd; local
130 fd = n->nfile.fd;
133 n->ndup.dupfd == fd)
136 if ((flags & REDIR_PUSH) && sv->renamed[fd] == EMPTY) {
139 if ((i = fcntl(fd, F_DUPFD, 10)) == -1) {
150 error("%d: %s", fd, strerror(errno));
155 sv->renamed[fd] = i;
156 close(fd);
160 close(fd);
177 int fd = redir->nfile.fd; local
[all...]
H A Deval.h44 int fd; /* file descriptor to read from */ member in struct:backcmd
/system/extras/tests/framebuffer/
H A Dfb_test.c54 int fd; local
58 fd = open("/dev/graphics/fb0", O_RDWR);
59 if (fd < 0) {
61 if ((fd = open("/dev/fb0", O_RDWR)) < 0) {
67 if(ioctl(fd, FBIOGET_VSCREENINFO, &vi) < 0) {
75 if(ioctl(fd, FBIOPUT_VSCREENINFO, &vi) < 0) {
81 if(ioctl(fd, FBIOGET_FSCREENINFO, &fi) < 0) {
88 bits = mmap(0, fi.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
111 return fd;
141 int fd local
[all...]
/system/core/libdiskconfig/
H A Ddiskconfig.c239 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, &sect_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...]
/system/extras/sound/
H A Dplaywav.c136 int fd, unsigned count)
143 if (read(fd, next, count) != count) {
155 int fd; local
156 fd = open(fn, O_RDONLY);
157 if (fd < 0) {
161 if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) {
186 fd, hdr.data_sz);
197 int fd, afd; local
215 fd = open(fn, O_CREAT | O_RDWR, 0666);
216 if (fd <
135 play_file(unsigned rate, unsigned channels, int fd, unsigned count) argument
299 int fd, afd; local
[all...]
/system/bluetooth/bluedroid/
H A Dbluetooth.c52 int fd; local
57 fd = open(path, O_RDONLY);
58 if (fd < 0) {
62 sz = read(fd, &buf, sizeof(buf));
63 close(fd);
76 int fd = -1; local
84 fd = open(rfkill_state_path, O_RDONLY);
85 if (fd < 0) {
90 sz = read(fd, &buffer, 1);
107 if (fd >
113 int fd = -1; local
[all...]
/system/core/fastboot/
H A Dusb_linux.c98 static int filter_usb_device(int fd, char *ptr, int len, int writable, argument
153 result = ioctl(fd, USBDEVFS_CONTROL, &ctrl);
165 * hub. We are passed an fd that was obtained by opening an entry under
183 result = fstat(fd, &st);
253 int fd; local
274 if((fd = open(devname, O_RDWR)) < 0) {
278 if((fd = open(devname, O_RDONLY)) < 0) {
283 n = read(fd, desc, sizeof(desc));
285 if(filter_usb_device(fd, desc, n, writable, callback,
291 usb->desc = fd;
408 int fd; local
420 int fd; local
[all...]
/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/vold/
H A Dcryptfs.c89 int fd, block_size; local
93 if ((fd = open(dev, O_RDONLY)) < 0) {
98 if (lseek64(fd, 1024, SEEK_SET) < 0) {
103 if (read(fd, &sb, sizeof(sb)) != sizeof(sb)) {
108 close(fd);
118 static unsigned int get_blkdev_size(int fd) argument
122 if ( (ioctl(fd, BLKGETSIZE, &nr_sec)) == -1) {
148 int fd; local
160 if ( (fd = open(fname, O_RDWR)) < 0) {
165 if ( (nr_sec = get_blkdev_size(fd))
247 int fd; local
389 int fd; local
466 int fd; local
572 int fd; local
888 int nr_sec, fd; local
1030 unix_read(int fd, void* buff, int len) argument
1037 unix_write(int fd, const void* buff, int len) argument
1141 int rc=-1, fd, i, ret; local
1402 int fd = open("/cache/recovery/command", O_RDWR|O_CREAT|O_TRUNC, 0600); local
[all...]
/system/core/debuggerd/
H A Ddebuggerd.c61 int fd; local
63 fd = open(file, O_RDWR);
65 if (fd < 0)
67 amt = write(fd, string, len);
68 close(fd);
187 static int read_request(int fd, debugger_request_t* out_request) { argument
190 int status = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len);
197 fcntl(fd, F_SETFL, O_NONBLOCK);
200 pollfds[0].fd = fd;
264 handle_request(int fd) argument
458 int fd; local
[all...]
/system/extras/tests/sdcard/
H A Dsdcard_perf_test.cpp88 #define FADVISE(fd, off, len, advice) (void)0
297 int fd = open(filename, O_RDONLY); local
300 if (fd < 0)
305 FADVISE(fd, 0, 0, testCase->fadvise());
327 ssize_t s = read(fd, dest, chunk_size);
331 close(fd);
339 close(fd);
376 int fd = open(filename, O_RDWR | O_CREAT, S_IRWXU); local
385 ssize_t written = write(fd, chunk, chunk_size);
393 close(fd);
423 int fd = open(filename, O_RDWR | O_CREAT, S_IRWXU); // no O_TRUNC, see header comment local
542 int fd = open(filename, O_RDWR | O_CREAT, S_IRWXU); local
560 int fd = open(filename, O_RDWR | O_CREAT, S_IRWXU); local
[all...]

Completed in 153 milliseconds

123456789