sigar/src/os/linux/sigar_os.h

62 lines
1.2 KiB
C
Raw Normal View History

2004-06-22 06:37:04 +08:00
#ifndef SIGAR_OS_H
#define SIGAR_OS_H
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <ctype.h>
#include <time.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
typedef struct {
sigar_pid_t pid;
time_t mtime;
sigar_uint64_t vsize;
sigar_uint64_t rss;
2005-11-24 01:39:28 +08:00
sigar_uint64_t minor_faults;
sigar_uint64_t major_faults;
2004-06-22 06:37:04 +08:00
sigar_uint64_t ppid;
int tty;
int priority;
int nice;
sigar_uint64_t start_time;
sigar_uint64_t utime;
sigar_uint64_t stime;
char name[SIGAR_PROC_NAME_LEN];
char state;
2005-11-23 11:09:59 +08:00
int processor;
2004-06-22 06:37:04 +08:00
} linux_proc_stat_t;
2004-12-05 15:10:18 +08:00
typedef enum {
IOSTAT_NONE,
2005-05-07 07:50:27 +08:00
IOSTAT_PARTITIONS, /* 2.4 */
IOSTAT_DISKSTATS, /* 2.6 */
2004-12-05 15:10:18 +08:00
IOSTAT_SYS /* 2.6 */
} linux_iostat_e;
2004-06-22 06:37:04 +08:00
struct sigar_t {
SIGAR_T_BASE;
int ram;
int proc_signal_offset;
linux_proc_stat_t last_proc_stat;
int ht_enabled;
int lcpu;
2004-12-05 15:10:18 +08:00
linux_iostat_e iostat;
2004-12-06 06:31:26 +08:00
sigar_cache_t *fsdev;
2004-06-22 06:37:04 +08:00
};
#define HAVE_STRERROR_R
#define HAVE_STRERROR_R_GLIBC
#define HAVE_READDIR_R
#define HAVE_GETPWNAM_R
#define HAVE_GETPWUID_R
#define HAVE_GETGRGID_R
#endif /* SIGAR_OS_H */