- return 0;
-}
-
-u_int get_mntproto(const char *);
-u_int
-get_mntproto(const char *dirname)
-{
- FILE *mtab;
- struct mntent mntbuf;
- char tmpbuf[BUFSIZ];
- u_int proto = IPPROTO_TCP; /* assume tcp */
-
- mtab = setmntent ("/proc/mounts", "r");
- if (mtab == NULL)
- mtab = setmntent (_PATH_MOUNTED, "r");
- if (mtab == NULL)
- return proto;
-
- while(getmntent_r(mtab, &mntbuf, tmpbuf, sizeof (tmpbuf))) {
- if (strcmp(mntbuf.mnt_type, "nfs"))
- continue;
- if (strcmp(dirname, mntbuf.mnt_fsname))
- continue;
- if (hasmntopt(&mntbuf, "udp"))
- proto = IPPROTO_UDP;
- break;
- }
- endmntent (mtab);
-
- return proto;