* Copyright (c) 1990 Jan-Simon Pendry
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
* This code is derived from software contributed to Berkeley by
* Jan-Simon Pendry at Imperial College, London.
* %sccs.include.redist.c%
* @(#)mtab_bsd.c 8.2 (Berkeley) %G%
* $Id: mtab_bsd.c,v 5.2.2.1 1992/02/09 15:10:13 jsp beta $
#ifdef READ_MTAB_BSD_STYLE
static struct mntent
*mnt_dup(mp
)
struct mntent
*new_mp
= ALLOC(mntent
);
new_mp
->mnt_fsname
= strdup(mp
->f_mntfromname
);
new_mp
->mnt_dir
= strdup(mp
->f_mntonname
);
case MOUNT_UFS
: ty
= MTAB_TYPE_UFS
; break;
case MOUNT_NFS
: ty
= MTAB_TYPE_NFS
; break;
case MOUNT_MFS
: ty
= MTAB_TYPE_MFS
; break;
default: ty
= "unknown"; break;
new_mp
->mnt_type
= strdup(ty
);
new_mp
->mnt_opts
= strdup("unset");
* Read a mount table into memory
struct statfs
*mntbufp
, *mntp
;
int nloc
= getmntinfo(&mntbufp
, MNT_NOWAIT
);
plog(XLOG_ERROR
, "Can't read mount table");
for (mntp
= mntbufp
; mntp
< mntbufp
+ nloc
; mntp
++) {
* Copy the data returned by getmntent
(*mpp
)->mnt
= mnt_dup(mntp
);
#endif /* READ_MTAB_BSD_STYLE */