diff --git a/include/minix/optset.h b/include/minix/optset.h index a7e088122..bd12b6ba4 100644 --- a/include/minix/optset.h +++ b/include/minix/optset.h @@ -4,6 +4,7 @@ typedef enum { OPT_BOOL, OPT_STRING, + OPT_64INT, OPT_INT } optset_type; diff --git a/lib/libsys/optset.c b/lib/libsys/optset.c index be65cfa9e..22a54bdfb 100644 --- a/lib/libsys/optset.c +++ b/lib/libsys/optset.c @@ -33,6 +33,7 @@ int len; */ char *dst; int val; + int64_t val64; switch (entry->os_type) { case OPT_BOOL: @@ -52,6 +53,15 @@ int len; break; + case OPT_64INT: + if (len > 0) + val64 = (uint64_t) strtoull(ptr, NULL, entry->os_val); + else + val64 = 0; + + *((uint64_t *) entry->os_ptr) = val64; + + break; case OPT_INT: if (len > 0) val = (int) strtoul(ptr, NULL, entry->os_val); diff --git a/test/blocktest/blocktest.c b/test/blocktest/blocktest.c index 70c49431d..fee612f52 100644 --- a/test/blocktest/blocktest.c +++ b/test/blocktest/blocktest.c @@ -61,7 +61,7 @@ static int driver_deaths = 0; /* number of restarts that we saw */ /* Options supported by this driver. */ static struct optset optset_table[] = { { "label", OPT_STRING, driver_label, sizeof(driver_label) }, - { "minor", OPT_INT, &driver_minor, 10 }, + { "minor", OPT_64INT, &driver_minor, 10 }, { "rw", OPT_BOOL, &may_write, TRUE }, { "ro", OPT_BOOL, &may_write, FALSE }, { "sector", OPT_INT, §or_size, 10 },