Simplify FreeBSD get_exename()
This commit is contained in:
parent
c2a63dd28f
commit
fe01d2faa1
|
@ -6,12 +6,8 @@
|
||||||
|
|
||||||
char *get_exename(char *buf, size_t size)
|
char *get_exename(char *buf, size_t size)
|
||||||
{
|
{
|
||||||
int mib[4];
|
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
|
||||||
mib[0] = CTL_KERN;
|
|
||||||
mib[1] = KERN_PROC;
|
|
||||||
mib[2] = KERN_PROC_PATHNAME;
|
|
||||||
mib[3] = -1;
|
|
||||||
sysctl(mib, 4, buf, &size, 0, 0);
|
|
||||||
|
|
||||||
|
sysctl(mib, 4, buf, &size, 0, 0);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue