From: Jeff Webb <jeff.webb@domain.hid>
To: Xenomai help <xenomai@xenomai.org>
Subject: [Xenomai-help] read returns more bytes than requested?
Date: Mon, 11 Sep 2006 17:45:45 -0500 [thread overview]
Message-ID: <4505E719.3030405@domain.hid> (raw)
I am having some success porting my RTLinux application, but I have encountered a strange error.
I have this snippet of code that is reading data from an rtai-skin FIFO:
result = read(runtime2io_fd, &resp, sizeof(resp));
if (result != sizeof(resp))
{
printf("requested %d bytes, got %d\n", sizeof(resp), result);
snprintf(err_str, MAX_STR_LEN, "cannot read response from %s",
RUNTIME2IO_FIFO_DEV);
sim_halt(err_str);
return;
}
I get the following output:
requested 312 bytes, got 1220
halting the sim: cannot read response from /dev/rtf1
I didn't think that a read could return more bytes than was requested. Does anyone understand this behaviour? This is code that works under RT-Linux. I am trying to determine why it is working differently under xenomai.
-Jeff
next reply other threads:[~2006-09-11 22:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-11 22:45 Jeff Webb [this message]
2006-09-12 7:18 ` [Xenomai-help] read returns more bytes than requested? Philippe Gerum
2006-09-14 13:09 ` Philippe Gerum
2006-09-14 19:12 ` Jeff Webb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4505E719.3030405@domain.hid \
--to=jeff.webb@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.