[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v2 1/2] lib/nolibc: Add strcmp function


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Tue, 3 Jul 2018 18:27:31 +0300
  • Cc: simon.kuenzer@xxxxxxxxx, sharan.santhanam@xxxxxxxxx, yuri.volchkov@xxxxxxxxx
  • Delivery-date: Tue, 03 Jul 2018 15:27:46 +0000
  • Ironport-phdr: 9a23:OHHzThLlrpyHGuCRC9mcpTZWNBhigK39O0sv0rFitYgfKfrxwZ3uMQTl6Ol3ixeRBMOHs6wC07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffwRFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QLYpUjqg8qhrUgflhicZOTAk/m/Zict+g6BVoB+6uxBz35TZbJ2POfZiYq/Qe84RS2pbXsZWUixMGp2xb4wUD+odPOZYqZT2qV0TrRumGAmnGeTixSNPhn/twa060uIhHRvC3Aw9B9IOrW/Zo8nuNKsISeC10bLHwS/Zb/NRwDrw7pXDfBM5ofyUQL59ftfdxVMsGg7FlFmct5LpMjGP2ukDq2SX8uVtWf+1h2Mkqwx9uCajy8kih4XTm44YxU7I+CNky4gvP9K4UlR0Ydu8HZtVsCGVKpV5T9s5Q2FtpCY60roGuYOnfCQSyJQo2Rrfa/uffoiW5xLsTueRITNiiH15Y7KznQ6y8VW7xeHmTMm0105GritDktbSqnAAzwHf58eaRvdn/Uqs2SyD2x7N5uxGO0w5m7LXK5s7zb4xkpoTv17DHijzmEjukKCWcV4k+vSp6+TheLnmooKcN5dpigzlLqsugdazAfwlMgcVRWSb4+O82KX5/ULlWLVKkuE2kq7BvZDfJMQboK+5AwhO0oo69hmwESmm38ocnXQcKFJFeQmHj5TyO13UL/H3E/G/j06rkDdxyPDMJqfhDYnVLnjfjLfheq5w61VcyAUp19BQ/ZRUBqsaIP3pXE/xqNzYAQU/MwOuxubqE9N92Z0CVmKLGKCWK7nevkGV5ug3OemDeJcVuCrhK/gi//Puln45mVoafamvx5cXa224EepgI0SYf3XsmMwMEWEUsQUiSOzlkkaNXSRNaHavR6g8/C00CJq6DYffQYCgmLyA3DqhHp1XfGxGFFeMEXP0eIWEWPcMbzySL9RnkjMaSbehT5Uu2gq0uADk1ro0ZtbTrygZs5Pkz5156vPekTk29CdoFIKN3mfLSHt7zU0SQDpj96dkvU17gnOeybUw1/dfDsBS4bVNTx8nHZXHifRnAZboXVSSLZ+yVF+6T4D+UnkKRdUrzopWbg==
  • 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 | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/nolibc/string.c b/lib/nolibc/string.c
index 018d346..bf89106 100644
--- a/lib/nolibc/string.c
+++ b/lib/nolibc/string.c
@@ -156,3 +156,13 @@ 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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.