Changeset View
Changeset View
Standalone View
Standalone View
head/sbin/nvmecontrol/nvmecontrol.c
Show All 32 Lines | |||||
#include <sys/ioccom.h> | #include <sys/ioccom.h> | ||||
#include <sys/stat.h> | #include <sys/stat.h> | ||||
#include <ctype.h> | #include <ctype.h> | ||||
#include <dlfcn.h> | #include <dlfcn.h> | ||||
#include <err.h> | #include <err.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <fcntl.h> | #include <fcntl.h> | ||||
#include <libutil.h> | |||||
#include <paths.h> | #include <paths.h> | ||||
#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 <sysexits.h> | #include <sysexits.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
▲ Show 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | if (ctrlr_str != NULL) | ||||
*ctrlr_str = strndup(gnsid.cdev, sizeof(gnsid.cdev)); | *ctrlr_str = strndup(gnsid.cdev, sizeof(gnsid.cdev)); | ||||
if (nsid != NULL) | if (nsid != NULL) | ||||
*nsid = gnsid.nsid; | *nsid = gnsid.nsid; | ||||
} | } | ||||
int | int | ||||
main(int argc, char *argv[]) | main(int argc, char *argv[]) | ||||
{ | { | ||||
static char dir[MAXPATHLEN]; | |||||
cmd_init(); | cmd_init(); | ||||
cmd_load_dir("/lib/nvmecontrol", NULL, NULL); | cmd_load_dir("/lib/nvmecontrol", NULL, NULL); | ||||
cmd_load_dir(_PATH_LOCALBASE "/lib/nvmecontrol", NULL, NULL); | snprintf(dir, MAXPATHLEN, "%s/lib/nvmecontrol", getlocalbase()); | ||||
cmd_load_dir(dir, NULL, NULL); | |||||
cmd_dispatch(argc, argv, NULL); | cmd_dispatch(argc, argv, NULL); | ||||
return (0); | return (0); | ||||
} | } |