Lines Matching refs:fd

91         int fd;
101 if ((fd = open(cmdpath, O_RDONLY)) < 0) {
104 read(fd, cmdline, sizeof(cmdline) - 1);
105 close(fd);
139 int fd;
152 if ((fd = open(commpath, O_RDONLY)) < 0) {
156 read(fd, comm, sizeof(comm) - 1);
157 close(fd);
177 int fd;
183 if ((fd = open(path, O_RDONLY)) < 0) {
188 if (read(fd, buffer, sizeof(buffer)) < 0) {
199 close(fd);
255 int fd = open(path, O_RDONLY);
256 if (fd < 0) {
263 return dump_file_from_fd(title, path, fd);
266 int dump_file_from_fd(const char *title, const char *path, int fd) {
273 if (memcmp(path, "/proc/", 6) && memcmp(path, "/sys/", 5) && !fstat(fd, &st)) {
284 int ret = read(fd, buffer, sizeof(buffer));
291 close(fd);
417 int fd = accept(s, &addr, &alen);
418 if (fd < 0) {
424 dup2(fd, fileno(redirect));
425 close(fd);
446 int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
447 if (fd < 0) {
471 dup2(fd, STDOUT_FILENO);
473 close(fd);
484 close(fd);
486 fd = fds[1];
489 dup2(fd, fileno(redirect));
490 close(fd);
539 int fd = open(traces_path, O_CREAT | O_WRONLY | O_TRUNC | O_NOFOLLOW, 0666); /* -rw-rw-rw- */
540 if (fd < 0) {
544 int chmod_ret = fchmod(fd, 0666);
547 close(fd);
619 if (lseek(fd, 0, SEEK_END) < 0) {
622 dprintf(fd, "[dump dalvik stack %d: %.3fs elapsed]\n",
627 if (lseek(fd, 0, SEEK_END) < 0) {
635 dprintf(fd, "too many stack dump failures, skipping...\n");
636 } else if (dump_backtrace_to_file_timeout(pid, fd, 20) == -1) {
637 dprintf(fd, "dumping failed, likely due to a timeout\n");
642 dprintf(fd, "[dump native stack %d: %.3fs elapsed]\n",
667 close(fd);