xref: /illumos-gate/usr/src/cmd/make/include/vroot/vroot.h (revision e7afc443)
110d63b7dSRichard Lowe /*
210d63b7dSRichard Lowe  * CDDL HEADER START
310d63b7dSRichard Lowe  *
410d63b7dSRichard Lowe  * The contents of this file are subject to the terms of the
510d63b7dSRichard Lowe  * Common Development and Distribution License (the "License").
610d63b7dSRichard Lowe  * You may not use this file except in compliance with the License.
710d63b7dSRichard Lowe  *
810d63b7dSRichard Lowe  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
910d63b7dSRichard Lowe  * or http://www.opensolaris.org/os/licensing.
1010d63b7dSRichard Lowe  * See the License for the specific language governing permissions
1110d63b7dSRichard Lowe  * and limitations under the License.
1210d63b7dSRichard Lowe  *
1310d63b7dSRichard Lowe  * When distributing Covered Code, include this CDDL HEADER in each
1410d63b7dSRichard Lowe  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1510d63b7dSRichard Lowe  * If applicable, add the following below this CDDL HEADER, with the
1610d63b7dSRichard Lowe  * fields enclosed by brackets "[]" replaced with your own identifying
1710d63b7dSRichard Lowe  * information: Portions Copyright [yyyy] [name of copyright owner]
1810d63b7dSRichard Lowe  *
1910d63b7dSRichard Lowe  * CDDL HEADER END
2010d63b7dSRichard Lowe  */
2110d63b7dSRichard Lowe /*
2210d63b7dSRichard Lowe  * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
2310d63b7dSRichard Lowe  * Use is subject to license terms.
2410d63b7dSRichard Lowe  */
2510d63b7dSRichard Lowe 
2610d63b7dSRichard Lowe 
2710d63b7dSRichard Lowe #ifndef _VROOT_H_
28*e7afc443SToomas Soome #define	_VROOT_H_
2910d63b7dSRichard Lowe 
3010d63b7dSRichard Lowe #include <stdio.h>
3110d63b7dSRichard Lowe #include <nl_types.h>
3210d63b7dSRichard Lowe 
33*e7afc443SToomas Soome #define	VROOT_DEFAULT ((pathpt)-1)
3410d63b7dSRichard Lowe 
3510d63b7dSRichard Lowe typedef struct {
3610d63b7dSRichard Lowe 	char		*path;
3710d63b7dSRichard Lowe 	short		length;
3810d63b7dSRichard Lowe } pathcellt, *pathcellpt, patht;
3910d63b7dSRichard Lowe typedef patht		*pathpt;
4010d63b7dSRichard Lowe 
41*e7afc443SToomas Soome extern	void		add_dir_to_path(const char *, pathpt *, int);
4210d63b7dSRichard Lowe extern	void		flush_path_cache(void);
4310d63b7dSRichard Lowe extern	void		flush_vroot_cache(void);
4410d63b7dSRichard Lowe extern	const char	*get_path_name(void);
45*e7afc443SToomas Soome extern	char		*get_vroot_path(char **, char **, char **);
4610d63b7dSRichard Lowe extern	const char	*get_vroot_name(void);
47*e7afc443SToomas Soome extern	int		open_vroot(char *, int, int, pathpt, pathpt);
48*e7afc443SToomas Soome extern	pathpt		parse_path_string(char *, int);
4910d63b7dSRichard Lowe extern	void		scan_path_first(void);
5010d63b7dSRichard Lowe extern	void		scan_vroot_first(void);
51*e7afc443SToomas Soome extern	void		set_path_style(int);
5210d63b7dSRichard Lowe 
53*e7afc443SToomas Soome extern	int		access_vroot(char *, int, pathpt, pathpt);
5410d63b7dSRichard Lowe 
55*e7afc443SToomas Soome extern	int		execve_vroot(char *, char **, char **, pathpt, pathpt);
5610d63b7dSRichard Lowe 
57*e7afc443SToomas Soome extern	int		lstat_vroot(char *, struct stat *, pathpt, pathpt);
58*e7afc443SToomas Soome extern	int		stat_vroot(char *, struct stat *, pathpt, pathpt);
59*e7afc443SToomas Soome extern	int		readlink_vroot(char *, char *, int, pathpt, pathpt);
6010d63b7dSRichard Lowe 
61*e7afc443SToomas Soome #endif /* _VROOT_H_ */
62