blob: dc342bd4a4d7697c6890df2afc9dbbcd37007469 (
plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
/*
sys/sys.cc
This file is part of the Osirion project and is distributed under
the terms of the GNU General Public License version 2
*/
// project headers
#include "sys/sys.h"
// system headers
#ifdef _WIN32
#include <dlfcn.h>
#else
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
#endif
#include <stdlib.h>
bool sys::mkdir(const char *path)
{
#ifdef _WIN32
::mkdir(path);
// FIXME check return value
return true;
#else
return (::mkdir(path, 0777) == 0);
#endif
}
void sys::signal(int signum, signalfunc handler)
{
#ifndef _WIN32
struct sigaction sa;
sa.sa_handler = handler;
sa.sa_flags = 0;
::sigaction(signum, &sa, 0);
#endif
}
void sys::quit(int status) {
exit(status);
}
|