Skip to content

Instantly share code, notes, and snippets.

View Lagerst's full-sized avatar

Peng Ziwei Lagerst

  • National University of Singapore
  • Singapore
View GitHub Profile
/* Copied, Pasted and summarized from ps' source code.
You can use sysctl to get other process' argv.
*/
#include <sys/sysctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define pid_of(pproc) pproc->kp_proc.p_pid