Update userspace

This commit is contained in:
Alex
2023-06-10 13:10:56 +03:00
parent ed5faa7b55
commit 22e75b9540
63 changed files with 2362 additions and 2151 deletions

View File

@ -44,20 +44,20 @@
typedef struct
{
uint32_t a_type;
union
{
uint32_t a_val;
} a_un;
uint32_t a_type;
union
{
uint32_t a_val;
} a_un;
} Elf32_auxv_t;
typedef struct
{
uint64_t a_type;
union
{
uint64_t a_val;
} a_un;
uint64_t a_type;
union
{
uint64_t a_val;
} a_un;
} Elf64_auxv_t;
#ifdef __LP64__

View File

@ -3,7 +3,7 @@
struct sched_param
{
int sched_priority;
int sched_priority;
};
#endif // !_BITS_TYPES_STRUCT_SCHED_PARAM_T_H

View File

@ -8,38 +8,38 @@
struct __spawn_action
{
int __stub;
int __stub;
};
typedef struct
{
short int __flags;
pid_t __pgrp;
sigset_t __sd;
sigset_t __ss;
struct sched_param __sp;
int __policy;
int __pad[16];
short int __flags;
pid_t __pgrp;
sigset_t __sd;
sigset_t __ss;
struct sched_param __sp;
int __policy;
int __pad[16];
} posix_spawnattr_t;
typedef struct
{
int __allocated;
int __used;
struct __spawn_action *__actions;
int __pad[16];
int __allocated;
int __used;
struct __spawn_action *__actions;
int __pad[16];
} posix_spawn_file_actions_t;
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[]);
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[]);
const posix_spawn_file_actions_t *file_actions,
const posix_spawnattr_t *attrp,
char *const argv[],
char *const envp[]);
#endif // !_SPAWN_H

View File

@ -18,31 +18,31 @@
struct _IO_marker
{
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
};
struct _IO_FILE
{
int _flags;
int _flags;
char *_IO_read_ptr;
char *_IO_read_end;
char *_IO_read_base;
char *_IO_write_base;
char *_IO_write_ptr;
char *_IO_write_end;
char *_IO_buf_base;
char *_IO_buf_end;
char *_IO_read_ptr;
char *_IO_read_end;
char *_IO_read_base;
char *_IO_write_base;
char *_IO_write_ptr;
char *_IO_write_end;
char *_IO_buf_base;
char *_IO_buf_end;
__off_t _offset;
__off_t _offset;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
void *KernelPrivate;
void *KernelPrivate;
};
typedef struct _IO_FILE FILE;
@ -52,32 +52,32 @@ extern "C"
{
#endif
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;
#define stdin stdin
#define stdout stdout
#define stderr stderr
FILE *fopen(const char *filename, const char *mode);
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
off_t fseek(FILE *stream, long offset, int whence);
long ftell(FILE *stream);
int fclose(FILE *fp);
int fflush(FILE *stream);
int fprintf(FILE *stream, const char *format, ...);
int printf(const char *format, ...);
void setbuf(FILE *stream, char *buf);
int vfprintf(FILE *stream, const char *format, va_list arg);
int vsscanf(const char *s, const char *format, va_list arg);
int sscanf(const char *s, const char *format, ...);
FILE *fopen(const char *filename, const char *mode);
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
off_t fseek(FILE *stream, long offset, int whence);
long ftell(FILE *stream);
int fclose(FILE *fp);
int fflush(FILE *stream);
int fprintf(FILE *stream, const char *format, ...);
int printf(const char *format, ...);
void setbuf(FILE *stream, char *buf);
int vfprintf(FILE *stream, const char *format, va_list arg);
int vsscanf(const char *s, const char *format, va_list arg);
int sscanf(const char *s, const char *format, ...);
int fputc(int c, FILE *stream);
int putc(int c, FILE *stream);
int fputs(const char *s, FILE *stream);
int puts(const char *s);
int putchar(int c);
int fputc(int c, FILE *stream);
int putc(int c, FILE *stream);
int fputs(const char *s, FILE *stream);
int puts(const char *s);
int putchar(int c);
#ifdef __cplusplus
}

View File

@ -11,21 +11,21 @@ extern "C"
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
void abort(void);
int atexit(void (*function)(void));
void exit(int status);
int atoi(const char *nptr);
char *getenv(const char *name);
void abort(void);
int atexit(void (*function)(void));
void exit(int status);
int atoi(const char *nptr);
char *getenv(const char *name);
void *malloc(size_t Size);
void *realloc(void *Address, size_t Size);
void *calloc(size_t Count, size_t Size);
void free(void *Address);
int system(const char *command);
void *malloc(size_t Size);
void *realloc(void *Address, size_t Size);
void *calloc(size_t Count, size_t Size);
void free(void *Address);
int system(const char *command);
double atof(const char *nptr);
double atof(const char *nptr);
extern void perror(const char *s);
extern void perror(const char *s);
#ifdef __cplusplus
}

