diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-07-06 22:12:11 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-09-08 21:10:27 +0200 |
| commit | 2adbeb903b431cf4bffcf29a6856eaba30581c22 (patch) | |
| tree | 337f4323364d711fc2513a2a41690932ae8d4465 /src/main.c | |
| parent | c849930b5319373978180569506180570320e978 (diff) | |
| download | wnix-2adbeb903b431cf4bffcf29a6856eaba30581c22.tar.gz | |
Setup aio skeleton
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -16,10 +16,31 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +#include <aio.h> +#include <errno.h> +#include <stdio.h> #include <stdlib.h> +#include <string.h> int main(void) { - int ret = EXIT_SUCCESS; + int ret = EXIT_FAILURE; + struct aio *aio = aio_open("/media/cdrom/", "rb"); + + if (!aio) + { + fprintf(stderr, "%s: aio_open failed: %s\n", __func__, strerror(errno)); + goto end; + } + + ret = EXIT_SUCCESS; + +end: + if (aio && aio_close(aio)) + { + fprintf(stderr, "%s: aio_close failed: %s\n", __func__, strerror(errno)); + ret = EXIT_FAILURE; + } + return ret; } |
