public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH liburing v1 0/3] Fix Compilation Error on Android and Some Cleanup
@ 2025-02-20 14:34 Ammar Faizi
  2025-02-20 14:34 ` [PATCH liburing v1 1/3] liburing.h: Remove redundant double negation Ammar Faizi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ammar Faizi @ 2025-02-20 14:34 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Ammar Faizi, Alviro Iskandar Setiawan, io-uring Mailing List,
	Linux Kernel Mailing List, GNU/Weeb Mailing List

Hi Jens,

Another day in the thrilling world of cross-platform compatibility...

Alviro discovered that some Android versions are missing `aligned_alloc()`
in `<stdlib.h>`, leading to a compilation error on Termux 0.118.0:

```
cmd-discard.c:383:11: warning: call to undeclared library function \
'aligned_alloc' with type 'void *(unsigned long, unsigned long)'; ISO \
C99 and later do not support implicit function declarations \
[-Wimplicit-function-declaration]

        buffer = aligned_alloc(lba_size, lba_size);
                 ^
```

To resolve this without rewriting large portions of liburing tests,
introduce a helper function that wraps `posix_memalign()` and provides
our own `aligned_alloc()`.

While we're at it, there's a redundant double negation lurking in
`liburing.h`. Let's clean that up too.  

Also, to prevent yet another round of confusion like what happened in
PR #1336, document the history of `io_uring_get_sqe()` in the header
file.

Ref: https://github.com/axboe/liburing/pull/1336

Signed-off-by: Alviro Iskandar Setiawan <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---

Ammar Faizi (3):
  liburing.h: Remove redundant double negation
  liburing.h: Explain the history of `io_uring_get_sqe()`
  Fix missing `aligned_alloc()` on some Android devices

 examples/helpers.c     | 10 ++++++++++
 examples/helpers.h     |  7 +++++++
 examples/reg-wait.c    |  2 ++
 src/include/liburing.h | 21 ++++++++++++++++++++-
 test/helpers.c         | 10 ++++++++++
 test/helpers.h         |  8 ++++++++
 6 files changed, 57 insertions(+), 1 deletion(-)


base-commit: 66b071d1470ae787d47d4cb8d9cb3836249baf61
-- 
Ammar Faizi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-02-20 14:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20 14:34 [PATCH liburing v1 0/3] Fix Compilation Error on Android and Some Cleanup Ammar Faizi
2025-02-20 14:34 ` [PATCH liburing v1 1/3] liburing.h: Remove redundant double negation Ammar Faizi
2025-02-20 14:34 ` [PATCH liburing v1 2/3] liburing.h: Explain the history of `io_uring_get_sqe()` Ammar Faizi
2025-02-20 14:34 ` [PATCH liburing v1 3/3] Fix missing `aligned_alloc()` on some Android devices Ammar Faizi
2025-02-20 14:51 ` [PATCH liburing v1 0/3] Fix Compilation Error on Android and Some Cleanup Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox