/* Test message queue passing.
- Copyright (C) 2004-2014 Free Software Foundation, Inc.
+ Copyright (C) 2004-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
+#include <support/check.h>
#include "tst-mqueue.h"
static void
{
}
-#define TIMEOUT 10
#define TEST_FUNCTION do_test ()
static int
do_test (void)
if (q == (mqd_t) -1)
{
+ if (errno == ENOSYS)
+ FAIL_UNSUPPORTED ("mq_open not supported");
+
printf ("mq_open failed with: %m\n");
- return result;
+ return 1;
}
- else
- add_temp_mq (name);
+
+ add_temp_mq (name);
mqd_t q2 = mq_open (name, O_CREAT | O_EXCL | O_RDWR, 0600, &attr);
if (q2 != (mqd_t) -1)
if (mq_unlink ("/tst-mqueue2-which-should-never-exist") != -1)
{
- puts ("mq_unlink of non-existant message queue unexpectedly succeeded");
+ puts ("mq_unlink of non-existent message queue unexpectedly succeeded");
result = 1;
}
else if (errno != ENOENT)
{
- printf ("mq_unlink of non-existant message queue did not fail with "
+ printf ("mq_unlink of non-existent message queue did not fail with "
"ENOENT: %m\n");
result = 1;
}