From: NZG <ngustavson@domain.hid>
To: xenomai@xenomai.org
Subject: [Xenomai-help] writing from NRT to a rt_pipe
Date: Thu, 7 Jun 2007 13:57:12 -0500 [thread overview]
Message-ID: <200706071357.12212.ngustavson@domain.hid> (raw)
When writing from NRT to a real time pile (open, write, close).
Are message boundaries preserved based upon the length of the write call?
It's not working for me. The code below returns success, but calling
err = rt_pipe_read(comp,k,sizeof(kommand_t),TM_NONBLOCK);
or
err = rt_pipe_read(comp,k,sizeof(kommand_t),100);
from RT space on the same pipe never returns any data
err = rt_pipe_read(comp,k,sizeof(kommand_t),TM_NONBLOCK);
always returns err
0x0b, Resource temporarily unavailable
err = rt_pipe_read(comp,k,sizeof(kommand_t),100);
always returns err:
0x6e, Connection timed out
NZG
code specifics follow...............
int err;
kommand_t k = {
.type = KILLCYCLE,
};
int cfd = open(COMMANDPIPE, O_WRONLY|O_SYNC);
if(cfd<0){
printf("can't open %s (%s)\n",COMMANDPIPE, strerror(-cfd));
fflush(stdout);
return;
}
printf("sizeof kommand_t = %u\n",sizeof(kommand_t));
err=write(cfd,&k,sizeof(kommand_t));
if(err>=0)printf("wrote %u bytes to %s\n",err,COMMANDPIPE);
if(err<0)printf("err writing to %s (%s)\n",COMMANDPIPE,
strerror(errno));
if(close(cfd)<0)printf("couldn't close %s\n",COMMANDPIPE);
next reply other threads:[~2007-06-07 18:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-07 18:57 NZG [this message]
2007-06-07 19:13 ` [Xenomai-help] writing from NRT to a rt_pipe NZG
2007-06-07 19:34 ` Philippe Gerum
2007-06-07 19:46 ` NZG
2007-06-07 19:51 ` NZG
2007-06-07 20:14 ` Philippe Gerum
2007-06-07 20:41 ` NZG
2007-06-07 22:09 ` [Xenomai-help] writing from NRT to a rt_pipe-> easy wait for completion NZG
2007-06-07 22:44 ` Philippe Gerum
2007-06-07 22:57 ` NZG
2007-06-07 19:33 ` [Xenomai-help] writing from NRT to a rt_pipe Philippe Gerum
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=200706071357.12212.ngustavson@domain.hid \
--to=ngustavson@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.