[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Minios-devel] [UNIKRAFT PATCH 1/5] lib/nolibc: Add strcmp function
- To: minios-devel@xxxxxxxxxxxxx
- From: Costin Lupu <costin.lupu@xxxxxxxxx>
- Date: Tue, 3 Jul 2018 10:04:13 +0300
- Cc: simon.kuenzer@xxxxxxxxx, sharan.santhanam@xxxxxxxxx, yuri.volchkov@xxxxxxxxx
- Delivery-date: Tue, 03 Jul 2018 07:04:31 +0000
- Ironport-phdr: 9a23:0RUdORHr2OKw2fONWRTTgJ1GYnF86YWxBRYc798ds5kLTJ7ypMqwAkXT6L1XgUPTWs2DsrQY07SQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmDuwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VDK/5KlpVRDokj8KOT4n/m/KhMJ+j6VVrxCvpxFk34LYfJuYOOZkc6/BYd8XQ3dKUMZLVyxGB4Oxd5UCD+0aPeZEron9oUYFox2jBQm0GePk1zhFiWPx3a0hz+QhEAfG0BYkH9ITqHTUsc74O7sJUeyv1KnI0C7MY+lM2Tf68YXFdA0qr/KUXb9obMbcxlQjGxnGg1iQs4DpIS2Z2+YXv2WV9+ZsSO2ih3M9pwxyojWj3Nkgh4fHi44P11zJ+jt1zYAoLtOiUkF7e8SrEJ5IuiGfMIt5X90tTnlzuCY/1r0GoZm7fDUWyJg/xx7QdfiHc4+Q7xL9UeaeOzZ4hHZ/dL2jnBa+61CgyvDnWcWuylZKqTJJktjKtn8Tyxze8tWLR/Rg8ku72juC1xrf5v9aLU02j6bWJYYtwrsqmZoStUTDEDX2mELzjKKOakok/fOo6/jmYrXgvJOcM5J0ihnjMqk1hsO/Gv40MhATX2eA4+i8zrrj8VXjQLpWlv02jrXZsJfCKMQep665BQ5V0oE46xqmEjipzsoYkmcDLF9efBKHjpPpO03VIPziAvawnVKsnC1sx/DcMb3rGo/NIWTbkLf9YbZ97FZRyBEzzd9F/ZJbELcBLOjoWkDrstzYEh85PBayw+n9DdVwzYUeVnyTDa+dKqzdqkWE6fwyI+OUfo8apC79K+Q55/7plXI5gl4dfayu3ZsRcny4HelmLFufYXvtnNgBC3wHvgwgQ+P2jF2NSyVca2ysUKIh/js7Ep6pDZ/fRoCxh7yMxCe6HoBMZmBHEFyMD3Dod4GYVPcMayKSJdFhnycCVbe/V4Ah0QuhuxTgx7V5M+qHshEf4Jfi0tly/KjfmA8/8RRwDt+ByCedQmcymXkHFBEs26Uqiktm1laFmYxlm+EQQddU/O9IVEE+KIbB5+dhTcjvUETbeYHaGx6dXty6DGRpHZoKyNgUbhMlFg==
- List-id: Mini-os development list <minios-devel.lists.xenproject.org>
Shamelessly taken from Mini-OS.
Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
lib/nolibc/string.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/nolibc/string.c b/lib/nolibc/string.c
index 018d346..4230438 100644
--- a/lib/nolibc/string.c
+++ b/lib/nolibc/string.c
@@ -156,3 +156,12 @@ int strncmp(const char *str1, const char *str2, size_t len)
}
return 0;
}
+
+int strcmp(const char *str1, const char *str2)
+{
+ register signed char __res;
+
+ while ((__res = *str1 - *str2++) == 0 && *str1++);
+
+ return __res;
+}
--
2.11.0
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|