summaryrefslogtreecommitdiff
path: root/Utilities/cmlibuv/src/strscpy.h
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmlibuv/src/strscpy.h')
-rw-r--r--Utilities/cmlibuv/src/strscpy.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/Utilities/cmlibuv/src/strscpy.h b/Utilities/cmlibuv/src/strscpy.h
new file mode 100644
index 000000000..fbe0a393f
--- /dev/null
+++ b/Utilities/cmlibuv/src/strscpy.h
@@ -0,0 +1,18 @@
+#ifndef UV_STRSCPY_H_
+#define UV_STRSCPY_H_
+
+/* Include uv.h for its definitions of size_t and ssize_t.
+ * size_t can be obtained directly from <stddef.h> but ssize_t requires
+ * some hoop jumping on Windows that I didn't want to duplicate here.
+ */
+#include "uv.h"
+
+/* Copies up to |n-1| bytes from |d| to |s| and always zero-terminates
+ * the result, except when |n==0|. Returns the number of bytes copied
+ * or UV_E2BIG if |d| is too small.
+ *
+ * See https://www.kernel.org/doc/htmldocs/kernel-api/API-strscpy.html
+ */
+ssize_t uv__strscpy(char* d, const char* s, size_t n);
+
+#endif /* UV_STRSCPY_H_ */