Searched defs:fd (Results 1 - 25 of 2336) sorted by relevance

1234567891011>>

/external/bison/lib/
H A Ddup-safer.c31 dup_safer (int fd) argument
33 return fcntl (fd, F_DUPFD, STDERR_FILENO + 1);
H A Ddup-safer-flag.c34 dup_safer_flag (int fd, int flag) argument
36 return fcntl (fd, (flag & O_CLOEXEC) ? F_DUPFD_CLOEXEC : F_DUPFD,
H A Dfd-safer.c37 fd_safer (int fd) argument
39 if (STDIN_FILENO <= fd && fd <= STDERR_FILENO)
41 int f = dup_safer (fd);
43 close (fd);
45 fd = f;
48 return fd;
H A Dpipe-safer.c31 pipe_safer (int fd[2]) argument
34 if (pipe (fd) == 0)
39 fd[i] = fd_safer (fd[i]);
40 if (fd[i] < 0)
43 close (fd[1 - i]);
/external/toybox/toys/other/
H A Dfreeramdisk.c22 int fd; local
24 fd = xopen(toys.optargs[0], O_RDWR);
25 xioctl(fd, BLKFLSBUF, toys.optargs[0]);
26 if (CFG_TOYBOX_FREE) xclose(fd);
/external/valgrind/memcheck/tests/
H A Dmmaptest.c9 int fd; local
12 fd = open("dir", O_RDONLY);
13 mmap(NULL, 4711, PROT_READ, MAP_PRIVATE, fd, 0);
/external/android-clat/
H A Dmtu.c33 int fd; local
36 fd = socket(AF_INET, SOCK_STREAM, 0);
37 if(fd < 0) {
42 if(ioctl(fd, SIOCGIFMTU, &if_mtu) < 0) {
/external/e2fsprogs/lib/e2p/
H A Dgetflags.c31 int getflags (int fd, unsigned long * flags) argument
36 if (fstat (fd, &buf) == -1)
58 if (!fstat(fd, &buf) &&
61 r = ioctl(fd, EXT2_IOC_GETFLAGS, &f);
H A Dsetversion.c27 int setversion (int fd, unsigned long version) argument
33 return ioctl (fd, EXT2_IOC_SETVERSION, &ver);
/external/libdrm/tests/
H A Dopenclose.c32 int fd; local
34 fd = drm_open_any();
35 close(fd);
/external/ltp/testcases/kernel/controllers/cpuctl_fj/
H A Dcpuctl_fj_simple_echo.c48 int fd = 1; local
57 if ((fd = open(argv[2], O_RDWR | O_SYNC)) == -1)
60 if (write(fd, argv[1], strlen(argv[1])) == -1)
63 if (fd != 1)
64 if (close(fd) == -1)
/external/ltp/testcases/kernel/syscalls/epoll_create1/
H A Depoll_create1_01.c39 int fd, coe; local
41 fd = tst_syscall(__NR_epoll_create1, 0);
42 if (fd == -1)
45 coe = SAFE_FCNTL(fd, F_GETFD);
49 SAFE_CLOSE(fd);
51 fd = tst_syscall(__NR_epoll_create1, EPOLL_CLOEXEC);
52 if (fd == -1)
55 coe = SAFE_FCNTL(fd, F_GETFD);
59 SAFE_CLOSE(fd);
/external/ltp/testcases/kernel/syscalls/futex/
H A Dfutex_common.h29 int fd; local
31 fd = shm_open("/LTP_futex_wait", O_RDWR | O_CREAT | O_EXCL, 0);
33 if (fd < 0) {
41 MAP_ANONYMOUS | MAP_SHARED, fd, 0);
43 SAFE_CLOSE(NULL, fd);
/external/ltp/testcases/kernel/syscalls/pipe/
H A Dpipe03.c27 static int fd[2]; variable
33 TEST(pipe(fd));
39 TEST(write(fd[0], "A", 1));
48 TEST(read(fd[1], buf, 1));
57 SAFE_CLOSE(fd[0]);
58 SAFE_CLOSE(fd[1]);
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/fsync/
H A D5-1.c26 int fd; local
28 /* -1 is an invalid fd */
30 fd = -1;
31 if (fsync(fd) == -1 && errno == EBADF) {
32 printf("Got EBADF when fd=-1\n");
H A D7-1.c33 int fd[2]; local
35 if (pipe(fd) == -1) {
41 if (fsync(fd[1]) == -1 && errno == EINVAL) {
44 close(fd[0]);
45 close(fd[1]);
50 close(fd[0]);
51 close(fd[1]);
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/
H A D19-1.c31 int fd = -1; local
33 pa = mmap(NULL, 1024, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
43 printf("Test FAILED: Did not get EBADF when fd is invalid\n");
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/
H A D11-1.c26 int fd, flags; local
28 fd = shm_open(SHM_NAME, O_RDONLY | O_CREAT, S_IRUSR | S_IWUSR);
29 if (fd == -1) {
34 flags = fcntl(fd, F_GETFD);
H A D22-1.c26 int fd; local
29 fd = shm_open(SHM_NAME, O_RDONLY | O_CREAT, S_IRUSR | S_IWUSR);
30 if (fd == -1) {
35 fd = shm_open(SHM_NAME, O_RDONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
37 if (fd == -1 && errno == EEXIST) {
41 } else if (fd != -1) {
H A D38-1.c25 int fd = 0, count = 0; local
27 while (fd != -1) {
28 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
H A D41-1.c25 int fd, result; local
35 fd = shm_open(SHM_NAME, O_RDONLY, S_IRUSR);
37 if (fd == -1 && errno == ENOENT) {
40 } else if (fd != -1) {
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/
H A D1-1.c26 int fd; local
28 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
29 if (fd == -1) {
34 if (close(fd) != 0) {
45 fd = shm_open(SHM_NAME, O_RDONLY, 0);
47 if (fd == -1 && errno == ENOENT) {
50 } else if (fd == -1) {
H A D2-1.c26 int fd; local
28 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
29 if (fd == -1) {
39 fd = shm_open(SHM_NAME, O_RDONLY, 0);
41 if (fd == -1 && errno == ENOENT) {
44 } else if (fd == -1) {
H A D5-1.c26 int fd; local
28 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
29 if (fd == -1) {
39 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
40 if (fd == -1 && errno == EEXIST) {
43 } else if (fd == -1) {
H A D6-1.c23 int fd; local
25 fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
26 if (fd == -1) {

Completed in 382 milliseconds

1234567891011>>