xref: /titanic_51/usr/src/cmd/ast/libshell/common/illumos_cmdlist.h (revision b4dd7d09880f14016feece03929a224eca1cf39a)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
24  * Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
25  */
26 
27 #ifndef _ILLUMOS_KSH_CMDLIST_H
28 #define	_ILLUMOS_KSH_CMDLIST_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 /*
35  * List builtins for illumos.
36  * The list here is partially autogenerated and partially hand-picked
37  * based on compatibility with the native illumos versions of these
38  * tools
39  */
40 
41 /*
42  * Commands which are 100% compatible with native illumos versions (/bin is
43  * a softlink to ./usr/bin, ksh93 takes care of the lookup)
44  */
45 #define	BINCMDLIST(f)	\
46 	{ "/bin/"	#f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
47 #define	USRBINCMDLIST(f)	\
48 	{ "/usr/bin/"	#f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
49 #define	SBINCMDLIST(f)	\
50 	{ "/sbin/"	#f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
51 #define	SUSRBINCMDLIST(f)	\
52 	{ "/usr/sbin/"	#f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
53 /* POSIX compatible commands */
54 #define	XPG6CMDLIST(f)	\
55 	{ "/usr/xpg6/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
56 #define	XPG4CMDLIST(f)	\
57 	{ "/usr/xpg4/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
58 #ifdef SHOPT_USR_GNU_BIN_BUILTINS
59 /* GNU coreutils compatible commands */
60 #define	GNUCMDLIST(f)	\
61 	{ "/usr/gnu/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
62 #else
63 #define	GNUCMDLIST(f)
64 #endif
65 /*
66  * Make all ksh93 builtins accessible when /usr/ast/bin was added to
67  * /usr/xpg6/bin:/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/bin:/opt/SUNWspro/bin
68  */
69 #define	ASTCMDLIST(f)	\
70 	{ "/usr/ast/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
71 
72 /* undo ast_map.h #defines to avoid collision */
73 #undef basename
74 #undef dirname
75 #undef mktemp
76 
77 /* Generated data, do not edit. */
78 ASTCMDLIST(basename)
79 GNUCMDLIST(basename)
80 XPG4CMDLIST(basename)
81 ASTCMDLIST(cat)
82 BINCMDLIST(cat)
83 ASTCMDLIST(chgrp)
84 // XPG4CMDLIST(chgrp)
85 ASTCMDLIST(chmod)
86 ASTCMDLIST(chown)
87 // XPG4CMDLIST(chown)
88 BINCMDLIST(chown)
89 ASTCMDLIST(cksum)
90 BINCMDLIST(cksum)
91 GNUCMDLIST(cksum)
92 ASTCMDLIST(cmp)
93 BINCMDLIST(cmp)
94 ASTCMDLIST(comm)
95 BINCMDLIST(comm)
96 GNUCMDLIST(comm)
97 ASTCMDLIST(cp)
98 // XPG4CMDLIST(cp)
99 ASTCMDLIST(cut)
100 BINCMDLIST(cut)
101 GNUCMDLIST(cut)
102 ASTCMDLIST(date)
103 // XPG4CMDLIST(date)
104 ASTCMDLIST(dirname)
105 BINCMDLIST(dirname)
106 GNUCMDLIST(dirname)
107 ASTCMDLIST(expr)
108 GNUCMDLIST(expr)
109 XPG6CMDLIST(expr)
110 ASTCMDLIST(fds)
111 ASTCMDLIST(fmt)
112 ASTCMDLIST(fold)
113 BINCMDLIST(fold)
114 GNUCMDLIST(fold)
115 ASTCMDLIST(head)
116 BINCMDLIST(head)
117 ASTCMDLIST(id)
118 XPG4CMDLIST(id)
119 ASTCMDLIST(join)
120 BINCMDLIST(join)
121 GNUCMDLIST(join)
122 ASTCMDLIST(ln)
123 // XPG4CMDLIST(ln)
124 ASTCMDLIST(logname)
125 BINCMDLIST(logname)
126 GNUCMDLIST(logname)
127 ASTCMDLIST(md5sum)
128 ASTCMDLIST(mkdir)
129 BINCMDLIST(mkdir)
130 GNUCMDLIST(mkdir)
131 ASTCMDLIST(mkfifo)
132 BINCMDLIST(mkfifo)
133 GNUCMDLIST(mkfifo)
134 ASTCMDLIST(mktemp)
135 BINCMDLIST(mktemp)
136 GNUCMDLIST(mktemp)
137 ASTCMDLIST(mv)
138 // XPG4CMDLIST(mv)
139 ASTCMDLIST(paste)
140 BINCMDLIST(paste)
141 GNUCMDLIST(paste)
142 ASTCMDLIST(pathchk)
143 BINCMDLIST(pathchk)
144 GNUCMDLIST(pathchk)
145 ASTCMDLIST(rev)
146 BINCMDLIST(rev)
147 ASTCMDLIST(rm)
148 XPG4CMDLIST(rm)
149 ASTCMDLIST(rmdir)
150 BINCMDLIST(rmdir)
151 GNUCMDLIST(rmdir)
152 GNUCMDLIST(sleep)
153 ASTCMDLIST(stty)
154 // XPG4CMDLIST(stty)
155 ASTCMDLIST(sum)
156 BINCMDLIST(sum)
157 ASTCMDLIST(sync)
158 BINCMDLIST(sync)
159 GNUCMDLIST(sync)
160 SBINCMDLIST(sync)
161 SUSRBINCMDLIST(sync)
162 ASTCMDLIST(tail)
163 BINCMDLIST(tail)
164 XPG4CMDLIST(tail)
165 ASTCMDLIST(tee)
166 BINCMDLIST(tee)
167 GNUCMDLIST(tee)
168 ASTCMDLIST(tty)
169 BINCMDLIST(tty)
170 GNUCMDLIST(tty)
171 ASTCMDLIST(uname)
172 ASTCMDLIST(uniq)
173 BINCMDLIST(uniq)
174 GNUCMDLIST(uniq)
175 ASTCMDLIST(wc)
176 BINCMDLIST(wc)
177 GNUCMDLIST(wc)
178 
179 /* Mandatory for ksh93 test suite and AST scripts */
180 BINCMDLIST(getconf)
181 
182 #ifdef	__cplusplus
183 }
184 #endif
185 
186 #endif /* !_ILLUMOS_KSH_CMDLIST_H */
187