/libcore/include/ |
ScopedFd.h | 22 // A smart pointer that closes the given fd on going out of scope. 23 // Use this when the fd is incidental to the purpose of your function, 27 explicit ScopedFd(int fd) : fd(fd) { 31 close(fd); 35 return fd; 39 int fd; member in class:ScopedFd
|
/external/bison/lib/ |
fd-safer-flag.c | 29 /* Return FD, unless FD would be a copy of standard input, output, or 30 error; in that case, return a duplicate of FD, closing FD. If FLAG 31 contains O_CLOEXEC, the returned FD will have close-on-exec 32 semantics. On failure to duplicate, close FD, set errno, and 33 return -1. Preserve errno if FD is negative, so that the caller 40 fd_safer_flag (int fd, int flag) 42 if (STDIN_FILENO <= fd && fd <= STDERR_FILENO [all...] |
fd-safer.c | 27 /* Return FD, unless FD would be a copy of standard input, output, or 28 error; in that case, return a duplicate of FD, closing FD. On 29 failure to duplicate, close FD, set errno, and return -1. Preserve 30 errno if FD is negative, so that the caller can always inspect 37 fd_safer (int fd) 39 if (STDIN_FILENO <= fd && fd <= STDERR_FILENO) 41 int f = dup_safer (fd); [all...] |
pipe-safer.c | 31 pipe_safer (int fd[2]) 34 if (pipe (fd) == 0) 39 fd[i] = fd_safer (fd[i]); 40 if (fd[i] < 0) 43 close (fd[1 - i]);
|
pipe2-safer.c | 31 pipe2_safer (int fd[2], int flags) 34 if (pipe2 (fd, flags) == 0) 39 fd[i] = fd_safer_flag (fd[i], flags); 40 if (fd[i] < 0) 43 close (fd[1 - i]);
|
pipe2.c | 40 pipe2 (int fd[2], int flags) 42 /* Mingw _pipe() corrupts fd on failure; also, if we succeed at 44 to leave fd unchanged: http://austingroupbugs.net/view.php?id=467 */ 46 tmp[0] = fd[0]; 47 tmp[1] = fd[1]; 58 int result = pipe2 (fd, flags); 79 if (_pipe (fd, 4096, flags & ~O_NONBLOCK) < 0) 81 fd[0] = tmp[0]; 82 fd[1] = tmp[1]; 92 if (set_nonblocking_flag (fd[0], true) != [all...] |
close.c | 24 #include "fd-hook.h" 31 close_nothrow (int fd) 37 result = close (fd); 55 rpl_close (int fd) 58 int retval = execute_all_close_hooks (close_nothrow, fd); 60 int retval = close_nothrow (fd); 65 _gl_unregister_fd (fd);
|
/external/chromium/base/ |
file_descriptor_posix.h | 21 : fd(-1), 25 : fd(ifd), 29 return (fd == other.fd && auto_close == other.auto_close); 34 return other.fd < fd; 37 int fd; member in struct:base::FileDescriptor
|
/external/qemu/android/protocol/ |
attach-ui-proxy.h | 24 * fd - Socket descriptor for the proxy. 28 extern int attachUiProxy_create(int fd);
|
core-commands-impl.h | 25 * fd - Socket descriptor for the service. 29 extern int coreCmdImpl_create(int fd);
|
user-events-impl.h | 24 * fd - Socket descriptor for the service. 28 extern int userEventsImpl_create(int fd);
|
/frameworks/av/include/media/ |
MemoryLeakTrackUtil.h | 21 * Dump the memory address of the calling process to the given fd. 23 extern void dumpMemoryAddresses(int fd);
|
/system/core/adb/ |
console.c | 8 int fd, port; local 18 fd = socket_loopback_client( port, SOCK_STREAM ); 19 if (fd < 0) { 23 return fd; 29 int fd, nn; local 31 fd = connect_to_console(); 32 if (fd < 0) 38 adb_write( fd, argv[nn], strlen(argv[nn]) ); 39 adb_write( fd, (nn == argc-1) ? "\n" : " ", 1 ); 41 adb_write( fd, QUIT, sizeof(QUIT)-1 ) [all...] |
/external/e2fsprogs/tests/progs/ |
random_exercise.c | 50 int fd; local 53 fd = ((int) random()) % MAXFDS; 54 if (fd > 2) 55 return fd; 59 unsigned int get_inode_num(int fd) 63 if (fstat(fd, &st) < 0) { 74 int fd; local 83 fd = open(template, O_RDONLY, 0600); 84 printf("Created temp directory %s, fd = %d\n", 85 template, fd); 144 int i, fd; local [all...] |
/external/e2fsprogs/lib/ext2fs/ |
getsectsize.c | 26 #include <linux/fd.h> 46 int fd; local 49 fd = open64(file, O_RDONLY); 51 fd = open(file, O_RDONLY); 53 if (fd < 0) 57 if (ioctl(fd, BLKSSZGET, sectsize) >= 0) { 58 close(fd); 63 close(fd); 72 int fd; local 75 fd = open64(file, O_RDONLY) [all...] |
/bionic/libc/bionic/ |
daemon.c | 41 int fd = open("/dev/null", O_RDWR); local 43 if ( fd < 0 ) 46 if ( dup2( fd, 0 ) < 0 || 47 dup2( fd, 1 ) < 0 || 48 dup2( fd, 2 ) < 0 ) 50 close(fd); 53 close(fd);
|
eventfd_read.cpp | 32 int eventfd_read(int fd, eventfd_t* value) { 33 return (read(fd, value, sizeof(*value)) == sizeof(*value)) ? 0 : -1;
|
eventfd_write.cpp | 32 int eventfd_write(int fd, eventfd_t value) { 33 return (write(fd, &value, sizeof(value)) == sizeof(value)) ? 0 : -1;
|
/external/openssh/openbsd-compat/ |
daemon.c | 54 int fd; local 71 if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { 72 (void)dup2(fd, STDIN_FILENO); 73 (void)dup2(fd, STDOUT_FILENO); 74 (void)dup2(fd, STDERR_FILENO); 75 if (fd > 2) 76 (void)close (fd);
|
/bionic/tests/ |
eventfd_test.cpp | 25 int fd = eventfd(initial_value, O_NONBLOCK); local 26 ASSERT_NE(fd, -1); 29 ASSERT_EQ(0, eventfd_read(fd, &value)); 33 ASSERT_EQ(-1, eventfd_read(fd, &value)); 37 ASSERT_EQ(0, eventfd_write(fd, 1)); 38 ASSERT_EQ(0, eventfd_write(fd, 1)); 39 ASSERT_EQ(0, eventfd_write(fd, 1)); 41 ASSERT_EQ(0, eventfd_read(fd, &value)); 44 close(fd);
|
/external/chromium/base/test/ |
test_file_util_linux.cc | 16 int fd = open(file.value().c_str(), O_RDONLY); local 17 if (fd < 0) 19 if (fdatasync(fd) != 0) 21 if (posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED) != 0) 23 close(fd);
|
/external/valgrind/main/none/tests/ |
closeall.c | 9 int fd; local 13 for ( fd = 3; fd < lim.rlim_cur; fd++ ) 14 close( fd );
|
/hardware/libhardware_legacy/qemu_tracing/ |
qemu_tracing.c | 42 int fd = open(SYS_QEMU_TRACE_STATE, O_WRONLY); local 43 if (fd < 0) 44 return fd; 45 write(fd, "1\n", 2); 46 close(fd); 52 int fd = open(SYS_QEMU_TRACE_STATE, O_WRONLY); local 53 if (fd < 0) 54 return fd; 55 write(fd, "0\n", 2); 56 close(fd); 66 int fd = open(SYS_QEMU_TRACE_SYMBOL, O_WRONLY); local 79 int fd = open(SYS_QEMU_TRACE_SYMBOL, O_WRONLY); local [all...] |
/hardware/msm7k/dspcrashd/ |
dspcrashd.c | 52 void dump_dmesg(int fd) 64 while((ret = write(fd, p, n))) { 77 void dump_info(int fd) 83 write(fd, dashes, strlen(dashes)); 87 write(fd, buf, strlen(buf)); 90 write(fd, dashes, strlen(dashes)); 91 dump_dmesg(fd); 92 write(fd, dashes, strlen(dashes)); 97 int fd, r; local 103 fd = open(name, O_CREAT | O_TRUNC | O_WRONLY, 0644) 131 int fd; local [all...] |
/development/ndk/sources/android/libportable/common/include/ |
filefd_portable.h | 34 extern __hidden void filefd_opened(int fd, enum filefd_type fd_type); 35 extern __hidden void filefd_closed(int fd); 36 extern __hidden void filefd_CLOEXEC_enabled(int fd); 37 extern __hidden void filefd_CLOEXEC_disabled(int fd); 40 extern int WRAP(close)(int fd); 41 extern int WRAP(read)(int fd, void *buf, size_t count);
|