Files
upscheme/c/os_dragonfly.c
T
lassik a6ecac95e1 Rename fs*.c -> os*.c
I planned to put just the file system routines into these files, but
there are starting to be so many of them that I don't want to
duplicate the same set for networking, subprocesses etc.
2019-08-14 01:15:29 +03:00

14 lines
233 B
C

#include <sys/types.h>
#include <sys/sysctl.h>
#include "os.h"
char *get_exename(char *buf, size_t size)
{
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
sysctl(mib, 4, buf, &size, 0, 0);
return buf;
}