]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - rt/tst-aio.c
malloc: set NON_MAIN_ARENA flag for reclaimed memalign chunk (BZ #30101)
[thirdparty/glibc.git] / rt / tst-aio.c
index 9ca377546f181dc47383784525a668d6daa2bb3b..d8b0788f2e7766fe8f3b803f75caa0c4c21cc380 100644 (file)
@@ -1,7 +1,6 @@
 /* Tests for AIO in librt.
-   Copyright (C) 1998-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-2023 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -15,7 +14,7 @@
 
    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 <aio.h>
 #include <errno.h>
@@ -34,9 +33,6 @@ extern int do_test (int argc, char *argv[]);
 /* We have a preparation function.  */
 #define PREPARE do_prepare
 
-/* We might need a bit longer timeout.  */
-#define TIMEOUT 20 /* sec */
-
 /* This defines the `main' function and some more.  */
 #include <test-skeleton.c>
 
@@ -51,7 +47,7 @@ do_prepare (int argc, char *argv[])
   size_t name_len;
 
   name_len = strlen (test_dir);
-  name = malloc (name_len + sizeof ("/aioXXXXXX"));
+  name = xmalloc (name_len + sizeof ("/aioXXXXXX"));
   mempcpy (mempcpy (name, test_dir, name_len),
           "/aioXXXXXX", sizeof ("/aioXXXXXX"));
 
@@ -278,7 +274,7 @@ do_test (int argc, char *argv[])
   for (cnt = 10; cnt > 0; )
     if (aio_cancel (fd, cbp[--cnt]) == -1)
       /* This is not an error.  The request can simply be finished.  */
-      printf ("aio_cancel (fd, cbp[%Zd]) cannot be canceled\n", cnt);
+      printf ("aio_cancel (fd, cbp[%zd]) cannot be canceled\n", cnt);
   puts ("finished2");
 
   result |= do_wait (cbp, 10, ECANCELED);