• 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
Re: [darwin-dev] n00b uiomove64 question, Was: Where is uwritec ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [darwin-dev] n00b uiomove64 question, Was: Where is uwritec ?


  • Subject: Re: [darwin-dev] n00b uiomove64 question, Was: Where is uwritec ?
  • From: Alexander von Below <email@hidden>
  • Date: Mon, 1 Oct 2007 01:44:02 +0200

Thanks, it had not been answered!

Keeping state and returning 0 bytes works like intended!

Alex

Am 01.10.2007 um 01:27 schrieb Justin C. Walker:


On Sep 30, 2007, at 7:03 PM, Alexander von Below wrote:

Hello List,

I have another, hopefully simple question:

How can I signal that there is no more data to transfer? All I want at this point is to transfer a certain number of characters per read. My implementation of read looks somewhat like this:

	int len;
	char buf[1024];

	len = snprintf(buf, 1024, "Hello World\n");

	error = uiomove64((unsigned long long)buf, len, uio);

When I do cat /dev/mydevice, I get an ever-repeating "Hello World", until I cancel with CTRL-C. How can I signal EOF?

My mail is squirrelly so I don't know whether this has been answered (so this is off-list). Your read routine has to keep state: once it's been called (for a particular "session" if you keep track of that), you change state, and the next time, return 0 bytes.


Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Absorption of Federal Funds
--------
If you're not confused,
You're not paying attention
--------




_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >[darwin-dev] Where is uwritec ? (From: Alexander von Below <email@hidden>)
 >Re: [darwin-dev] Where is uwritec ? (From: Terry Lambert <email@hidden>)
 >Re: [darwin-dev] Where is uwritec ? (From: Alexander von Below <email@hidden>)
 >Re: [darwin-dev] Where is uwritec ? (From: Terry Lambert <email@hidden>)
 >[darwin-dev] n00b uiomove64 question, Was: Where is uwritec ? (From: Alexander von Below <email@hidden>)

  • Prev by Date: [darwin-dev] n00b uiomove64 question, Was: Where is uwritec ?
  • Previous by thread: [darwin-dev] n00b uiomove64 question, Was: Where is uwritec ?
  • Next by thread: Re: Darwin-dev Digest, Vol 4, Issue 207
  • Index(es):
    • Date
    • Thread