1#include <errno.h> 2#include <stdio.h> 3#include <unistd.h> 4 5size_t confstr(int name, char* buf, size_t len) { 6 const char* s = ""; 7 if (!name) { 8 s = "/bin:/usr/bin"; 9 } else if ((name & ~4U) != 1 && 10 name - _CS_POSIX_V6_ILP32_OFF32_CFLAGS < 0 && 11 name - _CS_POSIX_V6_ILP32_OFF32_CFLAGS > 31) { 12 errno = EINVAL; 13 return 0; 14 } 15 // snprintf is overkill but avoid wasting code size to implement 16 // this completely useless function and its truncation semantics 17 return snprintf(buf, len, "%s", s) + 1; 18} 19