mirror of
https://github.com/Fennix-Project/Userspace.git
synced 2025-08-26 05:15:01 +00:00
Update libc
This commit is contained in:
@@ -32,7 +32,6 @@ int fseek(FILE *stream, long offset, int whence)
|
||||
stream->offset = offset;
|
||||
break;
|
||||
case SEEK_CUR:
|
||||
stream->offset += offset;
|
||||
break;
|
||||
case SEEK_END:
|
||||
// stream->offset = syscall1(_FileLength, (uint64_t)File->KernelPrivate) + offset;
|
||||
|
@@ -28,3 +28,8 @@ int puts(const char *s)
|
||||
for (int i = 0; s[i] != '\0'; i++)
|
||||
fputc(s[i], stdout);
|
||||
}
|
||||
|
||||
void perror(const char *__s)
|
||||
{
|
||||
fputs(__s, stderr);
|
||||
}
|
||||
|
@@ -6,19 +6,23 @@
|
||||
|
||||
void abort(void)
|
||||
{
|
||||
__asm__ __volatile__("syscall"
|
||||
:
|
||||
: "a"(0), "D"(-0xAB057)
|
||||
: "rcx", "r11", "memory");
|
||||
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
|
||||
int atexit(void (*function)(void))
|
||||
{
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void exit(int status)
|
||||
{
|
||||
while (1)
|
||||
;
|
||||
_exit(status);
|
||||
}
|
||||
|
||||
int atoi(const char *nptr)
|
||||
@@ -64,7 +68,7 @@ void free(void *Address)
|
||||
|
||||
int system(const char *command)
|
||||
{
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
double atof(const char *nptr)
|
||||
|
17
libc/src/std/spawn.c
Normal file
17
libc/src/std/spawn.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <spawn.h>
|
||||
|
||||
int posix_spawn(pid_t *pid, const char *path,
|
||||
const posix_spawn_file_actions_t *file_actions,
|
||||
const posix_spawnattr_t *attrp,
|
||||
char *const argv[],
|
||||
char *const envp[])
|
||||
{
|
||||
}
|
||||
|
||||
int posix_spawnp(pid_t *pid, const char *file,
|
||||
const posix_spawn_file_actions_t *file_actions,
|
||||
const posix_spawnattr_t *attrp,
|
||||
char *const argv[],
|
||||
char *const envp[])
|
||||
{
|
||||
}
|
14
libc/src/std/sys/wait.c
Normal file
14
libc/src/std/sys/wait.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <sys/wait.h>
|
||||
|
||||
pid_t wait(int *wstatus)
|
||||
{
|
||||
return waitpid(-1, &wstatus, 0);
|
||||
}
|
||||
|
||||
pid_t waitpid(pid_t pid, int *wstatus, int options)
|
||||
{
|
||||
}
|
||||
|
||||
int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options)
|
||||
{
|
||||
}
|
44
libc/src/std/uni/exe.c
Normal file
44
libc/src/std/uni/exe.c
Normal file
@@ -0,0 +1,44 @@
|
||||
#include <unistd.h>
|
||||
#include <stddef.h>
|
||||
#include <errno.h>
|
||||
#include "../../../Kernel/syscalls.h"
|
||||
|
||||
int execl(const char *pathname, const char *arg, ...)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int execlp(const char *file, const char *arg, ...)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int execle(const char *pathname, const char *arg, ...)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int execv(const char *pathname, char *const argv[])
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int execvp(const char *file, char *const argv[])
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int execvpe(const char *file, char *const argv[], char *const envp[])
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int execve(const char *pathname, char *const argv[], char *const envp[])
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
pid_t fork(void)
|
||||
{
|
||||
return syscall0(_Fork);
|
||||
}
|
Reference in New Issue
Block a user