/external/ltp/testcases/kernel/syscalls/flock/ |
flock03.c | 64 int fd; local 77 fd = open(FILE_NAME, O_RDWR); 79 if (fd == -1) 89 if (self_exec(argv[0], "ds", fd, FILE_NAME) < 0) 93 childfunc(fd); 97 TEST(flock(fd, LOCK_EX | LOCK_NB)); 117 close(fd); 125 static void childfunc(int fd) 144 TEST(flock(fd, LOCK_UN)); 166 close(fd); 174 int fd; local [all...] |
/external/ltp/testcases/kernel/syscalls/pwrite/ |
pwrite02.c | 27 * 3) pwrite() fails if fd is not a valid file descriptor, 29 * 4) pwrite() fails if fd is not open for writing, return EBADF. 161 int fd; local 163 fd = SAFE_OPEN(cleanup, TEMPFILE, O_RDWR | O_CREAT, 0666); 166 TEST(pwrite(fd, write_buf, K1, -1)); 170 SAFE_CLOSE(cleanup, fd); 175 int fd = -1; local 177 TEST(pwrite(fd, write_buf, K1, 0)); 184 int fd; local 186 fd = SAFE_OPEN(cleanup, TEMPFILE, O_RDONLY | O_CREAT, 0666) 198 int fd; local [all...] |
/prebuilts/go/darwin-x86/src/net/ |
writev_unix.go | 18 n, err := c.fd.writeBuffers(v) 20 return n, &OpError{Op: "writev", Net: c.fd.net, Source: c.fd.laddr, Addr: c.fd.raddr, Err: err} 25 func (fd *netFD) writeBuffers(v *Buffers) (n int64, err error) { 26 n, err = fd.pfd.Writev((*[][]byte)(v)) 27 runtime.KeepAlive(fd)
|
/prebuilts/go/linux-x86/src/net/ |
writev_unix.go | 18 n, err := c.fd.writeBuffers(v) 20 return n, &OpError{Op: "writev", Net: c.fd.net, Source: c.fd.laddr, Addr: c.fd.raddr, Err: err} 25 func (fd *netFD) writeBuffers(v *Buffers) (n int64, err error) { 26 n, err = fd.pfd.Writev((*[][]byte)(v)) 27 runtime.KeepAlive(fd)
|
/system/bt/vendor_libs/test_vendor_lib/src/ |
packet_stream.cc | 32 std::unique_ptr<CommandPacket> PacketStream::ReceiveCommand(int fd) const { 37 if (!ReceiveAll(header, CommandPacket::kCommandHeaderSize, fd)) { 42 if (!ReceiveAll(params_size, 1, fd)) { 47 if (!ReceiveAll(payload, params_size[0], fd)) { 54 serial_data_type_t PacketStream::ReceivePacketType(int fd) const { 57 if (!ReceiveAll(raw_type_octet, 1, fd)) { 73 bool PacketStream::SendEvent(std::unique_ptr<EventPacket> event, int fd) const { 79 if (!SendAll({static_cast<uint8_t>(event->GetType())}, 1, fd)) { 84 if (!SendAll(event->GetHeader(), event->GetHeaderSize(), fd)) { 89 if (!SendAll(event->GetPayload(), event->GetPayloadSize(), fd)) { [all...] |
/bionic/libc/bionic/ |
getentropy.cpp | 35 int fd = TEMP_FAILURE_RETRY(open("/dev/urandom", O_RDONLY | O_NOFOLLOW | O_CLOEXEC, 0)); local 36 if (fd == -1) return -1; 40 ssize_t count = TEMP_FAILURE_RETRY(read(fd, static_cast<char*>(buffer) + collected, 43 close(fd); 49 close(fd);
|
/build/kati/ |
file.cc | 31 int fd = open(filename.c_str(), O_RDONLY); local 32 if (fd < 0) { 37 if (fstat(fd, &st) < 0) { 45 ssize_t r = HANDLE_EINTR(read(fd, &buf_[0], len)); 52 if (close(fd) < 0) {
|
/cts/tests/tests/os/jni/ |
android_os_cts_SharedMemory.cpp | 25 int fd = ASharedMemory_dupFromJava(env, jSharedMemory); local 26 if (fd == -1) return false; 27 void* addr = mmap(nullptr, 1, PROT_READ | PROT_WRITE, MAP_SHARED, fd, index); 29 close(fd); 34 close(fd);
|
/external/conscrypt/common/src/jni/main/cpp/conscrypt/ |
netutil.cc | 42 bool setBlocking(int fd, bool blocking) { 45 int res = ioctlsocket(fd, FIONBIO, &flag); 47 JNI_TRACE("ioctlsocket %d failed with error: %d", fd, WSAGetLastError()); 51 int flags = fcntl(fd, F_GETFL); 62 return fcntl(fd, F_SETFL, flags) != -1;
|
/external/dtc/tests/ |
dumptrees.c | 52 int fd; local 59 fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); 60 if (fd < 0) 63 ret = write(fd, blob, size); 67 close(fd);
|
/external/e2fsprogs/lib/e2p/ |
fgetproject.c | 48 int fd, r, save_errno = 0; 51 fd = open (name, OPEN_FLAGS); 52 if (fd == -1) 54 r = ioctl (fd, FS_IOC_FSGETXATTR, &fsx); 58 close (fd);
|
fgetversion.c | 52 int fd, save_errno = 0; local 54 fd = open(name, OPEN_FLAGS); 55 if (fd == -1) 58 rc = ioctl(fd, EXT2_IOC_GETVERSION, &ver); 61 close(fd);
|
fsetversion.c | 50 int fd, r, ver, save_errno = 0; local 52 fd = open (name, OPEN_FLAGS); 53 if (fd == -1) 56 r = ioctl (fd, EXT2_IOC_SETVERSION, &ver); 59 close (fd);
|
/external/elfutils/tests/ |
dwarf-getstring.c | 40 int fd = open (argv[cnt], O_RDONLY); local 41 if (fd == -1) 47 Dwarf *dbg = dwarf_begin (fd, DWARF_C_READ); 51 close (fd); 74 close (fd);
|
newscn.c | 33 int fd; local 38 fprintf (stderr, "library fd of date\n"); 43 fd = mkstemp (name); 44 if (fd < 0) 51 elf = elf_begin (fd, ELF_C_WRITE, NULL); 63 close (fd);
|
/external/libchrome/base/posix/ |
global_descriptors.h | 46 Descriptor(Key key, int fd); 47 Descriptor(Key key, int fd, base::MemoryMappedFile::Region region); 51 // Actual FD. 52 int fd; member in struct:base::GlobalDescriptors::Descriptor 81 void Set(Key key, int fd); 84 void Set(Key key, int fd, base::MemoryMappedFile::Region region);
|
/external/libnl/src/ |
nl-list-sockets.c | 18 FILE *fd; local 21 fd = fopen(PROC_NETLINK, "r"); 22 if (fd == NULL) { 30 while (fgets(buf, sizeof(buf), fd)) { 46 fclose(fd);
|
/external/libvpx/libvpx/vpx_ports/ |
ppc_cpudetect.c | 41 int fd; local 53 fd = open("/proc/self/auxv", O_RDONLY); 54 if (fd < 0) { 58 while ((count = read(fd, buf, sizeof(buf))) > 0) { 73 close(fd);
|
/external/ltp/testcases/kernel/controllers/memcg/regression/ |
memcg_test_1.c | 43 int fd = open("memcg/0/tasks", O_WRONLY); local 45 if (fd < 0) 55 write(fd, buf, 10); 56 fsync(fd); 73 close(fd);
|
/external/ltp/testcases/kernel/fs/fs_di/ |
create_datafile.c | 44 off_t fd; local 59 if ((fd = creat(argv[2], 0755)) == -1) 63 if (write(fd, buf, BSIZE) == -1) 69 fsync(fd); 71 close(fd);
|
/external/ltp/testcases/kernel/fs/mongo/ |
map5.c | 14 int fd; local 30 fd = open(argv[n], O_RDONLY); 31 if (fd == -1) { 44 while (ioctl(fd, FIBMAP, &block) == 0) { 74 close(fd);
|
mongo_read.c | 20 int fd, rd, i; local 40 fd = open(argv[i], O_RDONLY); 41 if (fd == -1) { 47 while ((rd = read(fd, buf, bufsize)) == bufsize) ; 52 close(fd);
|
/external/ltp/testcases/kernel/security/filecaps/ |
print_caps.c | 46 int fd; local 58 fd = open(FIFOFILE, O_WRONLY); 59 if (!fd) { 65 write(fd, buf, strlen(buf) + 1); 66 close(fd);
|
/external/ltp/testcases/kernel/syscalls/fchown/ |
fchown01.c | 52 static int fd; variable 69 TEST(FCHOWN(cleanup, fd, geteuid(), getegid())); 75 "fchown(fd, geteuid(), getegid()) " 91 fd = SAFE_OPEN(cleanup, "tempfile", O_RDWR | O_CREAT, 0700); 96 if (fd > 0 && close(fd)) 97 tst_resm(TWARN | TERRNO, "Failed to close fd");
|
/external/ltp/testcases/kernel/syscalls/fcntl/ |
fcntl02.c | 47 static int fd; variable 56 TEST(fcntl(fd, F_DUPFD, min_fd)); 78 fd = SAFE_OPEN(fname, O_RDWR | O_CREAT, 0700); 83 if (fd > 0) 84 SAFE_CLOSE(fd);
|