Kernel API *get_super (struct block_device *bdev) producing error with Fedora Core 5
Dear All,
Below is a test program, with error produced.I understand that block_device pointer *bd sholuld get initialized.Program should produce initialization error for *bd. Compiler is producing '->'.I am not understanding why ?
Can anybody help me to get this program working fine ?
I have doubt of its working in user space as this program is accessing the kernel resources.
If anybody can provide me working code would be a great help, just to initiate things.Just a working this or any other kernel-API Code, would be a great help.
[#include<stdio.h>
#include</usr/include/sys/vfs.h>
int main()
{
//struct super_block * get_super (struct block_device *bdev);
struct block_device *bd;
printf("Block size in bytes = %ld",*get_super(bd)->s_blocksize);
}]
error:
sp.c: In function ‘main’:
sp.c:7: error: invalid type argument of ‘->’
Thanks & Regards.
ankur
Last edited by ankur0921; 02-02-2011 at 12:19 AM.
|