From 8b58e81077abf4e843873f16c03077e2fafce52d Mon Sep 17 00:00:00 2001 From: kaashoek Date: Wed, 23 Aug 2006 01:09:24 +0000 Subject: 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? --- ulib.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'ulib.c') diff --git a/ulib.c b/ulib.c index 004b934..c6c7f19 100644 --- a/ulib.c +++ b/ulib.c @@ -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) { @@ -40,6 +48,15 @@ memset(void *dst, int c, unsigned int n) return dst; } +char * +strchr(const char *s, char c) +{ + for (; *s; s++) + if (*s == c) + return (char *) s; + return 0; +} + char * gets(char *buf, int max) { -- cgit v1.2.3