libexplain  1.4.D001
libexplain/ac/mntent.h
Go to the documentation of this file.
00001 /*
00002  * libexplain - Explain errno values returned by libc functions
00003  * Copyright (C) 2008-2011, 2013 Peter Miller
00004  * Written by Peter Miller <pmiller@opensource.org.au>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as published by
00008  * the Free Software Foundation; either version 3 of the License, or (at
00009  * your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00020 #ifndef LIBEXPLAIN_AC_MNTENT_H
00021 #define LIBEXPLAIN_AC_MNTENT_H
00022 
00028 #include <libexplain/ac/stdio.h>
00029 
00030 #if HAVE_MNTENT_H
00031 #include <mntent.h>
00032 #endif
00033 #ifdef HAVE_SYS_MNTENT_H
00034 #include <sys/mntent.h>
00035 #endif
00036 #ifdef HAVE_SYS_MNTTAB_H
00037 #include <sys/mnttab.h>
00038 #endif
00039 
00040 #if !defined(HAVE_MNTENT_H) && !defined(HAVE_SYS_MNTTAB_H)
00041 
00042 struct mntent
00043 {
00044     char            *mnt_fsname;    /* Device or server for filesystem.  */
00045     char            *mnt_dir;       /* Directory mounted on.  */
00046     char            *mnt_type;      /* Type of filesystem: ufs, nfs, etc.  */
00047     char            *mnt_opts;      /* Comma-separated options for fs.  */
00048     int             mnt_freq;       /* Dump frequency (in days).  */
00049     int             mnt_passno;     /* Pass number for `fsck'.  */
00050 };
00051 
00052 FILE *setmntent(const char *filename, const char *mode);
00053 struct mntent *getmntent(FILE *fp);
00054 int endmntent(FILE *fp);
00055 
00056 #endif
00057 
00058 #ifndef MOUNTED
00059 # ifdef _PATH_MOUNTED
00060 #  define MOUNTED _PATH_MOUNTED
00061 # else
00062 #  ifdef MNTTAB
00063 #   define MOUNTED MNTTAB
00064 #  else
00065 #   define MOUNTED "/etc/mtab"
00066 #  endif
00067 # endif
00068 #endif
00069 
00070 /* Solaris is fugly. */
00071 #if defined(HAVE_GETMNTENT) && !defined(HAVE_SETMNTENT)
00072 #define setmntent fopen
00073 #define endmntent fclose
00074 #endif
00075 
00076 #endif /* LIBEXPLAIN_AC_MNTENT_H */
00077 /* vim: set ts=8 sw=4 et : */