Compare commits
9 commits
98a53fc774
...
8458c74ee1
Author | SHA1 | Date | |
---|---|---|---|
8458c74ee1 | |||
6a53e3535a | |||
b69c712ea5 | |||
000f24b79c | |||
a06d3c56a8 | |||
9c8ba82546 | |||
859245ac6f | |||
f609e6db47 | |||
d058c08d61 |
9 changed files with 48 additions and 3 deletions
|
@ -7,4 +7,4 @@ ARCH_FREEOBJS=\
|
|||
$(ARCHDIR)/inb.o \
|
||||
$(ARCHDIR)/outb.o
|
||||
|
||||
ARCH_HOSTEDOBJS=\
|
||||
ARCH_HOSTEDOBJS=
|
|
@ -22,6 +22,11 @@
|
|||
|
||||
#define FLT_RADIX 2
|
||||
|
||||
/*
|
||||
Okay, hold up. What is going on with LDBL? That...shouldn't be right. Ugh.
|
||||
-Kat
|
||||
*/
|
||||
|
||||
#define FLT_MANT_DIG 24
|
||||
#define DBL_MANT_DIG 53
|
||||
#define LDBL_MANT_DIG 113
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
#include <types/size_t.h>
|
||||
#include <types/wchar_t.h>
|
||||
|
||||
/*
|
||||
I do believe this is straight ripped from musl.
|
||||
-Kat
|
||||
*/
|
||||
#define offsetof(type, member) (size_t)(&((type *)0->member))
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,6 +20,6 @@ struct utsname {
|
|||
char machine[70];
|
||||
};
|
||||
|
||||
int uname(utsname *);
|
||||
int uname(struct utsname *);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -72,4 +72,6 @@ int execv(const char *, char *const []);
|
|||
int execve(const char *, char *const [], char *const []);
|
||||
int execvp(const char *, char *const []);
|
||||
|
||||
int gethostname(char *, size_t);
|
||||
|
||||
#endif
|
||||
|
|
5
makefile
5
makefile
|
@ -44,6 +44,7 @@ ctype/isupper.o \
|
|||
ctype/isxdigit.o \
|
||||
ctype/tolower.o \
|
||||
ctype/toupper.o \
|
||||
misc/uname.o \
|
||||
stdlib/abort.o \
|
||||
stdlib/bsearch.o \
|
||||
stdio/printf.o \
|
||||
|
@ -54,9 +55,11 @@ string/memcpy.o \
|
|||
string/memmove.o \
|
||||
string/memset.o \
|
||||
string/strcmp.o \
|
||||
string/strcpy.o \
|
||||
string/strcspn.o \
|
||||
string/strlen.o \
|
||||
string/strtok.o
|
||||
string/strtok.o \
|
||||
unistd/gethostname.o
|
||||
|
||||
HOSTEDOBJS=\
|
||||
$(ARCH_HOSTEDOBJS) \
|
||||
|
|
9
misc/uname.c
Normal file
9
misc/uname.c
Normal file
|
@ -0,0 +1,9 @@
|
|||
#include <sys/utsname.h>
|
||||
#include <kernel/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int uname(struct utsname * u) {
|
||||
__syscall_uname(u);
|
||||
gethostname(u->nodename, 70);
|
||||
return 1;
|
||||
}
|
15
string/strcpy.c
Executable file
15
string/strcpy.c
Executable file
|
@ -0,0 +1,15 @@
|
|||
#include <string.h>
|
||||
|
||||
char * strcpy(char * restrict dest, const char * restrict src) {
|
||||
char * to = dest;
|
||||
const char * from = src;
|
||||
size_t i;
|
||||
|
||||
for(i = 0; from[i] != '\0'; i++) {
|
||||
to[i] = from[i];
|
||||
}
|
||||
|
||||
to[i] = from[i];
|
||||
|
||||
return dest;
|
||||
}
|
7
unistd/gethostname.c
Normal file
7
unistd/gethostname.c
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
int gethostname(char * name, size_t namelen) {
|
||||
memcpy(name, "TEST_STR_REPLACE_LATER", namelen);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue