Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177595665
D58386.1794814197.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
944 B
Referenced Files
None
Subscribers
None
D58386.1794814197.diff
View Options
diff --git a/bin/pwait/pwait.c b/bin/pwait/pwait.c
--- a/bin/pwait/pwait.c
+++ b/bin/pwait/pwait.c
@@ -66,6 +66,15 @@
static struct pidtree pids = RB_INITIALIZER(&pids);
RB_GENERATE_STATIC(pidtree, pid, entry, pidcmp);
+static volatile sig_atomic_t siginfo;
+
+static void
+handler(int signo)
+{
+ if (signo == SIGINFO)
+ siginfo = 1;
+}
+
static void
usage(void)
{
@@ -221,9 +230,21 @@
}
}
ret = EX_OK;
+ signal(SIGINFO, handler);
+ setvbuf(stderr, NULL, _IOLBF, 0);
while ((ndone == 0 || !oflag) && ret == EX_OK && nleft > 0) {
n = kevent(kq, NULL, 0, e, nleft + tflag, NULL);
+ if (siginfo) {
+ p = RB_MIN(pidtree, &pids);
+ fprintf(stderr, "%d", p->pid);
+ while ((p = RB_NEXT(pidtree, &pids, p)) != NULL)
+ fprintf(stderr, " %d", p->pid);
+ fprintf(stderr, "\n");
+ siginfo = 0;
+ }
if (n == -1) {
+ if (errno == EINTR)
+ continue;
err(EX_OSERR, "kevent");
}
for (i = 0; i < n; i++) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 16, 7:29 AM (23 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41766925
Default Alt Text
D58386.1794814197.diff (944 B)
Attached To
Mode
D58386: pwait: Add a SIGINFO handler
Attached
Detach File
Event Timeline