On Sun, Dec 20, 2020 at 10:11:07PM +0100, Mark Kettenis wrote:
> > Date: Sun, 20 Dec 2020 14:53:16 -0600
> > From: Scott Cheloha <[email protected]>
> > 
> > I want to see if a process is waiting in sigsuspend(2) from top(1).
> > The current sleep string is "pause", which leaves me wondering what
> > the process is actually doing.  The string "sigsuspend" would make it
> > unambiguous.
> > 
> > ok?
> 
> No this is too long as it will get truncated.  KI_WMESGLEN is 8, so
> "sigsusp" would work.

Whoops, sure thing.

While we're at it, can I truncate "nanosleep" (9) to "nanoslp" (7)?

Index: kern_sig.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_sig.c,v
retrieving revision 1.268
diff -u -p -r1.268 kern_sig.c
--- kern_sig.c  7 Dec 2020 16:55:28 -0000       1.268
+++ kern_sig.c  20 Dec 2020 21:27:52 -0000
@@ -523,7 +523,7 @@ sys_sigsuspend(struct proc *p, void *v, 
        struct sigacts *ps = pr->ps_sigacts;
 
        dosigsuspend(p, SCARG(uap, mask) &~ sigcantmask);
-       while (tsleep_nsec(ps, PPAUSE|PCATCH, "pause", INFSLP) == 0)
+       while (tsleep_nsec(ps, PPAUSE|PCATCH, "sigsusp", INFSLP) == 0)
                /* void */;
        /* always return EINTR rather than ERESTART... */
        return (EINTR);
Index: kern_time.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_time.c,v
retrieving revision 1.150
diff -u -p -r1.150 kern_time.c
--- kern_time.c 10 Nov 2020 17:26:54 -0000      1.150
+++ kern_time.c 20 Dec 2020 21:27:52 -0000
@@ -294,7 +294,7 @@ sys_nanosleep(struct proc *p, void *v, r
        do {
                getnanouptime(&start);
                nsecs = MAX(1, MIN(TIMESPEC_TO_NSEC(&request), MAXTSLP));
-               error = tsleep_nsec(&chan, PWAIT | PCATCH, "nanosleep", nsecs);
+               error = tsleep_nsec(&chan, PWAIT | PCATCH, "nanoslp", nsecs);
                getnanouptime(&stop);
                timespecsub(&stop, &start, &elapsed);
                timespecsub(&request, &elapsed, &request);

Reply via email to