pread function help needed....?
pread function help needed....?
- Subject: pread function help needed....?
- From: Waqar Ahmad <email@hidden>
- Date: Fri, 09 Dec 2011 13:05:26 +0500
Hi,
I used pread function to read disk0/disk1 sectors, but each time I change
the value of reading bytes it returns the same output plz check my program
below and tel me if there is any mistake....
#include <stdio.h>
#include "stdlib.h"
int main (int argc, const char * argv[]) {
// insert code here...
printf("Hello, World!\n");
int fd = open("/dev/rdisk0");
unsigned long byts=pread(fd, 1024, 1024, 0);
//unsigned long byts=pread(fd, 0, 512, 0);
//unsigned long byts=pread(fd, 512, 512, 0);
//unsigned long byts=pread(fd, 512, 0, 0);
//nbytes_got = pread(fd, buf, nbytes, off);
printf("byts = %lu", byts);
return 0;
}
OutPut:
Hello, World!
byts = 18446744073709551615
Regards,
Waqar Ahmad
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden