summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-11-29 15:22:39 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-12-05 23:07:01 +0000
commitbc3e5a45eb3a40855c0b3b980af01624eef0dfe7 (patch)
tree0b258a0492ab1805acc92ee6b7c82e22c00954bf /libc
parentd3c688f15601a01691d6ec68b8ae3f3c5f8ecd19 (diff)
downloadchrome-ec-bc3e5a45eb3a40855c0b3b980af01624eef0dfe7.tar.gz
libc/syscalls: Add mkdir stub
googletest fails to link without mkdir. This commit adds a stub that always returns an error. BRANCH=none BUG=b:254530679 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I1a587cfbb950193cf99e7d98d28f1d20555ec9ef Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4076809 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Andrea Grandi <agrandi@google.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/syscalls.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libc/syscalls.c b/libc/syscalls.c
index 43955a0ddd..16cac352d3 100644
--- a/libc/syscalls.c
+++ b/libc/syscalls.c
@@ -16,6 +16,10 @@
#include "task.h"
#include "uart.h"
+#include <errno.h>
+
+#include <sys/stat.h>
+
/**
* Reboot the system.
*
@@ -43,3 +47,22 @@ int _write(int fd, char *buf, int len)
{
return uart_put(buf, len);
}
+
+/**
+ * Create a directory.
+ *
+ * @warning Not implemented.
+ *
+ * @note Unlike the other functions in this file, this is not overriding a
+ * stub version in libnosys. There's no "_mkdir" stub in libnosys, so this
+ * provides the actual "mkdir" function.
+ *
+ * @param pathname directory to create
+ * @param mode mode for the new directory
+ * @return -1 (error) always
+ */
+int mkdir(const char *pathname, mode_t mode)
+{
+ errno = ENOSYS;
+ return -1;
+}