mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Overhaul process spawning
This commit is contained in:
parent
99dc1281f5
commit
26e254fb4d
96 changed files with 1848 additions and 1541 deletions
|
@ -9,6 +9,12 @@
|
|||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
__funline unsigned long __strlen(const char *s) {
|
||||
unsigned long n = 0;
|
||||
while (*s++) ++n;
|
||||
return n;
|
||||
}
|
||||
|
||||
__funline int __strcmp(const char *l, const char *r) {
|
||||
size_t i = 0;
|
||||
while (l[i] == r[i] && r[i]) ++i;
|
||||
|
@ -24,6 +30,15 @@ __funline char *__stpcpy(char *d, const char *s) {
|
|||
}
|
||||
}
|
||||
|
||||
__funline long __write_linux(int fd, const void *p, long n) {
|
||||
long ax = 1;
|
||||
asm volatile("syscall"
|
||||
: "+a"(ax)
|
||||
: "D"(fd), "S"(p), "d"(n)
|
||||
: "rcx", "r11", "memory");
|
||||
return ax;
|
||||
}
|
||||
|
||||
__funline void *__repstosb(void *di, char al, size_t cx) {
|
||||
#if defined(__x86__) && defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||
asm("rep stosb"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue