Rudiments
sys.h
1 // Copyright (c) 1999-2018 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_SYS_H
5 #define RUDIMENTS_SYS_H
6 
7 #include <rudiments/private/sysincludes.h>
8 
12 class RUDIMENTS_DLLSPEC sys {
13  public:
14 
17  static char *getOperatingSystemName();
18 
22  static char *getOperatingSystemRelease();
23 
27  static char *getOperatingSystemVersion();
28 
31  static char *getOperatingSystemArchitecture();
32 
34  static const char *getRudimentsVersion();
35 
40  static char *getHostName();
41 
44  static bool setHostName(const char *hostname);
45 
48  static bool setHostName(const char *hostname,
49  uint64_t hostnamelen);
50 
54  static bool getLoadAverages(double *oneminuteaverage,
55  double *fiveminuteaverage,
56  double *fifteenminuteaverage);
57 
59  static void sync();
60 
65  static bool halt();
66 
72  static bool shutDown();
73 
78  static bool reboot();
79 
82  static int64_t getMaxCommandLineArgumentLength();
83 
87  static int64_t getMaxProcessesPerUser();
88 
92  static int64_t getMaxHostNameLength();
93 
97  static int64_t getMaxLoginNameLength();
98 
107  static int64_t getClockTicksPerSecond();
108 
112  static int64_t getMaxOpenFilesPerProcess();
113 
121  static int32_t getPageSize();
122 
129  static int32_t getAllocationGranularity();
130 
134  static int64_t getMaxOpenStreamsPerProcess();
135 
149  static int64_t getMaxSymlinkLoops();
150 
154  static int64_t getMaxTerminalDeviceNameLength();
155 
158  static int64_t getMaxTimezoneNameLength();
159 
164  static int64_t getMaxLineLength();
165 
169  static int64_t getPhysicalPageCount();
170 
174  static int64_t getAvailablePhysicalPageCount();
175 
179  static int64_t getProcessorCount();
180 
184  static int64_t getMaxProcessorCount();
185 
188  static int64_t getProcessorsOnline();
189 
193  static int64_t getMaxSupplementalGroupsPerUser();
194 
198  static int64_t getMaxDelayTimerExpirations();
199 
203  static int64_t getMaxRealtimeSignals();
204 
208  static int64_t getMaxSemaphoresPerProcess();
209 
212  static int64_t getMaxSemaphoreValue();
213 
217  static int64_t getMaxSignalQueueLength();
218 
222  static int64_t getMaxTimersPerProcess();
223 
229  static int64_t getSuggestedGroupEntryBufferSize();
230 
236  static int64_t getSuggestedPasswordEntryBufferSize();
237 
240  static int64_t getMinThreadStackSize();
241 
245  static int64_t getMaxThreadsPerProcess();
246 
250  static int64_t getThreadDestructorIterations();
251 
254  static int64_t getMaxThreadKeys();
255 
259  static int64_t getMaxAtExitFunctions();
260 
264  static int64_t getCpuSetSize();
265 
268  static int64_t getMaxPasswordLength();
269 
272  static int64_t getMaxLogNameLength();
273 
276  static int64_t getMaxProcessId();
277 
280  static int64_t sysConf(int32_t name);
281 
285  static bool signalsInterruptSystemCalls();
286 
289  static char getDirectorySeparator();
290 
307  static bool setProtection(unsigned char *ptr,
308  size_t len,
309  int32_t protection);
310 
319  static bool sequentialAccess(unsigned char *ptr,
320  size_t len);
321 
330  static bool randomAccess(unsigned char *ptr,
331  size_t len);
332 
341  static bool willNeed(unsigned char *ptr, size_t len);
342 
352  static bool wontNeed(unsigned char *ptr, size_t len);
353 
363  static bool normalAccess(unsigned char *ptr, size_t len);
364 
372  static bool lock(unsigned char *ptr, size_t len);
373 
381  static bool unlock(unsigned char *ptr, size_t len);
382 
391  static bool notPagedOut(unsigned char *ptr, size_t len);
392 
393 
401  static bool disablePaging();
402 
410  static bool disablePagingOfCurrent();
411 
420  static bool disablePagingOfNew();
421 
429  static bool enablePaging();
430 
431  #include <rudiments/private/sys.h>
432 };
433 
434 #endif
Definition: sys.h:12