diff options
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h new file mode 100644 index 0000000..2c3bc51 --- /dev/null +++ b/src/util.h @@ -0,0 +1,30 @@ +#ifndef _UTIL_H_ +#define _UTIL_H_ + +#include <time.h> +#include <stdbool.h> + +extern int _testmode; + +struct user; + +// Get monotonic clock (seconds) +time_t now(); + +void init_time(); + +bool doublefork(); + +bool waitRead( int fd, int ms ); + +void copy( const char *src, char *dst, size_t len, const char *stop ); + +void killSession( const struct user * user ); + +void redirect( int newIn, int newOut ); + +void switchUserSafe( const char* user ); + +void run( bool detach, const char *file, ... ); + +#endif |