diff options
author | Robert Morris <[email protected]> | 2019-05-31 09:45:59 -0400 |
---|---|---|
committer | Robert Morris <[email protected]> | 2019-05-31 09:45:59 -0400 |
commit | 2ec1959fd1016a18ef3b2d154ce7076be8f237e4 (patch) | |
tree | 1aa75252085964283b3a2c735771f4da02346517 /string.c | |
parent | 0f90388c893d1924e89e2e4d2187eda0004e9d73 (diff) | |
download | xv6-labs-2ec1959fd1016a18ef3b2d154ce7076be8f237e4.tar.gz xv6-labs-2ec1959fd1016a18ef3b2d154ce7076be8f237e4.tar.bz2 xv6-labs-2ec1959fd1016a18ef3b2d154ce7076be8f237e4.zip |
fork/wait/exit work
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1,14 +1,13 @@ #include "types.h" -#include "x86.h" void* memset(void *dst, int c, uint n) { - if ((uint64)dst%4 == 0 && n%4 == 0){ - c &= 0xFF; - stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); - } else - stosb(dst, c, n); + char *cdst = (char *) dst; + int i; + for(i = 0; i < n; i++){ + cdst[i] = c; + } return dst; } |