Logo
Explore Help
Sign In
officereso/slstatus
1
0
Fork 0
You've already forked slstatus
Code Issues Pull Requests Releases Wiki Activity
slstatus/components/entropy.c

16 lines
292 B
C
Raw Normal View History

Added LICENSE statements to all source files
2017-09-17 17:45:03 +02:00
/* See LICENSE file for copyright and license details. */
More robust preprocessor switches Replace #ifdef with #if defined() and #elif with #elif defined() as it should only test if it is defined or not.
2018-03-21 12:21:37 +01:00
#if defined(__linux__)
Split into multiple files For multiple reasons the program is now split: - Make future porting to OpenBSD easier - Assign header includes to individiual functions - Make future program extensions easier - Recompile only changed parts
2017-09-17 16:18:17 +02:00
#include <stdio.h>
Move components into dedicated subdirectory This brings us a lot more tidiness.
2017-09-24 15:33:01 +02:00
#include "../util.h"
Split into multiple files For multiple reasons the program is now split: - Make future porting to OpenBSD easier - Assign header includes to individiual functions - Make future program extensions easier - Recompile only changed parts
2017-09-17 16:18:17 +02:00
const char *
entropy(void)
{
int num;
return (pscanf("/proc/sys/kernel/random/entropy_avail", "%d", &num) == 1) ?
bprintf("%d", num) : NULL;
}
Build Linux-only functions only on Linux
2018-03-18 23:26:13 +01:00
#endif
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.6 Page: 10ms Template: 0ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API