• Antelope Release 5.9 Mac OS X 10.13.2 2019-05-01

 

NAME

sysmounted - return list of mounted filesystems

SYNOPSIS

#include "sysdata.h"

int sysmounted(Tbl **sysmnt)

DESCRIPTION

sysmounted reads a file in /etc/ and returns a Tbl list of SysMounted structures. Each structure in the list describes a mounted filesystem: its mount point, the filesystem type, the remote host (if mounted remotely), and the remote filesystem source.


typedef struct SysMounted {
    char mountpt[FILENAME_MAX] ;
    char host[96] ;
    char source[FILENAME_MAX] ;
    char fstype[32] ;
} SysMounted ;

sysmounted returns a pointer to a static Tbl which it maintains.

FILES

On linux, the file read is /etc/mtab.

EXAMPLE



sysmounted ( &mounted ) ;
for ( i=0 ; i<maxtbl(mounted) ; i++ ) {
    amount = (SysMounted *) gettbl(mounted, i) ;
    printf ( "%-25s %-8s %-15s %s\n",
            amount->mountpt, amount->fstype,
            amount->host, amount->source ) ;
}

RETURN VALUES

returns 0 for success, -1 if an error occurred.

LIBRARY

$(STOCKLIBS)

AUTHOR

Daniel Quinlan
Printer icon