/* * Copyright (c) 2003, 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 mq_open() fails with EINVAL if O_CREAT was set in oflag, * attr != NULL, and either mq_maxmsg <= 0 or mq_msgsize <= 0. */ #include #include #include #include #include #include #include #include #include #include "posixtest.h" #define NAMESIZE 50 #define VALIDVAL 10 #define NUMTESTS 3 static int invalid_values[NUMTESTS] = { 0, -1, INT32_MIN }; int main() { char qname[NAMESIZE]; mqd_t queue; struct mq_attr attr; int i, failed=0; sprintf(qname, "/mq_open_25-1_%d", getpid()); // First, test for invalid maxmsg attr.mq_msgsize = VALIDVAL; for (i=0; i0) { printf("Test FAILED\n"); return PTS_FAIL; } printf("Test PASSED\n"); return PTS_PASS; }