View File

@ -8,20 +8,21 @@ extern "C"
{
#endif
size_t strlen(const char *str);
int strcmp(const char *l, const char *r);
int strncmp(const char *s1, const char *s2, size_t n);
int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char *string1, const char *string2, size_t count);
char *strstr(const char *haystack, const char *needle);
char *strncpy(char *destination, const char *source, unsigned long num);
char *strdup(const char *s);
char *strchr(char const *s, int c);
char *strrchr(char const *s, int c);
size_t strlen(const char *str);
int strcmp(const char *l, const char *r);
int strncmp(const char *s1, const char *s2, size_t n);
int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char *string1, const char *string2, size_t count);
char *strstr(const char *haystack, const char *needle);
char *strncpy(char *destination, const char *source, unsigned long num);
char *strdup(const char *s);
char *strchr(char const *s, int c);
char *strrchr(char const *s, int c);
void *memcpy(void *dest, const void *src, size_t n);
void *memset(void *dest, int c, size_t n);
void *memmove(void *dest, const void *src, size_t n);
void *memcpy(void *dest, const void *src, size_t n);
void *memset(void *dest, int c, size_t n);
void *memmove(void *dest, const void *src, size_t n);
#ifdef __cplusplus
}
#endif

View File

@ -1,8 +1,17 @@
#ifndef _SYS_TYPES_H
#define _SYS_TYPES_H
#ifndef PUBLIC
#define PUBLIC __attribute__((visibility("default")))
#endif // !PUBLIC
#ifndef PRIVATE
#define PRIVATE __attribute__((visibility("hidden")))
#endif // !PRIVATE
typedef int __pid_t;
typedef unsigned int __id_t;
typedef unsigned int __useconds_t;
#ifndef __pid_t_defined
typedef __pid_t pid_t;
@ -14,4 +23,9 @@ typedef __id_t id_t;
#define __id_t_defined
#endif
#ifndef __useconds_t_defined
typedef __useconds_t useconds_t;
#define __useconds_t_defined
#endif
#endif

View File

@ -5,14 +5,14 @@
typedef enum
{
P_ALL, /* Wait for any child. */
P_PID, /* Wait for specified process. */
P_PGID /* Wait for members of process group. */
P_ALL, /* Wait for any child. */
P_PID, /* Wait for specified process. */
P_PGID /* Wait for members of process group. */
} idtype_t;
typedef struct
{
int stub;
int stub;
} siginfo_t;
#include <bits/waitstatus.h>

View File

@ -7,10 +7,10 @@
#ifdef __cplusplus
#define EXTERNC extern "C"
#define START_EXTERNC \
EXTERNC \
{
EXTERNC \
{
#define END_EXTERNC \
}
}
#else
#define EXTERNC
#define START_EXTERNC
@ -195,4 +195,12 @@ typedef __SIZE_TYPE__ size_t;
#define b48(x) (((((x)&0x0000000000ff) << 40) | (((x)&0x00000000ff00) << 24) | (((x)&0x000000ff0000) << 8) | (((x)&0x0000ff000000) >> 8) | (((x)&0x00ff00000000) >> 24) | (((x)&0xff0000000000) >> 40)))
#define b64(x) __builtin_bswap64(x)
#ifndef PUBLIC
#define PUBLIC __attribute__((visibility("default")))
#endif // !PUBLIC
#ifndef PRIVATE
#define PRIVATE __attribute__((visibility("hidden")))
#endif // !PRIVATE
#endif // !__FENNIX_LIBC_TYPES_H__

View File

@ -8,17 +8,20 @@ extern "C"
{
#endif
extern char **environ;
extern char **environ;
int execl(const char *pathname, const char *arg, ...);
int execlp(const char *file, const char *arg, ...);
int execle(const char *pathname, const char *arg, ...);
int execv(const char *pathname, char *const argv[]);
int execvp(const char *file, char *const argv[]);
int execvpe(const char *file, char *const argv[], char *const envp[]);
int execve(const char *pathname, char *const argv[], char *const envp[]);
int execl(const char *pathname, const char *arg, ...);
int execlp(const char *file, const char *arg, ...);
int execle(const char *pathname, const char *arg, ...);
int execv(const char *pathname, char *const argv[]);
int execvp(const char *file, char *const argv[]);
int execvpe(const char *file, char *const argv[], char *const envp[]);
int execve(const char *pathname, char *const argv[], char *const envp[]);
pid_t fork(void);
pid_t fork(void);
unsigned int sleep(unsigned int seconds);
int usleep(useconds_t usec);
#ifdef __cplusplus
}