aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2025-07-06 22:12:11 +0200
committerXavier Del Campo Romero <xavi92@disroot.org>2025-09-08 21:10:27 +0200
commit2adbeb903b431cf4bffcf29a6856eaba30581c22 (patch)
tree337f4323364d711fc2513a2a41690932ae8d4465 /src/main.c
parentc849930b5319373978180569506180570320e978 (diff)
downloadwnix-2adbeb903b431cf4bffcf29a6856eaba30581c22.tar.gz
Setup aio skeleton
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 09c1f21..99d4c95 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
}