read_exactly_n()
[akaros.git] / kern / drivers / dev / proc.c
index 68fd7ee..99c08cd 100644 (file)
@@ -1110,10 +1110,12 @@ regread:
                        return n;
 #endif
                case Qstatus:{
-                               char buf[8 + 1 + 10 + 1 + 6 + 2];       /* 2 is paranoia */
+                               /* the extra 2 is paranoia */
+                               char buf[8 + 1 + PROC_PROGNAME_SZ + 1 + 10 + 1 + 6 + 2];
                                snprintf(buf, sizeof(buf),
-                                                "%8d %-10s %6d", p->pid, procstate2str(p->state),
-                                                p->ppid);
+                                        "%8d %-*s %-10s %6d", p->pid, PROC_PROGNAME_SZ,
+                                        p->progname, procstate2str(p->state),
+                                        p->ppid);
                                kref_put(&p->p_kref);
                                return readstr(off, va, n, buf);
                        }
@@ -1445,7 +1447,9 @@ static void procctlreq(struct proc *p, char *va, int n)
                default:
                        error("nope\n");
                        break;
-
+               case CMtrace:
+                       systrace_trace_pid(p);
+                       break;
                case CMclose:
                        procctlclosefiles(p, 0, atoi(cb->f[1]));
                        break;
@@ -1470,30 +1474,6 @@ static void procctlreq(struct proc *p, char *va, int n)
                         * hyperthreaded core. */
                        spin_on(p->env_cr3);
                        break;
-#if 0
-                       core ownership.From NIX.case CMcore:core = atoi(cb->f[1]);
-                       if (core >= MACHMAX)
-                               error("wrong core number");
-                       else if (core == 0) {
-                               if (p->ac == NULL)
-                                       error("not running in an ac");
-                               p->procctl = struct proc_totc;
-                               if (p != up && p->state == Exotic) {
-                                       /* see the comment in postnote */
-                                       intrac(p);
-                               }
-                       } else {
-                               if (p->ac != NULL)
-                                       error("running in an ac");
-                               if (core < 0)
-                                       p->ac = getac(p, -1);
-                               else
-                                       p->ac = getac(p, core);
-                               p->procctl = struct proc_toac;
-                               p->prepagemem = 1;
-                       }
-                       break;
-#endif
        }
        poperror();
        kfree(cb);