From cd9c1ead26ec0c0ab590cc570862e6d5d99195ed Mon Sep 17 00:00:00 2001 From: GrapheneCt Date: Tue, 21 Jul 2020 17:39:17 -0400 Subject: Add async IO functions for userland All credits go to https://github.com/GrapheneCt/ --- include/user/kernel/iofilemgr/dirent.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'include/user/kernel/iofilemgr/dirent.h') diff --git a/include/user/kernel/iofilemgr/dirent.h b/include/user/kernel/iofilemgr/dirent.h index e343910..1d06ffd 100644 --- a/include/user/kernel/iofilemgr/dirent.h +++ b/include/user/kernel/iofilemgr/dirent.h @@ -1,6 +1,7 @@ #ifndef _DOLCESDK_PSP2_KERNEL_IOFILEMGR_DIRENT_H_ #define _DOLCESDK_PSP2_KERNEL_IOFILEMGR_DIRENT_H_ +#include #include #ifdef __cplusplus @@ -51,6 +52,37 @@ int sceIoDclose(SceUID fd); */ int sceIoDread(SceUID fd, SceIoDirent *buf); +/** + * Open a directory (asynchronous) + * + * @param dirname - The directory to open for reading. + * @param asyncParam - parameters related to async operation. + * + * @return If >= 0 then a valid op handle, otherwise a Sony error code. + */ +SceUID sceIoDopenAsync(const char *dirname, SceIoAsyncParam* asyncParam); + +/** + * Reads an entry from an opened file descriptor (asynchronous) + * + * @param fd - Already opened file descriptor (using ::sceIoDopen or ::sceIoDopenAsync) + * @param dir - Pointer to a ::SceIoDirent structure to hold the file information + * @param asyncParam - parameters related to async operation. + * + * @return If >= 0 then a valid op handle, otherwise a Sony error code. + */ +SceUID sceIoDreadAsync(SceUID fd, SceIoDirent *dir, SceIoAsyncParam* asyncParam); + +/** + * Close an opened directory file descriptor (asynchronous) + * + * @param fd - Already opened file descriptor (using ::sceIoDopen or ::sceIoDopenAsync) + * @param asyncParam - parameters related to async operation. + * + * @return If >= 0 then a valid op handle, otherwise a Sony error code. + */ +SceUID sceIoDcloseAsync(SceUID fd, SceIoAsyncParam* asyncParam); + #ifdef __cplusplus } #endif -- cgit v1.2.3