Changeset View
Changeset View
Standalone View
Standalone View
sbin/nvmecontrol/nvmecontrol.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
#include <stdbool.h> | #include <stdbool.h> | ||||
#include <stddef.h> | #include <stddef.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include "nvmecontrol.h" | #include "nvmecontrol.h" | ||||
#include "opts.h" | |||||
SET_CONCAT_DEF(top, struct nvme_function); | SET_CONCAT_DEF(top, struct nvme_function); | ||||
int | |||||
arg_parse_and_open(int argc, char * const * argv, const char *desc, const struct args *args) | |||||
{ | |||||
int fd; | |||||
if (arg_parse(argc, argv, desc, args)) | |||||
return (-1); | |||||
open_dev(argv[optind], &fd, 1, 1); | |||||
return (fd); | |||||
} | |||||
static void | static void | ||||
print_usage(const struct nvme_function *f) | print_usage(const struct nvme_function *f) | ||||
{ | { | ||||
const char *cp; | const char *cp; | ||||
char ch; | char ch; | ||||
bool need_prefix = true; | bool need_prefix = true; | ||||
▲ Show 20 Lines • Show All 288 Lines • Show Last 20 Lines |