From owner-freebsd-hackers Sat Oct 13 10:47:21 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp2.libero.it (smtp2.libero.it [193.70.192.52]) by hub.freebsd.org (Postfix) with ESMTP id 0811D37B40D for ; Sat, 13 Oct 2001 10:47:19 -0700 (PDT) Received: from libero.it (151.33.118.140) by smtp2.libero.it (6.0.021) id 3BC5C21D0009C376 for freebsd-hackers@FreeBSD.ORG; Sat, 13 Oct 2001 19:47:18 +0200 Received: (from flag@localhost) by libero.it (8.11.6/8.11.6) id f9DHn2W38241 for freebsd-hackers@FreeBSD.ORG; Sat, 13 Oct 2001 19:49:02 +0200 (CEST) (envelope-from flag) Date: Sat, 13 Oct 2001 19:49:02 +0200 From: Paolo Pisati To: freebsd-hackers@FreeBSD.ORG Subject: First prg with sysctl Message-ID: <20011013194902.A38183@newluxor.skynet.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Useless-Header: Look ma, it's a # sign! X-Operating-System: FreeBSD newluxor.skynet.org 4.4-STABLE FreeBSD 4.4-STABLE Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Someone can tell me why this piece of code doesn't work? #include #include #include #include #include #include #include int main(void) { int mib[5], *count; mib[0]=CTL_NET; mib[1]=PF_LINK; mib[2]=NETLINK_GENERIC; mib[3]=IFMIB_SYSTEM; mib[4]=IFMIB_IFCOUNT; sysctl(mib, 5, count, sizeof(int),(void *)NULL, NULL); printf("count: %d\n",*count); } I'm searching the number of interfaces available. thanks. -- Paolo Visit the Italian FreeBSD User Group Site: www.gufi.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message