Files
RedBear-OS/tests/unistd/sysconf.c
T
Tibor Nagy efd6947d8e tests: Fix function-like macros
Turns the results of these macros from compound to regular statements using the old `do { ... } while(0)` trick. Must have for function-like macros.
2019-02-25 14:13:02 +01:00

29 lines
530 B
C

#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include "test_helpers.h"
#define SC(N) \
do { \
errno = 0; \
printf("%s (%d): %ld (%d)\n", #N, _SC_ ## N, sysconf(_SC_ ## N), errno); \
} while (0)
int main(void) {
SC(ARG_MAX);
SC(CHILD_MAX);
SC(CLK_TCK);
SC(NGROUPS_MAX);
SC(OPEN_MAX);
SC(STREAM_MAX);
SC(TZNAME_MAX);
SC(VERSION);
SC(PAGESIZE);
SC(RE_DUP_MAX);
SC(LOGIN_NAME_MAX);
SC(TTY_NAME_MAX);
SC(SYMLOOP_MAX);
SC(HOST_NAME_MAX);
}