> The rtt-sender makes use of Xenomai's POSIX-conforming real-time mqueues
> (=>POSIX skin). So you have to look for something comparable on RTAI,
> either some wrapper (there used to exists something, but I don't know
> its current status) or RTAI-specific message queuing functions.
>
rtai_mq
Paolo.
Hi!
I still have some problems with mq_open: this call brings to
Segmentation Fault.
I report the files and gdb-analysis...
Where i do wrong?
-------------------------------
------- prova. c ----------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <rtai_mq.h>
#include <errno.h>
#include <signal.h>
#include <rtai_lxrt.h>
#include <rtnet.h>
#include <time.h>
int main(){
mqd_t mq;
//struct sched_param param = { .sched_priority = 1 };
char mqname[16];
struct mq_attr mqattr;
int ret;
snprintf(mqname, sizeof(mqname), "rtt-sender-%d", getpid());
//debug
printf("Terminata la inizializzazione di nome di coda di messaggi\n");
mqattr.mq_flags = 0;
mqattr.mq_maxmsg = 100;
//mqattr.mq_msgsize = sizeof(struct packet_stats);
mqattr.mq_msgsize = sizeof(100);
mqattr.mq_curmsgs = 0;
//debug
printf("Terminata inizializzazione attributi della coda di messaggi\n");
//debug
//printf("Momento di chiamata della mq_open, tolta per prova\n");
mq = mq_open(mqname, O_RDWR | O_CREAT | O_EXCL, 0600, &mqattr);
//debug
printf("Terminata la mq_open\n");
//if (mq == (mqd_t)-1) {
if(mq<0){
perror("opening mqueue failed");
//close(sock);
return 1;
}
printf("mq_open andata a buon fine, programma terminato\n");
return 0;
}
***-------------***
----my compile-commands------
gcc -c -Wall -ggdb -o prova.o -I/usr/realtime/include -I/usr/src/rtnet/trunk/rtnet/stack/include prova.c
gcc -o prova -L/usr/realtime/lib -llxrt -lrtdm -lrt prova.o
(i got only a warning on variable ret not used)
***-------------***
-------lsmod at compile time and run time --------
rtai_mq
rtipv4
rtnet
rtai_rtdm
rtai_sem
rtai_lxrt
rtai_up
rtai_hal
(some rtnet modules are inserted from previous tests...)
***-------------***
----gdb command file-------------------------------
file prova
b rt_make_hard_real_time
b rt_return_linux_syscall
b rtai_lxrt
b getpid
b mq_open
***-------------***
---gdb output-----
[EMAIL PROTECTED] # gdb --exec=prova --command=breaks
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-slackware-linux".
Using host libthread_db library "/lib/tls/libthread_db.so.1".
Function "rt_make_hard_real_time" not defined.
Breakpoint 1 at 0x804879a: file rtai_lxrt.h, line 206.
Breakpoint 2 at 0x8048806: file rtai_lxrt.h, line 679.
Breakpoint 3 at 0x804879a: file rtai_lxrt.h, line 206.
Function "getpid" not defined.
Function "mq_open" not defined.
(gdb)
(gdb) b getpid
Function "getpid" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 4 (getpid) pending.
(gdb) b mq_open
Function "mq_open" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 5 (mq_open) pending.
(gdb) run
Starting program: /usr/src/rtnet_latest_version/trunk/rtnet/examples/xenomai/myposix/provamq2/prova
[Thread debugging using libthread_db enabled]
[New Thread -1209898688 (LWP 3469)]
Breakpoint 6 at 0xb7ec1cc0
Pending breakpoint "getpid" resolved
Breakpoint 7 at 0xb7f689b6
Pending breakpoint "mq_open" resolved
[Switching to Thread -1209898688 (LWP 3469)]
Breakpoint 6, 0xb7ec1cc0 in getpid () from /lib/tls/libc.so.6
(gdb) c
Continuing.
Terminata la inizializzazione di nome di coda di messaggi
Terminata inizializzazione attributi della coda di messaggi
Breakpoint 7, 0xb7f689b6 in mq_open () from /usr/realtime/lib/liblxrt.so.1
(gdb) backtrace
#0 0xb7f689b6 in mq_open () from /usr/realtime/lib/liblxrt.so.1
#1 0x08048731 in main () at prova.c:45
(gdb) c
Continuing.
Couldn't get registers: No such process.
(gdb) frame
No selected frame.
(gdb) backtrace
Cannot fetch general-purpose registers for thread -1209898688: generic error
(gdb) quit
The program is running. Exit anyway? (y or n) y
Quitting: thread_db_get_info: cannot get thread info: generic error
[EMAIL PROTECTED] #
[EMAIL PROTECTED] #
***-------------***
--
Teresa Noviello
Chiedersi Sempre:"Avro' il tempo di rifarlo?"
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ RTnet-users mailing list RTnet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rtnet-users