kernel - Refactor vnode_free_list, vnode reuse algorithm
[dragonfly.git] / usr.bin / getconf / pathconf.gperf
blob85e9d7479dde7ed87be4ac8a79c8778a2bf1df12
1 %{
2 /*
3  * Copyright is disclaimed as to the contents of this file.
4  *
5  * $FreeBSD: src/usr.bin/getconf/pathconf.gperf,v 1.3.2.1 2002/10/27 04:18:40 wollman Exp $
6  * $DragonFly: src/usr.bin/getconf/pathconf.gperf,v 1.2 2003/06/17 04:29:27 dillon Exp $
7  */
9 #include <sys/types.h>
11 #include <limits.h>
12 #include <string.h>
13 #include <unistd.h>
15 #include "getconf.h"
18  * Override gperf's built-in external scope.
19  */
20 static const struct map *in_word_set(const char *str, unsigned int len);
23 struct map { char *name; int key; int valid; };
25 FILESIZEBITS, _PC_FILESIZEBITS
26 LINK_MAX, _PC_LINK_MAX
27 MAX_CANON, _PC_MAX_CANON
28 MAX_INPUT, _PC_MAX_INPUT
29 NAME_MAX, _PC_NAME_MAX
30 PATH_MAX, _PC_PATH_MAX
31 PIPE_BUF, _PC_PIPE_BUF
32 POSIX_ALLOC_SIZE_MIN, _PC_ALLOC_SIZE_MIN
33 POSIX_REC_INCR_XFER_SIZE, _PC_REC_INCR_XFER_SIZE
34 POSIX_REC_MAX_XFER_SIZE, _PC_REC_MAX_XFER_SIZE
35 POSIX_REC_MIN_XFER_SIZE, _PC_REC_MIN_XFER_SIZE
36 POSIX_REC_XFER_ALIGN, _PC_REC_XFER_ALIGN
37 SYMLINK_MAX, _PC_SYMLINK_MAX
38 TRUSTEDBSD_ACL_EXTENDED, _PC_ACL_EXTENDED
39 TRUSTEDBSD_ACL_PATH_MAX, _PC_ACL_PATH_MAX
40 TRUSTEDBSD_CAP_PRESENT, _PC_CAP_PRESENT
41 TRUSTEDBSD_INF_PRESENT, _PC_INF_PRESENT
42 TRUSTEDBSD_MAC_PRESENT, _PC_MAC_PRESENT
43 _POSIX_CHOWN_RESTRICTED, _PC_CHOWN_RESTRICTED
44 _POSIX_NO_TRUNC, _PC_NO_TRUNC
45 _POSIX_VDISABLE, _PC_VDISABLE
46 _POSIX_ASYNC_IO, _PC_ASYNC_IO
47 _POSIX_PRIO_IO, _PC_PRIO_IO
48 _POSIX_SYNC_IO, _PC_SYNC_IO
50 int
51 find_pathconf(const char *name, int *key)
53         const struct map *rv;
55         rv = in_word_set(name, strlen(name));
56         if (rv != NULL) {
57                 if (rv->valid) {
58                         *key = rv->key;
59                         return 1;
60                 }
61                 return -1;
62         }
63         return 0;