+/* Copies 'src' to 'dst'. Reads no more than 'size - 1' bytes from 'src'.
+ * Always null-terminates 'dst' (if 'size' is nonzero), and writes a zero byte
+ * to every otherwise unused byte in 'dst'.
+ *
+ * Except for performance, the following call:
+ * ovs_strzcpy(dst, src, size);
+ * is equivalent to these two calls:
+ * memset(dst, '\0', size);
+ * ovs_strlcpy(dst, src, size);
+ *
+ * (Thus, ovs_strzcpy() is similar to strncpy() without some of the pitfalls.)
+ */
+void
+ovs_strzcpy(char *dst, const char *src, size_t size)
+{
+ if (size > 0) {
+ size_t len = strnlen(src, size - 1);
+ memcpy(dst, src, len);
+ memset(dst + len, '\0', size - len);
+ }
+}
+
+/* Prints 'format' on stderr, formatting it like printf() does. If 'err_no' is
+ * nonzero, then it is formatted with ovs_retval_to_string() and appended to
+ * the message inside parentheses. Then, terminates with abort().
+ *
+ * This function is preferred to ovs_fatal() in a situation where it would make
+ * sense for a monitoring process to restart the daemon.
+ *
+ * 'format' should not end with a new-line, because this function will add one
+ * itself. */
+void
+ovs_abort(int err_no, const char *format, ...)
+{
+ va_list args;
+
+ va_start(args, format);
+ ovs_error_valist(err_no, format, args);
+ va_end(args);
+
+ abort();
+}
+
+/* Prints 'format' on stderr, formatting it like printf() does. If 'err_no' is
+ * nonzero, then it is formatted with ovs_retval_to_string() and appended to
+ * the message inside parentheses. Then, terminates with EXIT_FAILURE.
+ *
+ * 'format' should not end with a new-line, because this function will add one
+ * itself. */