Fix include file ordering of generic headers

This commit is contained in:
Nathan Scott
2021-03-04 09:00:34 +11:00
parent 61ef1134d9
commit adaf748ab6
11 changed files with 21 additions and 18 deletions

View File

@ -9,6 +9,7 @@ in the source distribution for its full text.
#include <stddef.h>
void Generic_hostname(char* buffer, size_t size);
#endif

View File

@ -9,6 +9,7 @@ in the source distribution for its full text.
#include "zfs/ZfsArcStats.h"
void openzfs_sysctl_init(ZfsArcStats* stats);
void openzfs_sysctl_updateArcStats(ZfsArcStats* stats);

View File

@ -61,18 +61,19 @@ static void parseOSRelease(char* buffer, size_t bufferLen) {
snprintf(buffer, bufferLen, "%s%s%s", name[0] ? name : "", name[0] && version[0] ? " " : "", version);
}
char* Generic_uname(void) {
static char savedString[
/* uname structure fields - manpages recommend sizeof */
sizeof(uname_info.sysname) +
sizeof(uname_info.release) +
sizeof(uname_info.machine) +
sizeof(((struct utsname*)0)->sysname) +
sizeof(((struct utsname*)0)->release) +
sizeof(((struct utsname*)0)->machine) +
16/*markup*/ +
128/*distro*/] = {'\0'};
static bool loaded_data = false;
if (!loaded_data) {
struct utsname uname_info;
int uname_result = uname(&uname_info);
char distro[128];