diff options
author | kaashoek <kaashoek> | 2006-08-23 01:09:24 +0000 |
---|---|---|
committer | kaashoek <kaashoek> | 2006-08-23 01:09:24 +0000 |
commit | 8b58e81077abf4e843873f16c03077e2fafce52d (patch) | |
tree | 9613a801fc9b3421ee79725782e3ef9bb4650574 /ulib.c | |
parent | f18ab5c04e5380e0fb27f63e8335e5d621315c1d (diff) | |
download | xv6-labs-8b58e81077abf4e843873f16c03077e2fafce52d.tar.gz xv6-labs-8b58e81077abf4e843873f16c03077e2fafce52d.tar.bz2 xv6-labs-8b58e81077abf4e843873f16c03077e2fafce52d.zip |
i/o redirection in sh
better parsing of sh commands (copied from jos sh)
cat: read from 1 if no args
sbrk system call, but untested
getpid system call
moved locks in keyboard intr, but why do we get intr w. null characters from keyboard?
Diffstat (limited to 'ulib.c')
-rw-r--r-- | ulib.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -20,6 +20,14 @@ strcpy(char *s, char *t) return os; } +int +strcmp(const char *p, const char *q) +{ + while (*p && *p == *q) + p++, q++; + return (int) ((unsigned char) *p - (unsigned char) *q); +} + unsigned int strlen(char *s) { @@ -41,6 +49,15 @@ memset(void *dst, int c, unsigned int n) } char * +strchr(const char *s, char c) +{ + for (; *s; s++) + if (*s == c) + return (char *) s; + return 0; +} + +char * gets(char *buf, int max) { int i = 0, cc; |