linux-numa.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] numactl: checks for numa when showing hardware
@ 2013-11-23  8:10 Elena Ufimtseva
  0 siblings, 0 replies; only message in thread
From: Elena Ufimtseva @ 2013-11-23  8:10 UTC (permalink / raw)
  To: linux-numa; +Cc: cpw, Elena Ufimtseva

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-23  8:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-23  8:10 [PATCH] numactl: checks for numa when showing hardware Elena Ufimtseva

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 NNTP newsgroup(s).