about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'nptl')
-rw-r--r--nptl/tst-cancel4.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/nptl/tst-cancel4.c b/nptl/tst-cancel4.c
index f3c4b0c2be..60f7eada90 100644
--- a/nptl/tst-cancel4.c
+++ b/nptl/tst-cancel4.c
@@ -1600,6 +1600,52 @@ tf_preadv (void *arg)
 }
 
 static void *
+tf_pwritev (void *arg)
+{
+  int fd;
+  int r;
+
+  if (arg == NULL)
+    /* XXX If somebody can provide a portable test case in which pwritev
+       blocks we can enable this test to run in both rounds.  */
+    abort ();
+
+  char fname[] = "/tmp/tst-cancel4-fd-XXXXXX";
+  tempfd = fd = mkstemp (fname);
+  if (fd == -1)
+    printf ("%s: mkstemp failed\n", __FUNCTION__);
+  unlink (fname);
+
+  r = pthread_barrier_wait (&b2);
+  if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
+    {
+      printf ("%s: barrier_wait failed\n", __FUNCTION__);
+      exit (1);
+    }
+
+  r = pthread_barrier_wait (&b2);
+  if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
+    {
+      printf ("%s: barrier_wait failed\n", __FUNCTION__);
+      exit (1);
+    }
+
+  ssize_t s;
+  pthread_cleanup_push (cl, NULL);
+
+  char buf[WRITE_BUFFER_SIZE];
+  memset (buf, '\0', sizeof (buf));
+  struct iovec iov[1] = { [0] = { .iov_base = buf, .iov_len = sizeof (buf) } };
+  s = pwritev (fd, iov, 1, 0);
+
+  pthread_cleanup_pop (0);
+
+  printf ("%s: pwritev returns with %zd\n", __FUNCTION__, s);
+
+  exit (1);
+}
+
+static void *
 tf_fsync (void *arg)
 {
   if (arg == NULL)
@@ -2185,6 +2231,7 @@ static struct
   ADD_TEST (recvfrom, 2, 0),
   ADD_TEST (recvmsg, 2, 0),
   ADD_TEST (preadv, 2, 1),
+  ADD_TEST (pwritev, 2, 1),
   ADD_TEST (open, 2, 1),
   ADD_TEST (close, 2, 1),
   ADD_TEST (pread, 2, 1),