Functions to test system conditions. More...
#include <stdlib.h>#include <stdio.h>#include <utmp.h>#include <paths.h>#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include <sys/param.h>#include "pmm_model.h"#include "pmm_cond.h"Go to the source code of this file.
Functions | |
| int | ttystat (char *line, int sz) |
| int | num_users () |
| int | cond_users () |
| int | cond_idle () |
| int | check_conds (struct pmm_routine *r) |
Functions to test system conditions.
this file contains the code for testing system conditions which may limit or permit the construction of models by the pmm daemon
Definition in file pmm_cond.c.
| int check_conds | ( | struct pmm_routine * | r | ) |
check if conditions for execution of a routine are satisfied and set executable parameter of routine accordingly
| r | pointer to the routine |
Definition at line 170 of file pmm_cond.c.
| int cond_idle | ( | ) |
test system for idleness
true if 5 minute load is below 0.1
return 0 if not idle, 1 if idle
Definition at line 143 of file pmm_cond.c.
| int cond_users | ( | ) |
Definition at line 128 of file pmm_cond.c.
| int num_users | ( | ) |
counts the number of users logged into a system by reading utmp returns the number of users logged in.
code comes from FreeBSD /usr/src/usr.bin/w/w.c
Definition at line 90 of file pmm_cond.c.
| int ttystat | ( | char * | line, |
| int | sz | ||
| ) |
checks that the tty a user is logged into (as per utmp) exists in /dev
This indicates whether a user has an interactive session or not
code comes from FreeBSD /usr/src/usr.bin/w/w.c
| line | pointer to line of the utmp file |
| sz | size of the line |
Definition at line 62 of file pmm_cond.c.
1.8.1.2