 +  return enclave_lseek(file, ptr, dir);
 +}
 +
-+int _mkdir(const char *pathname, int mode)
++int _mkdir(const char *pathname, mode_t mode)
 +{
 +  return enclave_mkdir(pathname, mode);
 +}

--- ../newlib-2.5.0.20170922/libgloss/enclave/enclave_syscalls.h
+++ ./libgloss/enclave/enclave_syscalls.h
@@ -0,0 +1,40 @@
+#ifndef THIRD_PARTY_LINUX_SGX_BSP_CALLTABLE_H_
+#define THIRD_PARTY_LINUX_SGX_BSP_CALLTABLE_H_
+
+#include <stdint.h>
+#include <sys/stat.h>

+}
+#endif
+
+#endif  // THIRD_PARTY_NEWLIB_SRC_LIBGLOSS_ENCLAVE_ENCLAVE_SYSCALLS_H_
diff -Naur ../newlib-2.5.0.20170922/libgloss/enclave/Makefile.in ./libgloss/enclave/Makefile.in
--- ../newlib-2.5.0.20170922/libgloss/enclave/Makefile.in
+++ ./libgloss/enclave/Makefile.in
