From fa2a27cfeb0de6696aba757fce0d723c4770ffad Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 4 Apr 2012 15:38:13 +0200 Subject: [PATCH] New "os" field in INFO output providing information about the operating system. --- src/redis.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/redis.c b/src/redis.c index 7befbac2..c7333317 100644 --- a/src/redis.c +++ b/src/redis.c @@ -48,6 +48,7 @@ #include #include #include +#include /* Our shared "common" objects */ @@ -1697,12 +1698,16 @@ sds genRedisInfoString(char *section) { /* Server */ if (allsections || defsections || !strcasecmp(section,"server")) { + struct utsname name; + if (sections++) info = sdscat(info,"\r\n"); + uname(&name); info = sdscatprintf(info, "# Server\r\n" "redis_version:%s\r\n" "redis_git_sha1:%s\r\n" "redis_git_dirty:%d\r\n" + "os:%s %s %s\r\n" "arch_bits:%d\r\n" "multiplexing_api:%s\r\n" "gcc_version:%d.%d.%d\r\n" @@ -1715,6 +1720,7 @@ sds genRedisInfoString(char *section) { REDIS_VERSION, redisGitSHA1(), strtol(redisGitDirty(),NULL,10) > 0, + name.sysname, name.release, name.machine, server.arch_bits, aeGetApiName(), #ifdef __GNUC__ -- 2.47.2