xref: /titanic_50/usr/src/lib/libc/port/sys/nfssys.c (revision 36fe4a92b52649b0979d6a13212f4cea730d19c7)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 /*
31  * Portions of this source code were derived from Berkeley 4.3 BSD
32  * under license from the Regents of the University of California.
33  */
34 
35 #pragma ident	"%Z%%M%	%I%	%E% SMI"
36 
37 #pragma weak exportfs = _exportfs
38 #pragma weak nfs_getfh = _nfs_getfh
39 #pragma weak nfssvc = _nfssvc
40 
41 #include "synonyms.h"
42 #include <sys/types.h>
43 #include <sys/types32.h>
44 #include <rpc/types.h>
45 #include <sys/vfs.h>
46 #include <nfs/nfs.h>
47 #include <nfs/export.h>
48 #include <nfs/nfssys.h>
49 #include "libc.h"
50 
51 int
52 exportfs(char *dir, struct exportdata *ep)
53 {
54 	struct exportfs_args ea;
55 
56 	ea.dname = dir;
57 	ea.uex = ep;
58 	return (_nfssys(EXPORTFS, &ea));
59 }
60 
61 int
62 nfs_getfh(char *path, fhandle_t *fhp)
63 {
64 	struct nfs_getfh_args nga;
65 
66 	nga.fname = path;
67 	nga.fhp = fhp;
68 	return (_nfssys(NFS_GETFH, &nga));
69 }
70 
71 int
72 nfssvc(int fd)
73 {
74 	struct nfs_svc_args nsa;
75 
76 	nsa.fd = fd;
77 	return (_nfssys(NFS_SVC, &nsa));
78 }
79