Back to index

glibc  2.9
Defines | Functions
mntent.h File Reference
#include <misc/mntent.h>

Go to the source code of this file.

Defines

#define __setmntent(file, mode)   INTUSE(__setmntent) (file, mode)
#define __endmntent(stream)   INTUSE(__endmntent) (stream)
#define __getmntent_r(stream, result, buffer, bufsize)   INTUSE(__getmntent_r) (stream, result, buffer, bufsize)

Functions

FILE__setmntent (__const char *__file, __const char *__mode)
FILE__setmntent_internal (__const char *__file, __const char *__mode)
struct mntent__getmntent_r (FILE *__stream, struct mntent *__result, char *__buffer, int __bufsize)
struct mntent__getmntent_r_internal (FILE *__stream, struct mntent *__result, char *__buffer, int __bufsize) attribute_hidden
int __addmntent (FILE *__stream, __const struct mntent *__mnt)
int __endmntent (FILE *__stream)
int __endmntent_internal (FILE *__stream) attribute_hidden
char * __hasmntopt (__const struct mntent *__mnt, __const char *__opt)

Define Documentation

#define __endmntent (   stream)    INTUSE(__endmntent) (stream)

Definition at line 22 of file mntent.h.

#define __getmntent_r (   stream,
  result,
  buffer,
  bufsize 
)    INTUSE(__getmntent_r) (stream, result, buffer, bufsize)

Definition at line 23 of file mntent.h.

#define __setmntent (   file,
  mode 
)    INTUSE(__setmntent) (file, mode)

Definition at line 21 of file mntent.h.


Function Documentation

int __addmntent ( FILE __stream,
__const struct mntent __mnt 
)
int __endmntent ( FILE __stream)

Here is the caller graph for this function:

int __endmntent_internal ( FILE __stream)
struct mntent* __getmntent_r ( FILE __stream,
struct mntent __result,
char *  __buffer,
int  __bufsize 
) [read]

Definition at line 124 of file mntent_r.c.

{
  char *cp;
  char *head;

  flockfile (stream);
  do
    {
      char *end_ptr;

      if (fgets_unlocked (buffer, bufsiz, stream) == NULL)
       {
         funlockfile (stream);
         return NULL;
       }

      end_ptr = strchr (buffer, '\n');
      if (end_ptr != NULL)  /* chop newline */
       *end_ptr = '\0';
      else
       {
         /* Not the whole line was read.  Do it now but forget it.  */
         char tmp[1024];
         while (fgets_unlocked (tmp, sizeof tmp, stream) != NULL)
           if (strchr (tmp, '\n') != NULL)
             break;
       }

      head = buffer + strspn (buffer, " \t");
      /* skip empty lines and comment lines:  */
    }
  while (head[0] == '\0' || head[0] == '#');

  cp = __strsep (&head, " \t");
  mp->mnt_fsname = cp != NULL ? decode_name (cp) : (char *) "";
  if (head)
    head += strspn (head, " \t");
  cp = __strsep (&head, " \t");
  mp->mnt_dir = cp != NULL ? decode_name (cp) : (char *) "";
  if (head)
    head += strspn (head, " \t");
  cp = __strsep (&head, " \t");
  mp->mnt_type = cp != NULL ? decode_name (cp) : (char *) "";
  if (head)
    head += strspn (head, " \t");
  cp = __strsep (&head, " \t");
  mp->mnt_opts = cp != NULL ? decode_name (cp) : (char *) "";
  switch (head ? sscanf (head, " %d %d ", &mp->mnt_freq, &mp->mnt_passno) : 0)
    {
    case 0:
      mp->mnt_freq = 0;
    case 1:
      mp->mnt_passno = 0;
    case 2:
      break;
    }
  funlockfile (stream);

  return mp;
}

Here is the call graph for this function:

struct mntent* __getmntent_r_internal ( FILE __stream,
struct mntent __result,
char *  __buffer,
int  __bufsize 
) [read]
char* __hasmntopt ( __const struct mntent __mnt,
__const char *  __opt 
)

Here is the caller graph for this function:

FILE* __setmntent ( __const char *  __file,
__const char *  __mode 
)
FILE* __setmntent_internal ( __const char *  __file,
__const char *  __mode 
)