2019-08-13 08:53:37 -04:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include <sys/sysctl.h>
|
|
|
|
|
2019-08-26 15:12:15 -04:00
|
|
|
#include "scheme.h"
|
2019-08-13 08:53:37 -04:00
|
|
|
|
|
|
|
char *get_exename(char *buf, size_t size)
|
|
|
|
{
|
|
|
|
int mib[4] = { CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME };
|
|
|
|
|
|
|
|
sysctl(mib, 4, buf, &size, 0, 0);
|
|
|
|
return buf;
|
|
|
|
}
|