浏览代码

libkcore Disable checking of /proc files on non-linux systems

Olle E. Johansson 10 年之前
父节点
当前提交
45c3dbee61
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      lib/kcore/statistics.c

+ 6 - 0
lib/kcore/statistics.c

@@ -371,6 +371,12 @@ static int get_used_waiting_queue(
 	
 	int  waitingQueueSize = 0;
 
+#ifndef __OS_linux
+	/* /proc/net/tcp and /proc/net/udp only exists on Linux systems, so don't bother with
+	   trying to open these files */
+	return 0;
+#endif
+
 	/* Set up the file we want to open. */
 	if (forTCP) {
 		fileToOpen = "/proc/net/tcp";