We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

Omega 2 and mqueue (Messaging)



  • Hi -

    I have just received my Onion Omega 2 and trying to run some of my apps on it.
    I write apps the rely on mqueue for communications between threads. mqueue is usually provided for different distros of embedded Linux/derivatives: Ubuntu, Debian QNX etc.
    For the Omega distro, mqueue seems to be missing? Does anyone know how to compile/link support for this and/or add support to the Linux version coming with Omega. I find that mqueue is an important tool in communication.

    Any help would be much appreciated! Thanks to everyone that provides the excellent tool chains for the new Omega! Much appreciated!

    Thanks,,

    Michael



  • Some more info.
    The error received on Onion is:
    ENOSYS : "Function not implemented"

    Compiling, linking and running the same application for Ubuntu 64 bit on VM works using the following:
    g++ *.cpp -Wall -lrt -v

    #include <errno.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <sys/types.h> 
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <mqueue.h>
    
    int main (int argc, char* argv[])
    {
    mqd_t mq;
    struct mq_attr attr;
    
    // Initialize the queue attributes
    attr.mq_flags = 0;
    attr.mq_maxmsg = 50;
    attr.mq_msgsize = 2048; //MAX_SIZE;
    attr.mq_curmsgs = 0;
    
    // Create the message queue
    mq = mq_open("/mq", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); 
    
    if (((mqd_t)-1 == mq))
    {
    	int errnum = errno;
    	printf("main(): Failed creating message Queue: %d, %s!\n", errnum, strerror(errnum));
    	exit(1);
    }
    
    // Cleanup Message Queue
    mq_close(mq);
    mq_unlink("/mq");
    
     return 0; 
    

    }


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.