Blame misc/mntent.h

Packit 6c4009
/* Utilities for reading/writing fstab, mtab, etc.
Packit 6c4009
   Copyright (C) 1995-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef	_MNTENT_H
Packit 6c4009
#define	_MNTENT_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
#include <paths.h>
Packit 6c4009
#include <bits/types/FILE.h>
Packit 6c4009
Packit 6c4009
/* File listing canonical interesting mount points.  */
Packit 6c4009
#define	MNTTAB		_PATH_MNTTAB	/* Deprecated alias.  */
Packit 6c4009
Packit 6c4009
/* File listing currently active mount points.  */
Packit 6c4009
#define	MOUNTED		_PATH_MOUNTED	/* Deprecated alias.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* General filesystem types.  */
Packit 6c4009
#define MNTTYPE_IGNORE	"ignore"	/* Ignore this entry.  */
Packit 6c4009
#define MNTTYPE_NFS	"nfs"		/* Network file system.  */
Packit 6c4009
#define MNTTYPE_SWAP	"swap"		/* Swap device.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Generic mount options.  */
Packit 6c4009
#define MNTOPT_DEFAULTS	"defaults"	/* Use all default options.  */
Packit 6c4009
#define MNTOPT_RO	"ro"		/* Read only.  */
Packit 6c4009
#define MNTOPT_RW	"rw"		/* Read/write.  */
Packit 6c4009
#define MNTOPT_SUID	"suid"		/* Set uid allowed.  */
Packit 6c4009
#define MNTOPT_NOSUID	"nosuid"	/* No set uid allowed.  */
Packit 6c4009
#define MNTOPT_NOAUTO	"noauto"	/* Do not auto mount.  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* Structure describing a mount table entry.  */
Packit 6c4009
struct mntent
Packit 6c4009
  {
Packit 6c4009
    char *mnt_fsname;		/* Device or server for filesystem.  */
Packit 6c4009
    char *mnt_dir;		/* Directory mounted on.  */
Packit 6c4009
    char *mnt_type;		/* Type of filesystem: ufs, nfs, etc.  */
Packit 6c4009
    char *mnt_opts;		/* Comma-separated options for fs.  */
Packit 6c4009
    int mnt_freq;		/* Dump frequency (in days).  */
Packit 6c4009
    int mnt_passno;		/* Pass number for `fsck'.  */
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Prepare to begin reading and/or writing mount table entries from the
Packit 6c4009
   beginning of FILE.  MODE is as for `fopen'.  */
Packit 6c4009
extern FILE *setmntent (const char *__file, const char *__mode) __THROW;
Packit 6c4009
Packit 6c4009
/* Read one mount table entry from STREAM.  Returns a pointer to storage
Packit 6c4009
   reused on the next call, or null for EOF or error (use feof/ferror to
Packit 6c4009
   check).  */
Packit 6c4009
extern struct mntent *getmntent (FILE *__stream) __THROW;
Packit 6c4009
Packit 6c4009
#ifdef __USE_MISC
Packit 6c4009
/* Reentrant version of the above function.  */
Packit 6c4009
extern struct mntent *getmntent_r (FILE *__restrict __stream,
Packit 6c4009
				   struct mntent *__restrict __result,
Packit 6c4009
				   char *__restrict __buffer,
Packit 6c4009
				   int __bufsize) __THROW;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Write the mount table entry described by MNT to STREAM.
Packit 6c4009
   Return zero on success, nonzero on failure.  */
Packit 6c4009
extern int addmntent (FILE *__restrict __stream,
Packit 6c4009
		      const struct mntent *__restrict __mnt) __THROW;
Packit 6c4009
Packit 6c4009
/* Close a stream opened with `setmntent'.  */
Packit 6c4009
extern int endmntent (FILE *__stream) __THROW;
Packit 6c4009
Packit 6c4009
/* Search MNT->mnt_opts for an option matching OPT.
Packit 6c4009
   Returns the address of the substring, or null if none found.  */
Packit 6c4009
extern char *hasmntopt (const struct mntent *__mnt,
Packit 6c4009
			const char *__opt) __THROW;
Packit 6c4009
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif	/* mntent.h */