If you want a simple application, I suggest you take a look at " dd ". I came as part of the GNU Core Utility . Its source is available for download. Take a look at his homepage here .
If you want to achieve this from C code, refer to the following code. Hope this helps you. :)
#include <stdio.h>
#include <linux/fs.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define SECTOR_NO 10
int main()
{
int sector_size;
char *buf;
int n = SECTOR_NO;
int fd = open("/dev/sda1", O_RDONLY|O_NONBLOCK);
ioctl(fd, BLKSSZGET, §or_size);
printf("%d\n", sector_size);
lseek(fd, n*sector_size, SEEK_SET);
buf = malloc(sector_size);
read(fd, buf, sector_size);
return 0;
}