* $Id: mtab_ultrix.c,v 5.2 90/06/23 22:20:57 jsp Rel $
* Copyright (c) 1990 Jan-Simon Pendry
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
* Copyright (c) 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Jan-Simon Pendry at Imperial College, London.
* %sccs.include.redist.c%
* @(#)mtab_ultrix.c 5.1 (Berkeley) %G%
#ifdef READ_MTAB_ULTRIX_STYLE
#include <sys/fs_types.h>
static struct mntent
*mnt_dup(mp
)
struct mntent
*new_mp
= ALLOC(mntent
);
new_mp
->mnt_fsname
= strdup(mp
->fd_devname
);
new_mp
->mnt_dir
= strdup(mp
->fd_path
);
if (mp
->fd_fstype
>= GT_NUMTYPES
)
mp
->fd_fstype
= GT_UNKWN
;
else if (gt_names
[mp
->fd_fstype
] == 0)
mp
->fd_fstype
= GT_UNKWN
;
new_mp
->mnt_type
= strdup(gt_names
[mp
->fd_fstype
]);
new_mp
->mnt_opts
= strdup("unset");
new_mp
->mnt_passno
= mp
->fd_dev
;
* Read a mount table into memory
/* From: Piete Brooks <pb@cl.cam.ac.uk> */
struct fs_data mountbuffer
[NMOUNT
], *fs_data
;
while ((ret
= getmountent(&loc
, mountbuffer
, NMOUNT
)) > 0) {
for (fs_data
= mountbuffer
; fs_data
< &mountbuffer
[ret
]; fs_data
++) {
* Copy the data returned by getmntent
(*mpp
)->mnt
= mnt_dup(fs_data
);
plog(XLOG_ERROR
, "getmountent: %m");
#endif /* READ_MTAB_ULTRIX_STYLE */