headers/bsd: Add sys/queue.h.
[haiku.git] / src / tests / system / libroot / posix / test_confstr.c
blob358d3083eb1014aabdf0bb490f45ed85ba1e3a89
1 #include <stdio.h>
2 #include <errno.h>
3 #include <string.h>
4 #include <limits.h>
6 size_t confstr(int name, char *buf, size_t len);
7 char string[512];
9 int main()
11 int i;
12 size_t size;
13 for (i=0; i<INT_MAX; i++) {
14 size = confstr(i, NULL, (size_t) 0);
15 if (errno != B_BAD_VALUE)
16 printf("%ld confstr %ld %s\n", i, size, strerror(errno));
17 if (size != 0) {
18 size = confstr(i, string, sizeof(string));
19 printf("%ld value %s\n", i, string);