Update.
[glibc.git] / misc / tst-mntent.c
blobd6f374385f5519439343ba45ecc6410e4cb8ebfc
1 /* Test case by Horst von Brand <vonbrand@sleipnir.valparaiso.cl>. */
2 #include <mntent.h>
3 #include <stdio.h>
4 #include <string.h>
7 int
8 main (int argc, char *argv[])
10 int result = 0;
11 struct mntent mef;
12 struct mntent *mnt = &mef;
14 mef.mnt_fsname = strdupa ("/dev/hda1");
15 mef.mnt_dir = strdupa ("/");
16 mef.mnt_type = strdupa ("ext2");
17 mef.mnt_opts = strdupa ("defaults");
18 mef.mnt_freq = 1;
19 mef.mnt_passno = 1;
21 if (hasmntopt (mnt, "defaults"))
22 printf ("Found!\n");
23 else
25 printf ("Didn't find it\n");
26 result = 1;
29 return result;