From: Elena Ufimtseva <ufimtseva@gmail.com>
To: linux-numa@vger.kernel.org
Cc: cpw@sgi.com, Elena Ufimtseva <ufimtseva@gmail.com>
Subject: [PATCH] numactl: checks for numa when showing hardware
Date: Sat, 23 Nov 2013 03:10:41 -0500 [thread overview]
Message-ID: <1385194241-6475-1-git-send-email-ufimtseva@gmail.com> (raw)
Checks if NUMA is available before printing hardware,
otherwise segfault occurs.
Signed-off-by: Elena Ufimtseva <ufimtseva@gmail.com>
---
numactl.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/numactl.c b/numactl.c
index 97955a4..f30b53c 100755
--- a/numactl.c
+++ b/numactl.c
@@ -242,6 +242,11 @@ void hardware(void)
int prevnode=-1;
int skip=0;
int maxnode = numa_max_node();
+
+ if (numa_available() < 0) {
+ printf("No NUMA available on this system\n");
+ exit(1);
+ }
for (i=0; i<=maxnode; i++)
if (numa_bitmask_isbitset(numa_nodes_ptr, i))
--
1.7.2.5
reply other threads:[~2013-11-23 8:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385194241-6475-1-git-send-email-ufimtseva@gmail.com \
--to=ufimtseva@gmail.com \
--cc=cpw@sgi.com \
--cc=linux-numa@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).