# HG changeset patch # User Jim Meyering # Date 832856681 0 # Node ID e560f7b02ab92c2188c840de1b147ba35a54baf7 # Parent c19095ef2f581cc2ba39f7c789bbd3a8a2829d73 (read_filesystem_list) [MOUNTED_LISTMNTENT]: New function. From Johan Danielsson (joda@pdc.kth.se). diff -r c19095ef2f58 -r e560f7b02ab9 lib/mountlist.c --- a/lib/mountlist.c Thu May 23 13:04:03 1996 +0000 +++ b/lib/mountlist.c Thu May 23 13:04:41 1996 +0000 @@ -80,6 +80,10 @@ #include #endif +#ifdef MOUNTED_LISTMNTENT +#include +#endif + #ifdef MOUNTED_GETMNTENT2 /* SVR4. */ #include #endif @@ -195,6 +199,36 @@ me->me_next = NULL; mount_list = mtail = me; +#ifdef MOUNTED_LISTMNTENT + { + struct tabmntent *mntlist, *p; + struct mntent *mnt; + struct mount_entry *me; + + /* the third and fourth arguments could be used to filter mounts, + but Crays doesn't seem to have any mounts that we want to + remove. Specifically, automount create normal NFS mounts. + */ + + if(listmntent(&mntlist, KMTAB, NULL, NULL) < 0) + return NULL; + p = mntlist; + while(p){ + mnt = p->ment; + me = (struct mount_entry*) xmalloc(sizeof (struct mount_entry)); + me->me_devname = xstrdup(mnt->mnt_fsname); + me->me_mountdir = xstrdup(mnt->mnt_dir); + me->me_type = xstrdup(mnt->mnt_type); + me->me_dev = -1; + me->me_next = NULL; + mtail->me_next = me; + mtail = me; + p = p->next; + } + freemntlist(mntlist); + } +#endif + #ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ { struct mntent *mnt;