mirror of
https://github.com/Fennix-Project/Userspace.git
synced 2025-05-25 22:14:28 +00:00
Update libc
This commit is contained in:
parent
a003ec0889
commit
68e65dd602
28
.vscode/c_boilerplates.code-snippets
vendored
Normal file
28
.vscode/c_boilerplates.code-snippets
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"Fennix Kernel Header": {
|
||||
"prefix": [
|
||||
"head",
|
||||
],
|
||||
"body": [
|
||||
"#ifndef __FENNIX_LIBC_${2:header}_H__",
|
||||
"#define __FENNIX_LIBC_${2:header}_H__",
|
||||
"",
|
||||
"#include <types.h>",
|
||||
"",
|
||||
"$0",
|
||||
"",
|
||||
"#endif // !__FENNIX_LIBC_${2:header}_H__",
|
||||
""
|
||||
],
|
||||
"description": "Create kernel header."
|
||||
},
|
||||
"Fennix Kernel brief": {
|
||||
"prefix": [
|
||||
"brief",
|
||||
],
|
||||
"body": [
|
||||
"/** @brief $0 */"
|
||||
],
|
||||
"description": "Create kernel documentation brief."
|
||||
}
|
||||
}
|
26
.vscode/c_cpp_properties.json
vendored
Normal file
26
.vscode/c_cpp_properties.json
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Linux",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/libc/include/**",
|
||||
"${workspaceFolder}/out/system/include**"
|
||||
],
|
||||
"defines": [
|
||||
"__debug_vscode__",
|
||||
"GIT_COMMIT=\"0000000000000000000000000000000000000000\"",
|
||||
"GIT_COMMIT_SHORT=\"0000000\"",
|
||||
"DEBUG=\"1\""
|
||||
],
|
||||
"compilerPath": "/usr/bin/gcc",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++20",
|
||||
"intelliSenseMode": "gcc-x64",
|
||||
"configurationProvider": "ms-vscode.makefile-tools",
|
||||
"compilerArgs": [
|
||||
"-pipe",
|
||||
]
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
@ -7,7 +7,8 @@
|
||||
"settings": {
|
||||
"debug.allowBreakpointsEverywhere": true,
|
||||
"files.associations": {
|
||||
"fex.hpp": "c"
|
||||
"fex.hpp": "c",
|
||||
"types.h": "c"
|
||||
}
|
||||
}
|
||||
}
|
1
Makefile
1
Makefile
@ -2,6 +2,7 @@ build:
|
||||
mkdir -p out
|
||||
mkdir -p out/system
|
||||
mkdir -p out/system/lib
|
||||
mkdir -p out/system/include
|
||||
make --quiet -C libc build
|
||||
make --quiet -C apps build
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
build:
|
||||
cp include/* ../out/system/include
|
||||
make --quiet -C runtime build
|
||||
make --quiet -C libgcc build
|
||||
make --quiet -C src build
|
||||
|
11
libc/include/dlfcn.h
Normal file
11
libc/include/dlfcn.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef __FENNIX_LIBC_DLFCN_H__
|
||||
#define __FENNIX_LIBC_DLFCN_H__
|
||||
|
||||
#include <types.h>
|
||||
|
||||
void *dlopen(const char *filename, int flags);
|
||||
void *dlsym(void *handle, const char *symbol);
|
||||
int dlclose(void *handle);
|
||||
char *dlerror(void);
|
||||
|
||||
#endif // !__FENNIX_LIBC_DLFCN_H__
|
@ -0,0 +1,6 @@
|
||||
#ifndef __FENNIX_LIBC_TYPES_H__
|
||||
#define __FENNIX_LIBC_TYPES_H__
|
||||
|
||||
#define NULL ((void *)0)
|
||||
|
||||
#endif // !__FENNIX_LIBC_TYPES_H__
|
0
libc/runtime/crti.c
Normal file
0
libc/runtime/crti.c
Normal file
0
libc/runtime/crtn.c
Normal file
0
libc/runtime/crtn.c
Normal file
23
libc/src/dlfcn.c
Normal file
23
libc/src/dlfcn.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include <dlfcn.h>
|
||||
|
||||
static char *error = "Not implemented";
|
||||
|
||||
__attribute__((weak)) void *dlopen(const char *filename, int flags)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
__attribute__((weak)) void *dlsym(void *handle, const char *symbol)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
__attribute__((weak)) int dlclose(void *handle)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
__attribute__((weak)) char *dlerror(void)
|
||||
{
|
||||
return error;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user