Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3981 - Error using POSIX mqueue on Arduino Yun Rev 2 LEDEyun 17.11 #8974

Open
openwrt-bot opened this issue Aug 17, 2021 · 0 comments
Open
Labels
flyspray kernel pull request/issue with Linux kernel related changes

Comments

@openwrt-bot
Copy link

yun:

Supply the following if possible:

  • Device problem occurs on: Arduino Yun Rev 2 (Atheros ar9331, mips architecture)

  • Software versions of OpenWrt/LEDE release, packages, etc.: Used this buildroot to cross-compile for LEDEYun 17.11 https://github.com/arduino/lede-yun

  • Steps to reproduce: Able to successfully compile c code that uses POSIX mqueue with above buildroot and toolchain, however after copying the executable over to the Yun I get thrown an error:
    "main:33: (mqd_t)-1 != mq: Function not implemented"

Example code that uses POSIX mqueue and throws the error when running on the yun:

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <mqueue.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include <fcntl.h>

#include "common.h"

int main(int argc, char **argv)
{
mqd_t mq;
struct mq_attr attr;
char buffer[MAX_SIZE + 1];
int must_stop = 0;

/* initialize the queue attributes */
attr.mq_flags = 0;
attr.mq_maxmsg = 10;
attr.mq_msgsize = MAX_SIZE;
attr.mq_curmsgs = 0;

/* create the message queue */
mq = mq_open(QUEUE_NAME, O_CREAT | O_RDONLY, 0644, &attr);
CHECK((mqd_t)-1 != mq);

do {
    ssize_t bytes_read;

    /* receive the message */
    bytes_read = mq_receive(mq, buffer, MAX_SIZE, NULL);
    CHECK(bytes_read >= 0);

    buffer[bytes_read] = '\0';
    if (! strncmp(buffer, MSG_STOP, strlen(MSG_STOP)))
    {
        must_stop = 1;
    }
    else
    {
        printf("Received: %s\n", buffer);
    }
} while (!must_stop);

/* cleanup */
CHECK((mqd_t)-1 != mq_close(mq));
CHECK((mqd_t)-1 != mq_unlink(QUEUE_NAME));

return 0;

}

@aparcar aparcar added the kernel pull request/issue with Linux kernel related changes label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray kernel pull request/issue with Linux kernel related changes
Projects
None yet
Development

No branches or pull requests

2 participants