From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server-vie001.gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_DBL_BLOCKED_OPENDNS, URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1740062093; bh=LcSlaUKd8gp4f67QCYONctlj5MrgKx7MxQCQ8IbGlws=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:Message-ID:Date:From:Reply-To:Subject:To: Cc:In-Reply-To:References:Resent-Date:Resent-From:Resent-To: Resent-Cc:User-Agent:Content-Type:Content-Transfer-Encoding; b=LV6b5JX3cwKegcP8ZA3zOd5pVdDqr7uvtIxZaxB1WGM3XuRTliTErn6yKSG8cfILB DXU6pGL0KlIFlsCVs1bb7wrtfNLNAtmhS7gYjivWIQCLiJcZrdfynB+B5uO63LdRYL ji1B5i4gRc3icHDpxLB1RfvdKhEn7WNDgCzJJaqCMq1tIdXre1kpxfTB1GBP0DbFl4 4D/Jux9yIDtuCUXdnl3SwhE4GMAt3/K8jkqfS0jmAG4nD+q4sAbJ/w5G3HSkP3cRu+ +NgQcJz2gBAyKCbw6dxHtZtStqzL/birU9/9kImd7c2wD/fAnEkIB8G6+cbsGE/p9X e1DROzYDXnctA== Received: from integral2.. (unknown [182.253.126.96]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id D34DB20744A3; Thu, 20 Feb 2025 14:34:50 +0000 (UTC) From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Alviro Iskandar Setiawan , io-uring Mailing List , Linux Kernel Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 0/3] Fix Compilation Error on Android and Some Cleanup Date: Thu, 20 Feb 2025 21:34:19 +0700 Message-Id: <20250220143422.3597245-1-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Hi Jens, Another day in the thrilling world of cross-platform compatibility... Alviro discovered that some Android versions are missing `aligned_alloc()` in ``, 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 Signed-off-by: Ammar Faizi --- 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