comparison lib/mountlist.c @ 64:7d7e310c3270

GNU file utilities
author Jim Meyering <jim@meyering.net>
date Sat, 22 May 1993 02:01:31 +0000
parents 3209a15d374c
children 28cf48a906e4
comparison
equal deleted inserted replaced
63:9e544a5358a7 64:7d7e310c3270
78 #endif 78 #endif
79 79
80 #ifdef MOUNTED_VMOUNT /* AIX. */ 80 #ifdef MOUNTED_VMOUNT /* AIX. */
81 #include <fshelp.h> 81 #include <fshelp.h>
82 #include <sys/vfs.h> 82 #include <sys/vfs.h>
83 #endif
84
85 #ifdef DOLPHIN
86 /* So special that it's not worth putting this in autoconf. */
87 #undef MOUNTED_FREAD_FSTYP
88 #define MOUNTED_GETMNTTBL
83 #endif 89 #endif
84 90
85 #ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ 91 #ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */
86 /* Return the value of the hexadecimal number represented by CP. 92 /* Return the value of the hexadecimal number represented by CP.
87 No prefix (like '0x') or suffix (like 'h') is expected to be 93 No prefix (like '0x') or suffix (like 'h') is expected to be
356 if (fclose (fp) == EOF) 362 if (fclose (fp) == EOF)
357 return NULL; 363 return NULL;
358 } 364 }
359 #endif /* MOUNTED_FREAD || MOUNTED_FREAD_FSTYP. */ 365 #endif /* MOUNTED_FREAD || MOUNTED_FREAD_FSTYP. */
360 366
367 #ifdef MOUNTED_GETMNTTBL /* DolphinOS goes it's own way */
368 {
369 struct mntent **mnttbl=getmnttbl(),**ent;
370 for (ent=mnttbl;*ent;ent++)
371 {
372 me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
373 me->me_devname = xstrdup ( (*ent)->mt_resource);
374 me->me_mountdir = xstrdup( (*ent)->mt_directory);
375 me->me_type = xstrdup ((*ent)->mt_fstype);
376 me->me_dev = -1; /* Magic; means not known yet. */
377 me->me_next = NULL;
378
379 /* Add to the linked list. */
380 mtail->me_next = me;
381 mtail = me;
382 }
383 endmnttbl();
384 }
385 #endif
386
361 #ifdef MOUNTED_GETMNTENT2 /* SVR4. */ 387 #ifdef MOUNTED_GETMNTENT2 /* SVR4. */
362 { 388 {
363 struct mnttab mnt; 389 struct mnttab mnt;
364 char *table = MNTTAB; 390 char *table = MNTTAB;
365 FILE *fp; 391 FILE *fp;