xref: /titanic_41/usr/src/cmd/make/lib/vroot/unlink.cc (revision 3625efb1376c3d31a0e742ed72b778e5b3add543)
1*3625efb1SRichard Lowe /*
2*3625efb1SRichard Lowe  * CDDL HEADER START
3*3625efb1SRichard Lowe  *
4*3625efb1SRichard Lowe  * The contents of this file are subject to the terms of the
5*3625efb1SRichard Lowe  * Common Development and Distribution License (the "License").
6*3625efb1SRichard Lowe  * You may not use this file except in compliance with the License.
7*3625efb1SRichard Lowe  *
8*3625efb1SRichard Lowe  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*3625efb1SRichard Lowe  * or http://www.opensolaris.org/os/licensing.
10*3625efb1SRichard Lowe  * See the License for the specific language governing permissions
11*3625efb1SRichard Lowe  * and limitations under the License.
12*3625efb1SRichard Lowe  *
13*3625efb1SRichard Lowe  * When distributing Covered Code, include this CDDL HEADER in each
14*3625efb1SRichard Lowe  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*3625efb1SRichard Lowe  * If applicable, add the following below this CDDL HEADER, with the
16*3625efb1SRichard Lowe  * fields enclosed by brackets "[]" replaced with your own identifying
17*3625efb1SRichard Lowe  * information: Portions Copyright [yyyy] [name of copyright owner]
18*3625efb1SRichard Lowe  *
19*3625efb1SRichard Lowe  * CDDL HEADER END
20*3625efb1SRichard Lowe  */
21*3625efb1SRichard Lowe /*
22*3625efb1SRichard Lowe  * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
23*3625efb1SRichard Lowe  * Use is subject to license terms.
24*3625efb1SRichard Lowe  */
25*3625efb1SRichard Lowe 
26*3625efb1SRichard Lowe 
27*3625efb1SRichard Lowe #include <unistd.h>
28*3625efb1SRichard Lowe 
29*3625efb1SRichard Lowe extern int unlink(const char *path);
30*3625efb1SRichard Lowe 
31*3625efb1SRichard Lowe #include <vroot/vroot.h>
32*3625efb1SRichard Lowe #include <vroot/args.h>
33*3625efb1SRichard Lowe 
unlink_thunk(char * path)34*3625efb1SRichard Lowe static int	unlink_thunk(char *path)
35*3625efb1SRichard Lowe {
36*3625efb1SRichard Lowe 	vroot_result= unlink(path);
37*3625efb1SRichard Lowe 	return(vroot_result == 0);
38*3625efb1SRichard Lowe }
39*3625efb1SRichard Lowe 
unlink_vroot(char * path,pathpt vroot_path,pathpt vroot_vroot)40*3625efb1SRichard Lowe int	unlink_vroot(char *path, pathpt vroot_path, pathpt vroot_vroot)
41*3625efb1SRichard Lowe {
42*3625efb1SRichard Lowe 	translate_with_thunk(path, unlink_thunk, vroot_path, vroot_vroot, rw_read);
43*3625efb1SRichard Lowe 	return(vroot_result);
44*3625efb1SRichard Lowe }
45