xref: /illumos-gate/usr/src/cmd/make/include/vroot/args.h (revision f2b348930f2f8a7df01ddf5e144f784d4ce31828)
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  * Copyright 1999 Sun Microsystems, Inc. All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 /*
27  * Copyright 2026 Oxide Computer Company
28  */
29 
30 #ifndef _ARGS_H_
31 #define	_ARGS_H_
32 
33 #include <sys/syscall.h>
34 #include <errno.h>
35 #include <spawn.h>
36 #include <sys/time.h>
37 #include <sys/param.h>
38 #include <stdio.h>
39 #include <fcntl.h>
40 #include <sys/types.h>
41 #include <sys/stat.h>
42 #include <sys/file.h>
43 
44 typedef enum { rw_read, rw_write} rwt, *rwpt;
45 
46 extern	void	translate_with_thunk(char *, int (*) (char *), pathpt, pathpt,
47 	rwt);
48 
49 union Args {
50 	struct {
51 		int mode;
52 	} access;
53 	struct {
54 		int mode;
55 	} chmod;
56 	struct {
57 		int user; int group;
58 	} chown;
59 	struct {
60 		int mode;
61 	} creat;
62 	struct {
63 		struct stat *buffer;
64 	} lstat;
65 	struct {
66 		int mode;
67 	} mkdir;
68 	struct {
69 		char *name; int mode;
70 	} mount;
71 	struct {
72 		int flags; int mode;
73 	} open;
74 	struct {
75 		char *buffer; int buffer_size;
76 	} readlink;
77 	struct {
78 		char **argv; char **environ;
79 		posix_spawnattr_t *attr; pid_t pid;
80 	} spawn;
81 	struct {
82 		struct stat *buffer;
83 	} stat;
84 	struct {
85 		int length;
86 	} truncate;
87 	struct {
88 		struct timeval *time;
89 	} utimes;
90 };
91 
92 extern	union Args	vroot_args;
93 extern	int		vroot_result;
94 
95 #endif /* _ARGS_H_ */
96