From f7cd45464fd7c037f6a60098ae77760998b3b4b6 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 10 May 2019 15:25:43 +0200 Subject: Initial commit --- src/util.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/util.h (limited to 'src/util.h') 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 +#include + +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 -- cgit v1.2.3-55-g7522