diff options
author | Simon Rettberg | 2019-05-10 15:25:43 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-05-10 15:25:43 +0200 |
commit | f7cd45464fd7c037f6a60098ae77760998b3b4b6 (patch) | |
tree | 02cf10b2766fc5bb47e44d7253d4ec4eb4a674d3 /src/util.h | |
download | idle-daemon-f7cd45464fd7c037f6a60098ae77760998b3b4b6.tar.gz idle-daemon-f7cd45464fd7c037f6a60098ae77760998b3b4b6.tar.xz idle-daemon-f7cd45464fd7c037f6a60098ae77760998b3b4b6.zip |
Initial commit
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 |