HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: statvfs systemcall
Operating System - Linux
1828174
Members
2630
Online
109975
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2008 09:41 PM
06-09-2008 09:41 PM
statvfs systemcall
Hi,
Call statvfs() on an existing file. Check file system block and inode counts. Check file system ID.
Solution:
=========
#define ExistingFile "/shwetha/readme.htm"
strcpy(DirectoryName,ExistingFile);
fd = statvfs(DirectoryName,&buf);
perror("1.Systemcall statvfs failed on ExistingFile\n");
}
else {
fprintf (stdout,"Systemcall statvfs Success on ExistingFile\n");
if(buf.f_blocks & buf.f_files & buf.f_fsid) {
fprintf (stdout, "successfully verified the the file system block, inode c
ount and file system ID \n");
}
else {
perror ("Failed to verify the the file system block, inode count and file
system ID\n");
}
}
The testcase for checking the file system block , inode counts,file system ID the logic which i used is with & operator.
i think this logic is wrong..
Please let me know how to do this..
Thanks in Advance,
shwetha
Call statvfs() on an existing file. Check file system block and inode counts. Check file system ID.
Solution:
=========
#define ExistingFile "/shwetha/readme.htm"
strcpy(DirectoryName,ExistingFile);
fd = statvfs(DirectoryName,&buf);
perror("1.Systemcall statvfs failed on ExistingFile\n");
}
else {
fprintf (stdout,"Systemcall statvfs Success on ExistingFile\n");
if(buf.f_blocks & buf.f_files & buf.f_fsid) {
fprintf (stdout, "successfully verified the the file system block, inode c
ount and file system ID \n");
}
else {
perror ("Failed to verify the the file system block, inode count and file
system ID\n");
}
}
The testcase for checking the file system block , inode counts,file system ID the logic which i used is with & operator.
i think this logic is wrong..
Please let me know how to do this..
Thanks in Advance,
shwetha
- Tags:
- statvfs
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2008 11:08 PM
06-09-2008 11:08 PM
Re: statvfs systemcall
>Call statvfs() on an existing file.
This looks like an exam or homework question. This forum is not for those questions.
>the logic which i used is with & operator.
Yes, "&" is the wrong operator. Perhaps you want to use "&&" for logical AND. But checking for non-zero doesn't really "verify" anything.
This looks like an exam or homework question. This forum is not for those questions.
>the logic which i used is with & operator.
Yes, "&" is the wrong operator. Perhaps you want to use "&&" for logical AND. But checking for non-zero doesn't really "verify" anything.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2008 03:49 AM
06-10-2008 03:49 AM
Re: statvfs systemcall
HI:
As Dennis noted, checking a non-zero return status doesn't provide a great amount of information. You would be better to use 'strerror()' and 'errno' to be able to relate errors to those documented in the manpages for 'statvfs()' :
http://www.docs.hp.com/en/B3921-60631/statvfs.2.html
Regards!
...JRF...
As Dennis noted, checking a non-zero return status doesn't provide a great amount of information. You would be better to use 'strerror()' and 'errno' to be able to relate errors to those documented in the manpages for 'statvfs()' :
http://www.docs.hp.com/en/B3921-60631/statvfs.2.html
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2008 12:05 PM
06-10-2008 12:05 PM
Re: statvfs systemcall
>JRF: checking a non-zero return status doesn't provide a great amount of information
I wasn't talking about the return status since that wasn't in the above fragment. (A bug)
I was pointing out this if:
if(buf.f_blocks & buf.f_files & buf.f_fsid) {
I wasn't talking about the return status since that wasn't in the above fragment. (A bug)
I was pointing out this if:
if(buf.f_blocks & buf.f_files & buf.f_fsid) {
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP