• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
pread function help needed....?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How do I read sectors of disk in objective c cocoa application?
      • From: Martin mahal Halter <email@hidden>
    • Re: pread function help needed....?
      • From: Wenguang Wang <email@hidden>
    • Re: pread function help needed....?
      • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Prev by Date: Re: How do I read sectors of disk in objective c cocoa application?
  • Next by Date: Re: pread function help needed....?
  • Previous by thread: Re: How do I read sectors of disk in objective c cocoa application?
  • Next by thread: Re: pread function help needed....?
  • Index(es):
    • Date
    • Thread