summary refs log tree commit diff
path: root/nptl/tst-cancel4.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2005-05-29 22:12:28 +0000
committerRoland McGrath <roland@gnu.org>2005-05-29 22:12:28 +0000
commit8074c5c597240ed9edccb9ba69ed11fb73fbf134 (patch)
tree23890ab3981a4af0e2e944cce636955ef5368376 /nptl/tst-cancel4.c
parent52ee639b3afc2e5efe5fddd736308eb667f52cb1 (diff)
downloadglibc-8074c5c597240ed9edccb9ba69ed11fb73fbf134.tar.gz
glibc-8074c5c597240ed9edccb9ba69ed11fb73fbf134.tar.xz
glibc-8074c5c597240ed9edccb9ba69ed11fb73fbf134.zip
* sysdeps/mach/i386/syscall.S (syscall): Call END.
Diffstat (limited to 'nptl/tst-cancel4.c')
-rw-r--r--nptl/tst-cancel4.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/nptl/tst-cancel4.c b/nptl/tst-cancel4.c
index c3e527fd1c..cb7619688e 100644
--- a/nptl/tst-cancel4.c
+++ b/nptl/tst-cancel4.c
@@ -84,6 +84,8 @@ static pthread_barrier_t b2;
 # define IPC_ADDVAL 0
 #endif
 
+#define WRITE_BUFFER_SIZE 4096
+
 /* Cleanup handling test.  */
 static int cl_called;
 
@@ -220,7 +222,7 @@ tf_write  (void *arg)
   ssize_t s;
   pthread_cleanup_push (cl, NULL);
 
-  char buf[100000];
+  char buf[WRITE_BUFFER_SIZE];
   memset (buf, '\0', sizeof (buf));
   s = write (fd, buf, sizeof (buf));
 
@@ -266,7 +268,7 @@ tf_writev  (void *arg)
   ssize_t s;
   pthread_cleanup_push (cl, NULL);
 
-  char buf[100000];
+  char buf[WRITE_BUFFER_SIZE];
   memset (buf, '\0', sizeof (buf));
   struct iovec iov[1] = { [0] = { .iov_base = buf, .iov_len = sizeof (buf) } };
   s = writev (fd, iov, 1);
@@ -2043,11 +2045,29 @@ static struct
 static int
 do_test (void)
 {
-  if (pipe (fds) != 0)
+  int val;
+  socklen_t len;
+
+  if (socketpair (AF_UNIX, SOCK_STREAM, PF_UNIX, fds) != 0)
+    {
+      perror ("socketpair");
+      exit (1);
+    }
+
+  val = 1;
+  len = sizeof(val);
+  setsockopt (fds[1], SOL_SOCKET, SO_SNDBUF, &val, sizeof(val));
+  if (getsockopt (fds[1], SOL_SOCKET, SO_SNDBUF, &val, &len) < 0)
+    {
+      perror ("getsockopt");
+      exit (1);
+    }
+  if (val >= WRITE_BUFFER_SIZE)
     {
-      puts ("pipe failed");
+      puts ("minimum write buffer size too large");
       exit (1);
     }
+  setsockopt (fds[1], SOL_SOCKET, SO_SNDBUF, &val, sizeof(val));
 
   int result = 0;
   size_t cnt;