buildkernel - Fix build issue w/libmd changes
[dragonfly.git] / usr.bin / getconf / pathconf.gperf
blob834965e9ec1d96d0da1be6fe2704c7ab27eaa05f
1 %{
2 /*
3  * Copyright is disclaimed as to the contents of this file.
4  *
5  * $FreeBSD: head/usr.bin/getconf/pathconf.gperf 119312 2003-08-22 17:32:07Z markm $
6  */
8 #include <sys/types.h>
10 #include <string.h>
11 #include <unistd.h>
13 #include "getconf.h"
16  * Override gperf's built-in external scope.
17  */
18 static const struct map *in_word_set(const char *str);
21 struct map { const char *name; int key; int valid; };
23 FILESIZEBITS, _PC_FILESIZEBITS
24 LINK_MAX, _PC_LINK_MAX
25 MAX_CANON, _PC_MAX_CANON
26 MAX_INPUT, _PC_MAX_INPUT
27 NAME_MAX, _PC_NAME_MAX
28 PATH_MAX, _PC_PATH_MAX
29 PIPE_BUF, _PC_PIPE_BUF
30 POSIX2_SYMLINKS, _PC_2_SYMLINKS
31 POSIX_ALLOC_SIZE_MIN, _PC_ALLOC_SIZE_MIN
32 POSIX_REC_INCR_XFER_SIZE, _PC_REC_INCR_XFER_SIZE
33 POSIX_REC_MAX_XFER_SIZE, _PC_REC_MAX_XFER_SIZE
34 POSIX_REC_MIN_XFER_SIZE, _PC_REC_MIN_XFER_SIZE
35 POSIX_REC_XFER_ALIGN, _PC_REC_XFER_ALIGN
36 SYMLINK_MAX, _PC_SYMLINK_MAX
37 TRUSTEDBSD_ACL_EXTENDED, _PC_ACL_EXTENDED
38 TRUSTEDBSD_ACL_PATH_MAX, _PC_ACL_PATH_MAX
39 TRUSTEDBSD_CAP_PRESENT, _PC_CAP_PRESENT
40 TRUSTEDBSD_INF_PRESENT, _PC_INF_PRESENT
41 TRUSTEDBSD_MAC_PRESENT, _PC_MAC_PRESENT
42 _POSIX_ASYNC_IO, _PC_ASYNC_IO
43 _POSIX_CHOWN_RESTRICTED, _PC_CHOWN_RESTRICTED
44 _POSIX_NO_TRUNC, _PC_NO_TRUNC
45 _POSIX_PRIO_IO, _PC_PRIO_IO
46 _POSIX_SYNC_IO, _PC_SYNC_IO
47 _POSIX_VDISABLE, _PC_VDISABLE
49 int
50 find_pathconf(const char *name, int *key)
52         const struct map *rv;
54         rv = in_word_set(name);
55         if (rv != NULL) {
56                 if (rv->valid) {
57                         *key = rv->key;
58                         return 1;
59                 }
60                 return -1;
61         }
62         return 0;