mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-19 00:46:31 +00:00
调整user下libs的libc目录结构 (#103)
* 调整user下libs的libc目录结构 * 修正.gitignore文件的问题 * 修复无法编译的问题 Co-authored-by: longjin <longjin@RinGoTek.cn>
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -12,4 +12,4 @@ user/sys_api_lib
|
|||||||
|
|
||||||
docs/_build
|
docs/_build
|
||||||
draft
|
draft
|
||||||
cppcheck.xml
|
cppcheck.xml
|
||||||
|
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
@ -159,7 +159,11 @@
|
|||||||
"completion.h": "c",
|
"completion.h": "c",
|
||||||
"fat32.h": "c",
|
"fat32.h": "c",
|
||||||
"irqflags.h": "c",
|
"irqflags.h": "c",
|
||||||
"dirent.h": "c"
|
"dirent.h": "c",
|
||||||
|
"cmd_help.h": "c",
|
||||||
|
"wait.h": "c",
|
||||||
|
"__libc__.h": "c",
|
||||||
|
"ctype.h": "c"
|
||||||
},
|
},
|
||||||
"C_Cpp.errorSquiggles": "Enabled",
|
"C_Cpp.errorSquiggles": "Enabled",
|
||||||
"esbonio.sphinx.confDir": "",
|
"esbonio.sphinx.confDir": "",
|
||||||
|
@ -18,4 +18,4 @@ API文档
|
|||||||
api-list/unistd
|
api-list/unistd
|
||||||
|
|
||||||
这里是所有libc头文件的集合,在代码里可以这样引用:
|
这里是所有libc头文件的集合,在代码里可以这样引用:
|
||||||
``#include<libc/xxx.h>``
|
``#include<libc/src/xxx.h>``
|
||||||
|
@ -35,4 +35,10 @@ sys_api_lib:
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(GARBAGE)
|
rm -rf $(GARBAGE)
|
||||||
|
$(MAKE) clean -C libs
|
||||||
|
@list='$(user_sub_dirs)'; for subdir in $$list; do \
|
||||||
|
echo "Clean in dir: $$subdir";\
|
||||||
|
cd $$subdir && $(MAKE) clean;\
|
||||||
|
cd .. ;\
|
||||||
|
done
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
#include <libc/math.h>
|
#include <libc/src/math.h>
|
||||||
#include <libc/stdio.h>
|
#include <libc/src/stdio.h>
|
||||||
#include <libc/stdlib.h>
|
#include <libc/src/stdlib.h>
|
||||||
#include <libc/time.h>
|
#include <libc/src/time.h>
|
||||||
#include <libc/unistd.h>
|
#include <libc/src/unistd.h>
|
||||||
|
|
||||||
void print_ascii_logo()
|
void print_ascii_logo()
|
||||||
{
|
{
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
#include "cmd_help.h"
|
#include "cmd_help.h"
|
||||||
#include "cmd_test.h"
|
#include "cmd_test.h"
|
||||||
#include <libc/dirent.h>
|
#include <libc/src/dirent.h>
|
||||||
#include <libc/errno.h>
|
#include <libc/src/errno.h>
|
||||||
#include <libc/fcntl.h>
|
#include <libc/src/fcntl.h>
|
||||||
#include <libc/include/signal.h>
|
#include <libc/src/include/signal.h>
|
||||||
#include <libc/stddef.h>
|
#include <libc/src/stddef.h>
|
||||||
#include <libc/stdio.h>
|
#include <libc/src/stdio.h>
|
||||||
#include <libc/stdlib.h>
|
#include <libc/src/stdlib.h>
|
||||||
#include <libc/string.h>
|
#include <libc/src/string.h>
|
||||||
#include <libc/sys/stat.h>
|
#include <libc/src/sys/stat.h>
|
||||||
#include <libc/sys/wait.h>
|
#include <libc/src/sys/wait.h>
|
||||||
#include <libc/unistd.h>
|
#include <libc/src/unistd.h>
|
||||||
#include <libsystem/syscall.h>
|
#include <libsystem/syscall.h>
|
||||||
|
|
||||||
// 当前工作目录(在main_loop中初始化)
|
// 当前工作目录(在main_loop中初始化)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "cmd_help.h"
|
#include "cmd_help.h"
|
||||||
#include <libc/stdio.h>
|
#include <libc/src/stdio.h>
|
||||||
#include <libc/stdlib.h>
|
#include <libc/src/stdlib.h>
|
||||||
struct help_table_item_t
|
struct help_table_item_t
|
||||||
{
|
{
|
||||||
void (*func)();
|
void (*func)();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#include "cmd_test.h"
|
#include "cmd_test.h"
|
||||||
#include <libc/stdio.h>
|
#include <libc/src/stdio.h>
|
||||||
#include <libc/stdlib.h>
|
#include <libc/src/stdlib.h>
|
||||||
#include <libc/string.h>
|
#include <libc/src/string.h>
|
||||||
#include <libc/unistd.h>
|
#include <libc/src/unistd.h>
|
||||||
|
|
||||||
int shell_pipe_test(int argc, char **argv)
|
int shell_pipe_test(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
#include <libKeyboard/keyboard.h>
|
#include <libKeyboard/keyboard.h>
|
||||||
#include <libc/fcntl.h>
|
#include <libc/src/fcntl.h>
|
||||||
#include <libc/printf.h>
|
#include <libc/src/printf.h>
|
||||||
#include <libc/stddef.h>
|
#include <libc/src/stddef.h>
|
||||||
#include <libc/stdio.h>
|
#include <libc/src/stdio.h>
|
||||||
#include <libc/stdlib.h>
|
#include <libc/src/stdlib.h>
|
||||||
#include <libc/string.h>
|
#include <libc/src/string.h>
|
||||||
#include <libc/sys/stat.h>
|
#include <libc/src/sys/stat.h>
|
||||||
#include <libc/unistd.h>
|
#include <libc/src/unistd.h>
|
||||||
|
|
||||||
#define pause_cpu() asm volatile("pause\n\t");
|
#define pause_cpu() asm volatile("pause\n\t");
|
||||||
#define MEM_HISTORY 1024
|
#define MEM_HISTORY 1024
|
||||||
|
@ -17,11 +17,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libc/math.h>
|
#include <libc/src/math.h>
|
||||||
#include <libc/stdio.h>
|
#include <libc/src/stdio.h>
|
||||||
#include <libc/stdlib.h>
|
#include <libc/src/stdlib.h>
|
||||||
#include <libc/time.h>
|
#include <libc/src/time.h>
|
||||||
#include <libc/unistd.h>
|
#include <libc/src/unistd.h>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
@ -10,3 +10,10 @@ $(user_libs_sub_dirs): ECHO
|
|||||||
$(MAKE) -C $@ all CFLAGS="$(CFLAGS) -I $(shell pwd)"
|
$(MAKE) -C $@ all CFLAGS="$(CFLAGS) -I $(shell pwd)"
|
||||||
|
|
||||||
all: $(user_libs_sub_dirs)
|
all: $(user_libs_sub_dirs)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@list='$(user_libs_sub_dirs)'; for subdir in $$list; do \
|
||||||
|
echo "Clean in dir: $$subdir";\
|
||||||
|
cd $$subdir && $(MAKE) clean;\
|
||||||
|
cd .. ;\
|
||||||
|
done
|
@ -1,5 +1,5 @@
|
|||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include <libc/unistd.h>
|
#include <libc/src/unistd.h>
|
||||||
// 功能键标志变量
|
// 功能键标志变量
|
||||||
static bool shift_l = 0, shift_r = 0, ctrl_l = 0, ctrl_r = 0, alt_l = 0, alt_r = 0;
|
static bool shift_l = 0, shift_r = 0, ctrl_l = 0, ctrl_r = 0, alt_l = 0, alt_r = 0;
|
||||||
static bool gui_l = 0, gui_r = 0, apps = 0, insert = 0, home = 0, pgup = 0, del = 0, end = 0, pgdn = 0, arrow_u = 0, arrow_l = 0, arrow_d = 0, arrow_r = 0;
|
static bool gui_l = 0, gui_r = 0, apps = 0, insert = 0, home = 0, pgup = 0, del = 0, end = 0, pgdn = 0, arrow_u = 0, arrow_l = 0, arrow_d = 0, arrow_r = 0;
|
||||||
|
11
user/libs/libc/.cargo/config.toml
Normal file
11
user/libs/libc/.cargo/config.toml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[build]
|
||||||
|
target = "src/arch/x86_64/x86_64-unknown-none.json"
|
||||||
|
|
||||||
|
[unstable]
|
||||||
|
build-std = ["core", "compiler_builtins", "alloc"]
|
||||||
|
build-std-features = ["compiler-builtins-mem"]
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "none")']
|
||||||
|
runner = "bootimage runner"
|
||||||
|
|
||||||
|
[env]
|
2
user/libs/libc/.gitignore
vendored
Normal file
2
user/libs/libc/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
target/
|
||||||
|
Cargo.lock
|
18
user/libs/libc/Cargo.toml
Normal file
18
user/libs/libc/Cargo.toml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
[package]
|
||||||
|
name = "libc"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
[lib]
|
||||||
|
crate-type = ["staticlib"]
|
||||||
|
|
||||||
|
# 运行时依赖项
|
||||||
|
[dependencies]
|
||||||
|
x86_64 = "0.14.10"
|
||||||
|
|
||||||
|
# 构建时依赖项
|
||||||
|
[build-dependencies]
|
||||||
|
bindgen = "0.61.0"
|
||||||
|
|
||||||
|
|
@ -1,48 +1,7 @@
|
|||||||
all: libc
|
|
||||||
|
|
||||||
CFLAGS += -I .
|
all:
|
||||||
|
$(MAKE) -C src all
|
||||||
|
|
||||||
libc_sub_dirs=math sys
|
clean:
|
||||||
|
rm -f Cargo.lock
|
||||||
ifeq ($(ARCH), __x86_64__)
|
$(MAKE) -C src clean
|
||||||
libc_sub_dirs += sysdeps/x86_64
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
libc: unistd.o fcntl.o malloc.o errno.o printf.o stdlib.o ctype.o string.o dirent.o time.o
|
|
||||||
@list='$(libc_sub_dirs)'; for subdir in $$list; do \
|
|
||||||
echo "make all in $$subdir";\
|
|
||||||
cd $$subdir;\
|
|
||||||
$(MAKE) all CFLAGS="$(CFLAGS) -I $(shell pwd)";\
|
|
||||||
cd ..;\
|
|
||||||
done
|
|
||||||
|
|
||||||
unistd.o: unistd.c
|
|
||||||
$(CC) $(CFLAGS) -c unistd.c -o unistd.o
|
|
||||||
|
|
||||||
fcntl.o: fcntl.c
|
|
||||||
$(CC) $(CFLAGS) -c fcntl.c -o fcntl.o
|
|
||||||
|
|
||||||
malloc.o: malloc.c
|
|
||||||
$(CC) $(CFLAGS) -c malloc.c -o malloc.o
|
|
||||||
|
|
||||||
errno.o: errno.c
|
|
||||||
$(CC) $(CFLAGS) -c errno.c -o errno.o
|
|
||||||
|
|
||||||
printf.o: printf.c
|
|
||||||
$(CC) $(CFLAGS) -c printf.c -o printf.o
|
|
||||||
|
|
||||||
stdlib.o: stdlib.c
|
|
||||||
$(CC) $(CFLAGS) -c stdlib.c -o stdlib.o
|
|
||||||
|
|
||||||
ctype.o: ctype.c
|
|
||||||
$(CC) $(CFLAGS) -c ctype.c -o ctype.o
|
|
||||||
|
|
||||||
string.o: string.c
|
|
||||||
$(CC) $(CFLAGS) -c string.c -o string.o
|
|
||||||
|
|
||||||
dirent.o: dirent.c
|
|
||||||
$(CC) $(CFLAGS) -c dirent.c -o dirent.o
|
|
||||||
|
|
||||||
time.o: time.c
|
|
||||||
$(CC) $(CFLAGS) -c time.c -o time.o
|
|
63
user/libs/libc/src/Makefile
Normal file
63
user/libs/libc/src/Makefile
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
GARBAGE_PATTERNS := *.o *.s~ *.s *.S~ *.c~ *.h~ kernel
|
||||||
|
GARBAGE := $(foreach DIR,$(DIRS),$(addprefix $(DIR)/,$(GARBAGE_PATTERNS)))
|
||||||
|
|
||||||
|
all: libc
|
||||||
|
|
||||||
|
CFLAGS += -I .
|
||||||
|
|
||||||
|
libc_sub_dirs=math sys
|
||||||
|
|
||||||
|
ifeq ($(ARCH), __x86_64__)
|
||||||
|
libc_sub_dirs += sysdeps/x86_64
|
||||||
|
endif
|
||||||
|
|
||||||
|
clean:
|
||||||
|
cargo clean
|
||||||
|
rm -rf $(GARBAGE)
|
||||||
|
@list='$(libc_sub_dirs)'; for subdir in $$list; do \
|
||||||
|
echo "Clean in dir: $$subdir";\
|
||||||
|
cd $$subdir && $(MAKE) clean;\
|
||||||
|
cd .. ;\
|
||||||
|
done
|
||||||
|
|
||||||
|
libc: unistd.o fcntl.o malloc.o errno.o printf.o stdlib.o ctype.o string.o dirent.o time.o libc_rust
|
||||||
|
@list='$(libc_sub_dirs)'; for subdir in $$list; do \
|
||||||
|
echo "make all in $$subdir";\
|
||||||
|
cd $$subdir;\
|
||||||
|
$(MAKE) all CFLAGS="$(CFLAGS) -I $(shell pwd)";\
|
||||||
|
cd ..;\
|
||||||
|
done
|
||||||
|
|
||||||
|
unistd.o: unistd.c
|
||||||
|
$(CC) $(CFLAGS) -c unistd.c -o unistd.o
|
||||||
|
|
||||||
|
fcntl.o: fcntl.c
|
||||||
|
$(CC) $(CFLAGS) -c fcntl.c -o fcntl.o
|
||||||
|
|
||||||
|
malloc.o: malloc.c
|
||||||
|
$(CC) $(CFLAGS) -c malloc.c -o malloc.o
|
||||||
|
|
||||||
|
errno.o: errno.c
|
||||||
|
$(CC) $(CFLAGS) -c errno.c -o errno.o
|
||||||
|
|
||||||
|
printf.o: printf.c
|
||||||
|
$(CC) $(CFLAGS) -c printf.c -o printf.o
|
||||||
|
|
||||||
|
stdlib.o: stdlib.c
|
||||||
|
$(CC) $(CFLAGS) -c stdlib.c -o stdlib.o
|
||||||
|
|
||||||
|
ctype.o: ctype.c
|
||||||
|
$(CC) $(CFLAGS) -c ctype.c -o ctype.o
|
||||||
|
|
||||||
|
string.o: string.c
|
||||||
|
$(CC) $(CFLAGS) -c string.c -o string.o
|
||||||
|
|
||||||
|
dirent.o: dirent.c
|
||||||
|
$(CC) $(CFLAGS) -c dirent.c -o dirent.o
|
||||||
|
|
||||||
|
time.o: time.c
|
||||||
|
$(CC) $(CFLAGS) -c time.c -o time.o
|
||||||
|
|
||||||
|
libc_rust:
|
||||||
|
rustup default nightly
|
||||||
|
cargo +nightly build --release --target ./x86_64-unknown-none.json
|
@ -1,4 +1,4 @@
|
|||||||
#include <libc/ctype.h>
|
#include <libc/src/ctype.h>
|
||||||
|
|
||||||
|
|
||||||
int isprint(int c)
|
int isprint(int c)
|
@ -1,10 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <libc/sys/types.h>
|
#include <libc/src/sys/types.h>
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <libc/__libc__.h>
|
#include <libc/src/__libc__.h>
|
||||||
|
|
||||||
|
|
||||||
int isalnum(int c);
|
int isalnum(int c);
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <libc/sys/types.h>
|
#include <libc/src/sys/types.h>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
@ -1,4 +1,4 @@
|
|||||||
#include <libc/fcntl.h>
|
#include <libc/src/fcntl.h>
|
||||||
#include <libsystem/syscall.h>
|
#include <libsystem/syscall.h>
|
||||||
|
|
||||||
/**
|
/**
|
21
user/libs/libc/src/lib.rs
Normal file
21
user/libs/libc/src/lib.rs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#![no_std] // <1>
|
||||||
|
#![no_main] // <1>
|
||||||
|
#![feature(core_intrinsics)] // <2>
|
||||||
|
#![feature(alloc_error_handler)]
|
||||||
|
#![feature(panic_info_message)]
|
||||||
|
|
||||||
|
#[allow(non_upper_case_globals)]
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
|
||||||
|
|
||||||
|
use core::panic::PanicInfo;
|
||||||
|
#[panic_handler]
|
||||||
|
fn panic(_info: &PanicInfo) -> ! {
|
||||||
|
loop {}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn scanf() {
|
||||||
|
|
||||||
|
}
|
@ -1,9 +1,9 @@
|
|||||||
#include <libc/stdlib.h>
|
#include <libc/src/stdlib.h>
|
||||||
#include <libsystem/syscall.h>
|
#include <libsystem/syscall.h>
|
||||||
#include <libc/stddef.h>
|
#include <libc/src/stddef.h>
|
||||||
#include <libc/unistd.h>
|
#include <libc/src/unistd.h>
|
||||||
#include <libc/errno.h>
|
#include <libc/src/errno.h>
|
||||||
#include <libc/stdio.h>
|
#include <libc/src/stdio.h>
|
||||||
|
|
||||||
#define PAGE_4K_SHIFT 12
|
#define PAGE_4K_SHIFT 12
|
||||||
#define PAGE_2M_SHIFT 21
|
#define PAGE_2M_SHIFT 21
|
@ -1,7 +1,6 @@
|
|||||||
#include <libc/math.h>
|
#include <libc/src/math.h>
|
||||||
#include <libc/sys/types.h>
|
#include <libc/src/sys/types.h>
|
||||||
#include "libm.h"
|
#include "libm.h"
|
||||||
|
|
||||||
double fabs(double x)
|
double fabs(double x)
|
||||||
{
|
{
|
||||||
union
|
union
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <libc/sys/types.h>
|
#include <libc/src/sys/types.h>
|
||||||
|
|
||||||
// ===== 描述long double 的数据比特结构
|
// ===== 描述long double 的数据比特结构
|
||||||
#if __LDBL_MANT_DIG__ == 53 && __LDBL_MAX_EXP__ == 1024
|
#if __LDBL_MANT_DIG__ == 53 && __LDBL_MAX_EXP__ == 1024
|
@ -1,5 +1,5 @@
|
|||||||
#include <libc/math.h>
|
#include <libc/src/math.h>
|
||||||
#include <libc/stddef.h>
|
#include <libc/src/stddef.h>
|
||||||
|
|
||||||
int64_t pow(int64_t x, int y)
|
int64_t pow(int64_t x, int y)
|
||||||
{
|
{
|
@ -1,9 +1,9 @@
|
|||||||
#include "printf.h"
|
#include "printf.h"
|
||||||
|
|
||||||
#include <libc/math.h>
|
#include <libc/src/math.h>
|
||||||
#include <libc/stdio.h>
|
#include <libc/src/stdio.h>
|
||||||
#include <libc/stdlib.h>
|
#include <libc/src/stdlib.h>
|
||||||
#include <libc/string.h>
|
#include <libc/src/string.h>
|
||||||
#include <libsystem/syscall.h>
|
#include <libsystem/syscall.h>
|
||||||
|
|
||||||
static char *write_num(char *str, uint64_t num, int base, int field_width, int precision, int flags);
|
static char *write_num(char *str, uint64_t num, int base, int field_width, int precision, int flags);
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <libc/sys/types.h>
|
#include <libc/src/sys/types.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#define NULL 0
|
#define NULL 0
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <libc/sys/types.h>
|
#include <libc/src/sys/types.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
// 字体颜色的宏定义
|
// 字体颜色的宏定义
|
@ -1,6 +1,6 @@
|
|||||||
#include <libc/unistd.h>
|
#include <libc/src/unistd.h>
|
||||||
#include <libc/stdlib.h>
|
#include <libc/src/stdlib.h>
|
||||||
#include <libc/ctype.h>
|
#include <libc/src/ctype.h>
|
||||||
#include <libsystem/syscall.h>
|
#include <libsystem/syscall.h>
|
||||||
|
|
||||||
int abs(int i)
|
int abs(int i)
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <libc/sys/types.h>
|
#include <libc/src/sys/types.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 获取一块堆内存
|
* @brief 获取一块堆内存
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <libc/sys/types.h>
|
#include <libc/src/sys/types.h>
|
||||||
|
|
||||||
void *memset(void *dst, unsigned char C, uint64_t size);
|
void *memset(void *dst, unsigned char C, uint64_t size);
|
||||||
/**
|
/**
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <libc/sys/types.h>
|
#include <libc/src/sys/types.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 系统内存信息结构体(单位:字节)
|
* @brief 系统内存信息结构体(单位:字节)
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#include <libc/stdio.h>
|
#include <libc/src/stdio.h>
|
||||||
#include <libc/stdlib.h>
|
#include <libc/src/stdlib.h>
|
||||||
|
|
||||||
extern int main(int, char **);
|
extern int main(int, char **);
|
||||||
|
|
@ -1,10 +1,10 @@
|
|||||||
#include <libc/unistd.h>
|
#include <libc/src/unistd.h>
|
||||||
#include <libsystem/syscall.h>
|
#include <libsystem/syscall.h>
|
||||||
#include <libc/errno.h>
|
#include <libc/src/errno.h>
|
||||||
#include <libc/stdio.h>
|
#include <libc/src/stdio.h>
|
||||||
#include <libc/stddef.h>
|
#include <libc/src/stddef.h>
|
||||||
#include <libc/string.h>
|
#include <libc/src/string.h>
|
||||||
#include <libc/fcntl.h>
|
#include <libc/src/fcntl.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 关闭文件接口
|
* @brief 关闭文件接口
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <libc/sys/types.h>
|
#include <libc/src/sys/types.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 关闭文件接口
|
* @brief 关闭文件接口
|
15
user/libs/libc/src/x86_64-unknown-none.json
Normal file
15
user/libs/libc/src/x86_64-unknown-none.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"llvm-target": "x86_64-unknown-none",
|
||||||
|
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
|
||||||
|
"arch": "x86_64",
|
||||||
|
"target-endian": "little",
|
||||||
|
"target-pointer-width": "64",
|
||||||
|
"target-c-int-width": "32",
|
||||||
|
"os": "none",
|
||||||
|
"linker": "rust-lld",
|
||||||
|
"linker-flavor": "ld.lld",
|
||||||
|
"executables": true,
|
||||||
|
"features": "-mmx,-sse,+soft-float",
|
||||||
|
"disable-redzone": true,
|
||||||
|
"panic-strategy": "abort"
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
#include "syscall.h"
|
#include "syscall.h"
|
||||||
#include <libc/stdio.h>
|
#include <libc/src/stdio.h>
|
||||||
#include <libc/errno.h>
|
#include <libc/src/errno.h>
|
||||||
long syscall_invoke(uint64_t syscall_id, uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6, uint64_t arg7)
|
long syscall_invoke(uint64_t syscall_id, uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6, uint64_t arg7)
|
||||||
{
|
{
|
||||||
uint64_t __err_code;
|
uint64_t __err_code;
|
||||||
|
Reference in New Issue
Block a user