Sponsored Content
Top Forums Programming how to get filesystem usage in c Post 302210960 by jim mcnamara on Wednesday 2nd of July 2008 10:09:20 AM
Old 07-02-2008
getmntent is not listed as POSIX. Shamrock must have seen that it was avaialble for you system.
 

10 More Discussions You Might Find Interesting

1. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

2. Solaris

Filesystem Usage

Hi Guys... I want to change the below script to send an alert when my file system is greater than 5G. # If any filesystem has less than 5k, issue an alert if Regards (3 Replies)
Discussion started by: Phuti
3 Replies

3. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

4. Solaris

Filesystem - error when extend the filesystem

Hi all, currently , my root filesystem already reach 90 ++% I already add more cylinder in the root partition as below Part Tag Flag Cylinders Size Blocks 0 root wm 67 - 5086 38.46GB (5020/0/0) 80646300 1 swap wu 1 - ... (11 Replies)
Discussion started by: SmartAntz
11 Replies

5. Shell Programming and Scripting

Filesystem Usage Script

Hey guys I am learning Linux and I am working on script for a college class project to check usage of file system. I pulled this from a different site but have to tweak it a little to work but I still get errors. Here is what I got so far. ALERT=5 function main_prog() { while read output;... (1 Reply)
Discussion started by: jcsx6245
1 Replies

6. Shell Programming and Scripting

Filesystem usage with more than 80%.

Hi All, I need to display the output of rah "df -m" only for the filesysytems those are touching or crossing 80%. Im using SuSE Linux box and the output of original rah command is- /dev/NODE0001 557900 446681 83319 75% /db2fs/NODE0001 /dev/NODE0002 ... (5 Replies)
Discussion started by: NARESH1302
5 Replies

7. UNIX for Dummies Questions & Answers

hwo to find shared filesystem and local filesystem in AIX

Hi, I wanted to find out that in my database server which filesystems are shared storage and which filesystems are local. Like when I use df -k, it shows "filesystem" and "mounted on" but I want to know which one is shared and which one is local. Please tell me the commands which I can run... (2 Replies)
Discussion started by: kamranjalal
2 Replies

8. AIX

Mount Filesystem in AIX Unable to read /etc/filesystem

Dear all, We are facing prolem when we are going to mount AIX filesystem, the system returned the following error 0506-307The AFopen call failed : A file or directory in the path name does not exist. But when we ls filesystems in the /etc/ directory it show -rw-r--r-- 0 root ... (2 Replies)
Discussion started by: m_raheelahmed
2 Replies

9. Solaris

Solaris Filesystem usage discrepancy after "copy"

I have a query someone may be able to shed some light on... We have a Solaris 10 OS Sun V490 server Sparc. I have a SAN attached EMC Clarrion LUN which we have app data stored on. Pseudo name=emcpower0a CLARiiON ID=CK200070300470 Due to storage requirements - I need to migrate this... (4 Replies)
Discussion started by: ru4n1
4 Replies

10. Shell Programming and Scripting

Space usage by top 5 users in a filesystem

I want to see top 5 users,who have occupied most amount of disk space in a filesystem. But not sure how to do it. I can get the usage for a particular user find . -user user -type f exec df -h {} \;|awk '{ s = s+$1 } END { print "Total used: ",s }' But how to get without specifying any user... (6 Replies)
Discussion started by: rka
6 Replies
GETMNTENT(3)						     Linux Programmer's Manual						      GETMNTENT(3)

NAME
getmntent, setmntent, addmntent, endmntent, hasmntopt - get file system descriptor file entry SYNOPSIS
#include <stdio.h> #include <mntent.h> FILE *setmntent(const char *filename, const char *type); struct mntent *getmntent(FILE *filep); int addmntent(FILE *filep, const struct mntent *mnt); int endmntent(FILE *filep); char *hasmntopt(const struct mntent *mnt, const char *opt); DESCRIPTION
These routines are used to access the file system description file /etc/fstab and the mounted file system description file /etc/mtab. The setmntent() function opens the file system description file filep and returns a file pointer which can be used by getmntent(). The argument type is the type of access required and can take the same values as the mode argument of fopen(3). The getmntent() function reads the next line from the file system description file filep and returns a pointer to a structure containing the broken out fields from a line in the file. The pointer points to a static area of memory which is overwritten by subsequent calls to getmntent(). The addmntent() function adds the mntent structure mnt to the end of the open file filep. The endmntent() function closes the file system description file filep. The hasmntopt() function scans the mnt_opts field (see below) of the mntent structure mnt for a substring that matches opt. See <mntent.h> for valid mount options. The mntent structure is defined in <mntent.h> as follows: struct mntent { char *mnt_fsname; /* name of mounted file system */ char *mnt_dir; /* file system path prefix */ char *mnt_type; /* mount type (see mntent.h) */ char *mnt_opts; /* mount options (see mntent.h) */ int mnt_freq; /* dump frequency in days */ int mnt_passno; /* pass number on parallel fsck */ }; RETURN VALUE
The getmntent() function returns a pointer to the mntent structure or NULL on failure. The addmntent() function returns 0 on success and 1 on failure. The endmntent() function always returns 1. The hasmntopt() function returns the address of the substring if a match is found and NULL otherwise. FILES
/etc/fstab file system description file /etc/mtab mounted file system description file CONFORMING TO
SunOS 4.1.3. NOTES
SysV also has a getmntent() function but the calling sequence differs, and the returned structure is different. Under SysV /etc/mnttab is used. BSD 4.4 and Digital Unix have a routine getmntinfo(), a wrapper around the system call getfsstat(). SEE ALSO
fopen(3), fstab(5) 1993-06-27 GETMNTENT(3)
All times are GMT -4. The time now is 01:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy