[rtems-central commit] spec: Use posix_memalign()

Sebastian Huber sebh at rtems.org
Tue Apr 20 07:47:05 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    4f8869bde1f2c815abe38eecfaf2a80dca2f0e11
Changeset: http://git.rtems.org/rtems-central/commit/?id=4f8869bde1f2c815abe38eecfaf2a80dca2f0e11

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Apr 20 09:04:50 2021 +0200

spec: Use posix_memalign()

The aligned_alloc() depends on errno.

---

 spec/testsuites/validation/c-library.yml | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/spec/testsuites/validation/c-library.yml b/spec/testsuites/validation/c-library.yml
index e3c3cfb..0239e03 100644
--- a/spec/testsuites/validation/c-library.yml
+++ b/spec/testsuites/validation/c-library.yml
@@ -5,13 +5,20 @@ enabled-by: true
 links: []
 test-actions:
 - action-brief: |
-    Allocate four bytes with an alignment of 128 bytes with aligned_alloc().
+    Allocate four bytes with an alignment of 128 bytes with posix_memalign().
   action-code: |
     void *p;
+    int   eno;
 
-    p = aligned_alloc(128, 4);
+    p = (void *)(uintptr_t) 1;
+    eno = posix_memalign(&p, 128, 4);
   checks:
   - brief: |
+      Check that the returned status is zero.
+    code: |
+      T_step_eq_int(${step}, eno, 0);
+    links: []
+  - brief: |
       Check that the returned pointer is not NULL.
     code: |
       T_step_not_null(${step}, p);



More information about the vc mailing list