* Copyright(c) 2019 Intel Corporation
*/
+#include <stdarg.h>
+
#include <fcntl.h>
#include <io.h>
#include <share.h>
return -1;
}
+ /* eal_log_level_parse() already handled this option */
+ if (opt == OPT_LOG_LEVEL_NUM)
+ continue;
+
ret = eal_parse_common_option(opt, optarg, internal_conf);
/* common parser is not happy */
if (ret < 0) {
return fctret;
}
+/* Don't use MinGW asprintf() to have identical code with all toolchains. */
+int
+eal_asprintf(char **buffer, const char *format, ...)
+{
+ int size, ret;
+ va_list arg;
+
+ va_start(arg, format);
+ size = vsnprintf(NULL, 0, format, arg);
+ va_end(arg);
+ if (size < 0)
+ return -1;
+ size++;
+
+ *buffer = malloc(size);
+ if (*buffer == NULL)
+ return -1;
+
+ va_start(arg, format);
+ ret = vsnprintf(*buffer, size, format, arg);
+ va_end(arg);
+ if (ret != size - 1) {
+ free(*buffer);
+ return -1;
+ }
+ return ret;
+}
+
int
rte_vfio_container_dma_map(__rte_unused int container_fd,
__rte_unused uint64_t vaddr,