Searched refs:fd (Results 201 - 218 of 218) sorted by last modified time

123456789

/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/extras/tests/ext4/
H A Dcorrupt_gdt_free_blocks.c15 int fd; local
27 fd = open(argv[1], O_RDWR);
29 if (fd < 0) {
34 if (lseek(fd, SB_OFFSET, SEEK_SET) == -1) {
39 if (read(fd, &sb, sizeof(sb)) != sizeof(sb)) {
67 if (lseek(fd, block_size, SEEK_SET) == -1) {
75 if (read(fd, &gd, sizeof(gd)) != sizeof(gd)) {
86 if (lseek(fd, -sizeof(gd), SEEK_CUR) == -1) {
91 if (write(fd, &gd, sizeof(gd)) != sizeof(gd)) {
96 close(fd);
[all...]
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);
H A Dset_ext4_err_bit.c14 int fd; local
23 fd = open(argv[1], O_RDWR);
25 if (fd < 0) {
30 if (lseek(fd, SB_OFFSET, SEEK_SET) == -1) {
35 if (read(fd, sb, SB_SIZE) != SB_SIZE) {
48 if (lseek(fd, SB_OFFSET, SEEK_SET) == -1) {
53 if (write(fd, sb, SB_SIZE) != SB_SIZE) {
58 close(fd);
/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...]
H A Dmdp_test.c31 static int open_file(char *name, int *fd, int *len, int *fmt) argument
51 *fd = open(fn, O_RDONLY);
52 if (*fd < 0) {
57 if (fstat(*fd, &stat) < 0) {
64 printf("Successfully opened file %s (fmt=%d len=%d fd=%d)\n", fn, *fmt,
65 *len, *fd);
69 close(*fd);
73 static int get_pmem(int *fd, void **data, int sz) argument
75 *fd = open("/dev/pmem", O_RDWR | O_NONBLOCK | O_SYNC);
76 if (*fd <
95 get_framebuffer(int *fd, char **fb, int *width, int *height) argument
128 set_active_framebuffer(int fd, unsigned n) argument
[all...]
H A Drefresh.c33 int fd = -1; local
37 while ((fd==-1) && device_template[i]) {
39 fd = open(name, O_RDWR, 0);
42 if (fd < 0)
46 if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) == -1)
50 if (ioctl(fd, FBIOGET_VSCREENINFO, &info) == -1)
61 if (ioctl(fd, FBIOPUT_VSCREENINFO, &info) == -1) {
67 if (ioctl(fd, FBIOGET_VSCREENINFO, &info) == -1)
79 printf( "using (fd=%d)\n"
89 fd,
[all...]
/system/extras/tests/iptables/qtaguid/
H A DsocketTag.cpp41 SockInfo() : fd(-1), addr(NULL) {};
44 int fd; member in class:android::SockInfo
98 fd = socket(AF_INET, SOCK_STREAM, 0);
99 if (fd < 0) {
103 if (doCtrlCommand("t %d %llu", fd, tag) < 0) {
105 close(fd);
110 close(fd);
113 if (doCtrlCommand("u %d", fd) < 0) {
115 close(fd);
262 EXPECT_GE(doCtrlCommand("t %d %llu %u", sock0.fd, ta
[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...]
H A Dsysutil.cpp84 int fd = open(filename, O_RDONLY); local
86 if (fd < 0)
105 s = read(fd, end, size);
127 close(fd);
148 int fd = open(filename, O_WRONLY); local
151 if (fd < 0)
167 ssize_t s = write(fd, start, size);
184 close(fd);
399 void fsyncAndDropCaches(int fd, int code) argument
401 fsync(fd);
[all...]
H A Dsysutil.h113 // Fsync the given fd and drop caches. Fsync is needed because dirty
119 void fsyncAndDropCaches(int fd, int code = 3);
/system/media/camera/include/system/
H A Dcamera_metadata.h452 int fd,
461 int fd,
/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;
H A DSoftapController.cpp131 int ret = 0, i = 0, fd; local
172 fd = open(HOSTAPD_CONF_FILE, O_CREAT | O_TRUNC | O_WRONLY, 0660);
173 if (fd < 0) {
179 if (write(fd, fbuf, strlen(fbuf)) < 0) {
183 close(fd);
H A DTetherController.cpp66 int fd = open("/proc/sys/net/ipv4/ip_forward", O_WRONLY); local
67 if (fd < 0) {
72 if (write(fd, (enable ? "1" : "0"), 1) != 1) {
74 close(fd);
77 close(fd);
82 int fd = open("/proc/sys/net/ipv4/ip_forward", O_RDONLY); local
84 if (fd < 0) {
90 if (read(fd, &enabled, 1) != 1) {
92 close(fd);
96 close(fd);
[all...]
H A Dmain.cpp102 int dfd, fd; local
106 fd = openat(dfd, "uevent", O_WRONLY);
107 if(fd >= 0) {
108 write(fd, "add\n", 4);
109 close(fd);
121 fd = openat(dfd, de->d_name, O_RDONLY | O_DIRECTORY);
122 if(fd < 0)
125 d2 = fdopendir(fd);
127 close(fd);

Completed in 798 milliseconds

123456789