-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathsys.h
68 lines (52 loc) · 1.71 KB
/
sys.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*-
* xnumon - monitor macOS for malicious activity
* https://www.roe.ch/xnumon
*
* Copyright (c) 2017-2019, Daniel Roethlisberger <[email protected]>.
* All rights reserved.
*
* Licensed under the Open Software License version 3.0.
*/
#ifndef SYS_H
#define SYS_H
#include "attrib.h"
#include <sys/types.h>
#include <stdint.h>
#include <time.h>
typedef struct {
mode_t mode;
uid_t uid;
gid_t gid;
dev_t dev;
ino_t ino;
/*dev_t rdev;*/
off_t size;
struct timespec mtime;
struct timespec ctime;
struct timespec btime;
} stat_attr_t;
char * sys_pidpath(pid_t) MALLOC;
char * sys_pidcwd(pid_t) MALLOC;
int sys_pidbsdinfo(struct timespec *, pid_t *, pid_t) WUNRES;
pid_t * sys_pidlist(int *) MALLOC NONNULL(1);
gid_t sys_gidbyname(const char *) NONNULL(1);
dev_t sys_devbypath(const char *) WUNRES;
const char * sys_ttydevname(dev_t) WUNRES;
int sys_pathattr(stat_attr_t *, const char *) NONNULL(1,2);
int sys_fdattr(stat_attr_t *, int) NONNULL(1);
int sys_fd_setblocking(int) WUNRES;
int sys_basenamecmp(const char *restrict, const char *restrict) WUNRES;
char * sys_realpath(const char *restrict, const char *restrict) MALLOC;
char * sys_realdir(const char *restrict, const char *restrict) MALLOC;
char * sys_readlink(const char *) MALLOC;
void sys_strip_path_noop(char *) NONNULL(1);
int sys_islnk(const char *) WUNRES;
int sys_limit_nofile(size_t);
int sys_pidf_open(const char *) NONNULL(1) WUNRES;
int sys_pidf_write(int) WUNRES;
void sys_pidf_close(int, const char *) NONNULL(2);
typedef int (*sys_dir_eachfile_cb_t)(const char *, void *) NONNULL(1) WUNRES;
int sys_dir_eachfile_l(const char *, sys_dir_eachfile_cb_t, void *)
NONNULL(1,2) WUNRES;
char * sys_which(const char *, const char *) MALLOC NONNULL(1,2);
#endif