dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / fs.d / autofs / auto_mnttab.c
blobde84d88d5dbdccaff2e392aa668041502c5dbf15
1 /*
2 * CDDL HEADER START
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.
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.
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]
20 * CDDL HEADER END
23 * auto_mnttab.c
25 * Copyright (c) 1988-1999 Sun Microsystems Inc
26 * All Rights Reserved.
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <stdio.h>
32 #include <sys/mnttab.h>
33 #include <sys/mkdev.h>
34 #include "automount.h"
36 static mutex_t mnttab_lock = DEFAULTMUTEX;
39 * XXX - Serialize calls to fsgetmntlist, so that threads can get consistent
40 * snapshots of the in-kernel mnttab. This function should be removed
41 * once getextmntent is made MT-safe and callers can invoke fsgetmntlist
42 * directly.
44 struct mntlist *
45 getmntlist()
47 struct mntlist *mntl;
49 (void) mutex_lock(&mnttab_lock);
50 mntl = fsgetmntlist();
51 (void) mutex_unlock(&mnttab_lock);
52 return (mntl);
56 * Return device number from extmnttab struct
58 dev_t
59 get_devid(mnt)
60 struct extmnttab *mnt;
62 return (makedev(mnt->mnt_major, mnt->mnt_minor));