/* * Copyright (c) 2002, Intel Corporation. All rights reserved. * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. */ /* * Test that errno == EINVAL if msg_prio is >= MQ_PRIO_MAX or < 0 (<0 N/A * for an unsigned, so not tested). */ #include #include #include #include #include #include #include #include #include #include "posixtest.h" #define NAMESIZE 50 #define MSGSTR "0123456789" #define NUMINVALID 3 static unsigned invalidpri[NUMINVALID] = { MQ_PRIO_MAX, MQ_PRIO_MAX+1, MQ_PRIO_MAX+5 }; int main() { char qname[NAMESIZE]; const char *msgptr = MSGSTR; mqd_t queue; int unresolved=0, failure=0, i; sprintf(qname, "/mq_send_13-1_%d", getpid()); queue = mq_open(qname, O_CREAT |O_RDWR, S_IRUSR | S_IWUSR, NULL); if (queue == (mqd_t)-1) { perror("mq_open() did not return success"); return PTS_UNRESOLVED; } for (i=0; i