libc

my libc
git clone git://git.evenfri.duckdns.org/libc.git
Log | Files | Refs | README

commit f80057393b3fd01070c5b0e14c3c2c85587b869f
parent fc2e8fdcfbdcfff92e72aef056e0491b23ad61bc
Author: evenfri <evenfri256@gmail.com>
Date:   Mon, 10 Aug 2026 03:09:05 +0800

fix start.s

Diffstat:
Mexecvp.c | 2+-
Mstart.s | 4++++
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/execvp.c b/execvp.c @@ -5,10 +5,10 @@ #include "libc.h" -static char *empty_env[] = { NULL }; char **environ; int execvp(const char *file, char *const argv[]) { + static char *empty_env[] = { NULL }; char **env = (environ != NULL) ? environ : empty_env; if (strchr(file, '/') != 0) { diff --git a/start.s b/start.s @@ -9,6 +9,10 @@ _start: lea rdx, [rsi + rdi*8 + 8] + # save envp to environ + lea rax, [rip + environ] + mov [rax], rdx + sub rsp, 8 call main