userspace/libc_test: add test functions for various libc components

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
2025-01-28 11:42:28 +02:00
parent cbe651d2da
commit 1b55332027
22 changed files with 144 additions and 1 deletions

View File

@ -16,3 +16,11 @@
*/
#include <errno.h>
int test___errno_location(void)
{
(*__errno_location()) = ENOENT;
if ((*__errno_location()) != ENOENT)
return 1;
return 0;
}

View File

@ -16,3 +16,11 @@
*/
#include <errno.h>
int test_strerror(void)
{
char *enosys = strerror(ENOSYS);
if (enosys == ((void *)0))
return -1;
return 0;
}