return 1;
+#ifndef __FreeBSD__
cleanup:
p->statm_size = 0;
p->statm_resident = 0;
// p->statm_data = 0;
// p->statm_dirty = 0;
return 0;
+#endif
}
static inline int read_proc_pid_io(struct pid_stat *p, void *ptr) {
return 1;
+#ifndef __FreeBSD__
cleanup:
p->io_logical_bytes_read = 0;
p->io_logical_bytes_written = 0;
p->io_storage_bytes_written = 0;
// p->io_cancelled_write_bytes = 0;
return 0;
+#endif
}
static inline int read_proc_stat() {
#ifdef __FreeBSD__
long cp_time[CPUSTATES];
- int i;
+ static kernel_uint_t utime_raw = 0, stime_raw = 0, ntime_raw = 0;
if (unlikely(CPUSTATES != 5)) {
error("FREEBSD: There are %d CPU states (5 was expected)", CPUSTATES);
#else
static char filename[FILENAME_MAX + 1] = "";
static procfile *ff = NULL;
-#endif
static kernel_uint_t utime_raw = 0, stime_raw = 0, gtime_raw = 0, gntime_raw = 0, ntime_raw = 0;
+#endif
static usec_t collected_usec = 0, last_collected_usec = 0;
#ifndef __FreeBSD__
// to avoid filling up all disk space
// if debug is enabled, all errors are printed
+#ifndef __FreeBSD__
static int compar_pid(const void *pid1, const void *pid2) {
struct pid_stat *p1 = all_pids[*((pid_t *)pid1)];
else
return 1;
}
+#endif
static inline int collect_data_for_pid(pid_t pid, void *ptr) {
if(unlikely(pid < INIT_PID || pid > pid_max)) {
#endif
if(all_pids_count) {
+#ifndef __FreeBSD__
size_t slc = 0;
+#endif
for(p = root_of_pids; p ; p = p->next) {
p->read = 0; // mark it as not read, so that collect_data_for_pid() will read it
p->updated = 0;
}
void *mymmap(const char *filename, size_t size, int flags, int ksm) {
+#ifndef MADV_MERGEABLE
+ (void)ksm;
+#endif
static int log_madvise_1 = 1;
#ifdef MADV_MERGEABLE
static int log_madvise_2 = 1, log_madvise_3 = 1;