pqueue logic error

Dario ddario at tiscalinet.it
Sat Oct 30 20:49:18 CEST 2004


Dear developers,

I solved the problem, it was a my fault. 
I didn't use the right oflag (O_CREAT) when I was trying to open the queue for 
the first time.

Anyway, I found that there are some limits in rtai_mq.h, Specifically the 
follows:

#define MAX_MSGSIZE     50      /* Maximum message size per queue (bytes) */
#define MAX_MSGS        10      /* Maximum number of messages per queue */

How can I increase them?

Best regards

Dario

Alle 23:38, giovedì 28 ottobre 2004, Dario ha scritto:

> Dear developers,
>
> I wrote a basic and dummy program with pqueues:
>
> <START CODE>
> #include <unistd.h>
> #include <sched.h>
> //#include <signal.h>
> #define KEEP_STATIC_INLINE
> #include <rtai_lxrt.h>
> #include <fcntl.h>
> #include <rtai_mq.h>
>
> int main (void)
> {
>   RT_TASK* task;
>   if(!(task =
> rt_task_init_schmod(nam2num("PROVA1"),99,0,0,SCHED_FIFO,0x1))) return -1;
>   rt_set_oneshot_mode();
>   start_rt_timer(0);
>   struct mq_attr my_attrs = { 0, 0, 0, 0};
>   mode_t my_mode = 0;
>   mqd_t my_q = INVALID_PQUEUE;
>   my_q = mq_open("my_queue1", O_RDONLY, my_mode, &my_attrs);
>   sleep(90);
> }
> </END CODE>
>
> I run it after insmod rtai_hal, rtai_malloc, rtai_lxrt, rtai_sem, rtai_mq.
>
> But if I do a "cat /proc/rtai/pqueue" this is the output:
>
> RTAI Posix Queue Status
> -----------------------
>
> MAX_PQUEUES =  4 (system wide)
> MQ_OPEN_MAX =  8 (per RT task)
> MQ_NAME_MAX = 80
>
> ID  NOpen  NMsgs  MaxMsgs  MaxSz  Perms  Del  Name
> ---------------------------------------------------------------------------
>----- $
>
> NO queue!
>
> I'm using kilaueua RTAi.
>
> Please could you say me where I'm wrong?
>
> Best regards
>
> Dario
>
> _______________________________________________
> RTAI mailing list
> RTAI at rtai.org
> https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai





More information about the Rtai mailing list