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 
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 
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 
155 
158  static int64_t getMaxTimezoneNameLength();
159 
164  static int64_t getMaxLineLength();
165 
169  static int64_t getPhysicalPageCount();
170 
175 
179  static int64_t getProcessorCount();
180 
184  static int64_t getMaxProcessorCount();
185 
188  static int64_t getProcessorsOnline();
189 
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 
230 
237 
241  static int64_t getMinThreadStackSize();
242 
246  static int64_t getMaxThreadsPerProcess();
247 
252 
255  static int64_t getMaxThreadKeys();
256 
260  static int64_t getMaxAtExitFunctions();
261 
265  static int64_t getCpuSetSize();
266 
269  static int64_t getMaxPasswordLength();
270 
273  static int64_t getMaxLogNameLength();
274 
278  static int64_t getMaxProcessId();
279 
282  static int64_t sysConf(int32_t name);
283 
288 
291  static char getDirectorySeparator();
292 
309  static bool setProtection(unsigned char *ptr,
310  size_t size,
311  int32_t protection);
312 
321  static bool sequentialAccess(unsigned char *ptr,
322  size_t size);
323 
332  static bool randomAccess(unsigned char *ptr,
333  size_t size);
334 
343  static bool willNeed(unsigned char *ptr, size_t size);
344 
354  static bool wontNeed(unsigned char *ptr, size_t size);
355 
365  static bool normalAccess(unsigned char *ptr, size_t size);
366 
374  static bool lock(unsigned char *ptr, size_t size);
375 
383  static bool unlock(unsigned char *ptr, size_t size);
384 
393  static bool notPagedOut(unsigned char *ptr, size_t size);
394 
395 
403  static bool disablePaging();
404 
412  static bool disablePagingOfCurrent();
413 
422  static bool disablePagingOfNew();
423 
431  static bool enablePaging();
432 
433  #include <rudiments/private/sys.h>
434 };
435 
436 #endif
Definition: sys.h:12
static bool wontNeed(unsigned char *ptr, size_t size)
static bool halt()
static int64_t getMaxSemaphoreValue()
static int64_t getAvailablePhysicalPageCount()
static char * getHostName()
static int32_t getPageSize()
static int64_t getMaxProcessesPerUser()
static int64_t getCpuSetSize()
static int64_t getMaxSymlinkLoops()
static bool notPagedOut(unsigned char *ptr, size_t size)
static bool sequentialAccess(unsigned char *ptr, size_t size)
static bool normalAccess(unsigned char *ptr, size_t size)
static char getDirectorySeparator()
static bool willNeed(unsigned char *ptr, size_t size)
static bool enablePaging()
static int64_t getProcessorCount()
static int64_t sysConf(int32_t name)
static char * getOperatingSystemArchitecture()
static char * getOperatingSystemVersion()
static int64_t getSuggestedGroupEntryBufferSize()
static int64_t getThreadDestructorIterations()
static bool unlock(unsigned char *ptr, size_t size)
static int64_t getSuggestedPasswordEntryBufferSize()
static int64_t getMaxThreadKeys()
static int64_t getMinThreadStackSize()
static int64_t getProcessorsOnline()
static bool lock(unsigned char *ptr, size_t size)
static int64_t getMaxOpenStreamsPerProcess()
static bool getLoadAverages(double *oneminuteaverage, double *fiveminuteaverage, double *fifteenminuteaverage)
static char * getOperatingSystemName()
static const char * getRudimentsVersion()
static bool setHostName(const char *hostname, uint64_t hostnamelen)
static int64_t getMaxCommandLineArgumentLength()
static void sync()
static int64_t getMaxLogNameLength()
static bool randomAccess(unsigned char *ptr, size_t size)
static int64_t getMaxRealtimeSignals()
static int64_t getMaxProcessId()
static int64_t getMaxTimersPerProcess()
static int64_t getMaxThreadsPerProcess()
static int64_t getMaxSupplementalGroupsPerUser()
static int64_t getMaxPasswordLength()
static int64_t getPhysicalPageCount()
static int64_t getMaxSignalQueueLength()
static int64_t getMaxProcessorCount()
static int64_t getMaxLineLength()
static bool setHostName(const char *hostname)
static int64_t getMaxOpenFilesPerProcess()
static bool disablePagingOfNew()
static bool disablePaging()
static int64_t getMaxLoginNameLength()
static bool signalsInterruptSystemCalls()
static int32_t getAllocationGranularity()
static int64_t getMaxSemaphoresPerProcess()
static int64_t getMaxDelayTimerExpirations()
static char * getOperatingSystemRelease()
static bool disablePagingOfCurrent()
static bool reboot()
static int64_t getMaxAtExitFunctions()
static int64_t getMaxTimezoneNameLength()
static int64_t getClockTicksPerSecond()
static bool shutDown()
static int64_t getMaxTerminalDeviceNameLength()
static int64_t getMaxHostNameLength()
static bool setProtection(unsigned char *ptr, size_t size, int32_t protection)