diff options
-rw-r--r-- | libtrivfs/io-version.c | 10 | ||||
-rw-r--r-- | libtrivfs/trivfs.h | 7 | ||||
-rw-r--r-- | trans/random.c | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/libtrivfs/io-version.c b/libtrivfs/io-version.c index e656d5cc..59a0ebef 100644 --- a/libtrivfs/io-version.c +++ b/libtrivfs/io-version.c @@ -27,5 +27,13 @@ trivfs_S_io_server_version (trivfs_protid_t obj, int *min, int *edit) { - return EOPNOTSUPP; + if (!obj) + return EOPNOTSUPP; + + if (!&trivfs_server_name || !&trivfs_server_version) + return EOPNOTSUPP; + + snprintf (name, sizeof (string_t), "%s %s", + trivfs_server_name, trivfs_server_version); + return 0; } diff --git a/libtrivfs/trivfs.h b/libtrivfs/trivfs.h index c920b678..1295fe17 100644 --- a/libtrivfs/trivfs.h +++ b/libtrivfs/trivfs.h @@ -74,6 +74,13 @@ struct trivfs_control void *hook; /* for user use */ }; +/* The user may define this variable. Set this to the name of the + filesystem server. */ +extern char *trivfs_server_name __attribute__((weak)); + +/* The user may define this variables. Set this to be the server + version number. */ +extern char *trivfs_server_version __attribute__((weak)); /* The user must define these variables. */ extern int trivfs_fstype; diff --git a/trans/random.c b/trans/random.c index f0b99dd4..b409d39f 100644 --- a/trans/random.c +++ b/trans/random.c @@ -44,6 +44,8 @@ +char *trivfs_server_name = "random"; + /* Entropy pool. We use one of the SHAKE algorithms from the Keccak family. Being a sponge construction, it allows the extraction of arbitrary amounts of pseudorandom data. */ |