public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/vineet/arc-port-latest] tst-cancel4: deal with ENOSYS errors
@ 2020-07-09 16:33 Vineet Gupta
  0 siblings, 0 replies; only message in thread
From: Vineet Gupta @ 2020-07-09 16:33 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f9cf87353772ca370b7bb901d86365a564fba49f

commit f9cf87353772ca370b7bb901d86365a564fba49f
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Jul 5 19:21:45 2020 +0200

    tst-cancel4: deal with ENOSYS errors
    
    The Hurd port doesn't have support for sigwaitinfo, sigtimedwait, and msgget
    yet, so let us ignore the test for these when they return ENOSYS.
    
    * nptl/tst-cancel4.c (tf_sigwaitinfo): Fallback on sigwait when
    sigwaitinfo returns ENOSYS.
    (tf_sigtimedwait): Likewise with sigtimedwait.
    (tf_msgrcv, tf_msgsnd): Fallback on tf_usleep when msgget returns ENOSYS.

Diff:
---
 nptl/tst-cancel4.c | 42 ++++++++++++++++++++++++++++++++++++++----
 1 file changed, 38 insertions(+), 4 deletions(-)

diff --git a/nptl/tst-cancel4.c b/nptl/tst-cancel4.c
index be7a48e253..5250a30b2e 100644
--- a/nptl/tst-cancel4.c
+++ b/nptl/tst-cancel4.c
@@ -607,7 +607,15 @@ tf_sigwaitinfo (void *arg)
   pthread_cleanup_push (cl, NULL);
 
   /* Wait for SIGUSR1.  */
-  sigwaitinfo (&mask, &info);
+  int ret;
+  ret = sigwaitinfo (&mask, &info);
+  if (ret == -1 && errno == ENOSYS)
+    {
+      int sig;
+
+      printf ("sigwaitinfo not supported\n");
+      sigwait (&mask, &sig);
+    }
 
   pthread_cleanup_pop (0);
 
@@ -634,7 +642,15 @@ tf_sigtimedwait (void *arg)
   struct timespec ts = { .tv_sec = 60, .tv_nsec = 0 };
   pthread_cleanup_push (cl, NULL);
 
-  sigtimedwait (&mask, &info, &ts);
+  int ret;
+  ret = sigtimedwait (&mask, &info, &ts);
+  if (ret == -1 && errno == ENOSYS)
+    {
+      int sig;
+      printf ("sigtimedwait not supported\n");
+
+      sigwait (&mask, &sig);
+    }
 
   pthread_cleanup_pop (0);
 
@@ -1459,7 +1475,16 @@ tf_msgrcv (void *arg)
 {
   tempmsg = msgget (IPC_PRIVATE, 0666 | IPC_CREAT);
   if (tempmsg == -1)
-    FAIL_EXIT1 ("msgget (IPC_PRIVATE, 0666 | IPC_CREAT): %m");
+    {
+      if (errno == ENOSYS)
+	{
+	  printf ("msgget not supported\n");
+	  tf_usleep (arg);
+	  pthread_exit (NULL);
+	}
+      else
+	FAIL_EXIT1 ("msgget (IPC_PRIVATE, 0666 | IPC_CREAT): %m");
+    }
 
   xpthread_barrier_wait (&b2);
 
@@ -1505,7 +1530,16 @@ tf_msgsnd (void *arg)
 
   tempmsg = msgget (IPC_PRIVATE, 0666 | IPC_CREAT);
   if (tempmsg == -1)
-    FAIL_EXIT1 ("msgget (IPC_PRIVATE, 0666 | IPC_CREAT): %m");
+    {
+      if (errno == ENOSYS)
+	{
+	  printf ("msgget not supported\n");
+	  tf_usleep (arg);
+	  pthread_exit (NULL);
+	}
+      else
+	FAIL_EXIT1 ("msgget (IPC_PRIVATE, 0666 | IPC_CREAT): %m");
+    }
 
   xpthread_barrier_wait (&b2);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-09 16:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09 16:33 [glibc/vineet/arc-port-latest] tst-cancel4: deal with ENOSYS errors Vineet Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).