-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcess.h
More file actions
45 lines (38 loc) · 1.35 KB
/
Process.h
File metadata and controls
45 lines (38 loc) · 1.35 KB
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
#ifndef SSC_PROCESS_H
#define SSC_PROCESS_H
#include "Macro.h"
#ifdef SSC_OS_UNIXLIKE
#include <unistd.h>
#ifdef _SC_NPROCESSORS_ONLN
#define SSC_HAS_GETNUMBERPROCESSORS
#endif
#endif
#if defined(__linux__)
#define SSC_HAS_GETEXECUTABLEPATH
#include <unistd.h>
#ifdef _SC_NPROCESSORS_ONLN
#define SSC_HAS_GETNUMBERPROCESSORS
#endif
#elif defined(SSC_OS_WINDOWS)
#define SSC_HAS_GETEXECUTABLEPATH
#define SSC_HAS_GETNUMBERPROCESSORS
#endif
SSC_BEGIN_C_DECLS
#ifdef SSC_HAS_GETEXECUTABLEPATH
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* Determine the filepath of the currently running executable. */
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
SSC_API char*
SSC_getExecutablePath(size_t* exec_path_size);
/*==========================================================================================*/
#endif
#ifdef SSC_HAS_GETNUMBERPROCESSORS
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* Return the number of logical processors on the system. */
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
SSC_API int
SSC_getNumberProcessors(void);
/*==========================================================================================*/
#endif
SSC_END_C_DECLS
#endif