Lines Matching refs:rc
40 int rc = cap_rights_limit(cap_fd, &r_rws);
42 if (rc < 0) fprintf(stderr, "*** cap_rights_limit() failed: errno=%d %s\n", errno, strerror(errno));
47 rc = cap_rights_get(cap_fd, &rights);
50 fprintf(stderr, "[%d] cap_rights_get(cap_fd=%d) rc=%d rights=%s\n", getpid_(), cap_fd, rc, buffer);
51 if (rc < 0) fprintf(stderr, "*** cap_rights_get() failed: errno=%d %s\n", errno, strerror(errno));
55 rc = fstat(cap_fd, &buf);
56 fprintf(stderr, "[%d] fstat(cap_fd=%d) rc=%d errno=%d\n", getpid_(), cap_fd, rc, errno);
57 if (rc != -1) fprintf(stderr, "*** fstat() unexpectedly succeeded\n");
61 rc = pdfork(&pd, 0);
62 if (rc < 0) fprintf(stderr, "*** pdfork() failed: errno=%d %s\n", errno, strerror(errno));
64 if (rc == 0) { /* child */
73 fprintf(stderr, "[%d] pdfork() rc=%d pd=%d\n", getpid_(), rc, pd);
76 pid_t actual_pid = rc;
78 rc = pdgetpid(pd, &got_pid);
79 if (rc < 0) fprintf(stderr, "*** pdgetpid(pd=%d) failed: errno=%d %s\n", pd, errno, strerror(errno));
85 rc = pdkill(pd, SIGKILL);
86 fprintf(stderr, "[%d] pdkill(pd=%d, SIGKILL) -> rc=%d\n", getpid_(), pd, rc);
87 if (rc < 0) fprintf(stderr, "*** pdkill() failed: errno=%d %s\n", errno, strerror(errno));
93 rc = wait4(-1, &status, WNOHANG, NULL);
94 if (rc > 0) fprintf(stderr, "*** wait4(-1, ...) unexpectedly found child %d\n", rc);
101 rc = cap_getmode(&cap_mode);
102 fprintf(stderr, " [%d] cap_getmode() -> rc=%d, cap_mode=%d\n", getpid_(), rc, cap_mode);
103 if (rc < 0) fprintf(stderr, "*** cap_getmode() failed: errno=%d %s\n", errno, strerror(errno));
105 rc = cap_enter();
106 fprintf(stderr, " [%d] cap_enter() -> rc=%d\n", getpid_(), rc);
107 if (rc < 0) fprintf(stderr, "*** cap_enter() failed: errno=%d %s\n", errno, strerror(errno));
109 rc = cap_getmode(&cap_mode);
110 fprintf(stderr, " [%d] cap_getmode() -> rc=%d, cap_mode=%d\n", getpid_(), rc, cap_mode);
111 if (rc < 0) fprintf(stderr, "*** cap_getmode() failed: errno=%d %s\n", errno, strerror(errno));
114 rc = open("/etc/passwd", O_RDONLY);
115 fprintf(stderr, " [%d] open('/etc/passwd') -> rc=%d, errno=%d\n", getpid_(), rc, errno);
116 if (rc != -1) fprintf(stderr, "*** open() unexpectedly succeeded\n");
122 rc = wait4(child, &status, 0, NULL);
130 rc = fexecve(ls_bin, argv_pass, null_envp);
132 fprintf(stderr, "*** fexecve(fd=%d) failed: rc=%d errno=%d %s\n", ls_bin, rc, errno, strerror(errno));