summaryrefslogblamecommitdiffstats
path: root/src/util.h
blob: d8cf887b61f3fcc266a03b564c09baa9299cad7d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                
                   
 
                       
 
                        













                                                                      
#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