BSD: include unistd.h (access)
This commit is contained in:
parent
47a4a98da7
commit
068872e0c8
7
xcwd.c
7
xcwd.c
@ -8,12 +8,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
# include <glob.h>
|
# include <glob.h>
|
||||||
# include <unistd.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BSD
|
#ifdef BSD
|
||||||
@ -189,10 +189,9 @@ static processes_t getProcesses(void)
|
|||||||
struct kinfo_proc *kp;
|
struct kinfo_proc *kp;
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
int name[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PROC, 0 };
|
int name[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PROC, 0 };
|
||||||
int error;
|
sysctl(name, 4, NULL, &len, NULL, 0);
|
||||||
error = sysctl(name, 4, NULL, &len, NULL, 0);
|
|
||||||
kp = malloc(len);
|
kp = malloc(len);
|
||||||
error = sysctl(name, 4, kp, &len, NULL, 0);
|
sysctl(name, 4, kp, &len, NULL, 0);
|
||||||
count = len / sizeof(*kp);
|
count = len / sizeof(*kp);
|
||||||
p->ps = calloc(count, sizeof(struct proc_s));
|
p->ps = calloc(count, sizeof(struct proc_s));
|
||||||
p->n = count;
|
p->n = count;
|
||||||
|
Loading…
Reference in New Issue
Block a user