blob: 02cb1aa252dbb4c3362e17f9ed39f5d71c960989 [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#include <unistd.h>
2#include <stdio.h>
3#include <errno.h>
4
5size_t confstr(int name, char *buf, size_t len)
6{
7 const char *s = "";
8 if (!name) {
9 s = "/bin:/usr/bin";
Daniel Sabogal104e8a02016-09-04 10:42:47 -040010 } else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>33U) {
Rich Felker0b44a032011-02-12 00:22:29 -050011 errno = EINVAL;
12 return 0;
13 }
14 // snprintf is overkill but avoid wasting code size to implement
15 // this completely useless function and its truncation semantics
Timo Teräs0a8d9822014-02-19 09:40:35 +020016 return snprintf(buf, len, "%s", s) + 1;
Rich Felker0b44a032011-02-12 00:22:29 -050017}