Here, we define mode_t so we can use it as the argument type in string.h
diff --git a/include/string.h b/include/string.h
index 9141c300004..482fa275d53 100644
--- a/include/string.h
+++ b/include/string.h
@@ -119,6 +119,12 @@ size_t strxfrm_l(char *__restrict, const char
*__restrict, size_t, locale_t)
#endif
#if __BSD_VISIBLE
+
+#ifndef _MODE_T_DEFINED_
+#define _MODE_T_DEFINED_
+typedef __mode_t mode_t;
+#endif
+
void explicit_bzero(void *, size_t)
__attribute__ ((__bounded__(__buffer__,1,2)));
void *memmem(const void *, size_t, const void *, size_t);
diff --git a/lib/libc/string/strmode.c b/lib/libc/string/strmode.c
index 609b8931fbb..ded67b65d42 100644
--- a/lib/libc/string/strmode.c
+++ b/lib/libc/string/strmode.c
@@ -32,10 +32,8 @@
#include <sys/stat.h>
#include <string.h>
-/* XXX mode should be mode_t */
-
void
-strmode(int mode, char *p)
+strmode(mode_t mode, char *p)
{
/* print type */
switch (mode & S_IFMT) {