summaryrefslogtreecommitdiffstats
path: root/src/util.h
blob: d8cf887b61f3fcc266a03b564c09baa9299cad7d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 );

void init_time( void );

bool doublefork( void );

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