From owner-freebsd-current Wed Sep 9 03:40:36 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA19486 for freebsd-current-outgoing; Wed, 9 Sep 1998 03:40:36 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from korin.warman.org.pl (korin.nask.waw.pl [148.81.160.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA19461 for ; Wed, 9 Sep 1998 03:40:31 -0700 (PDT) (envelope-from abial@nask.pl) Received: from localhost (abial@localhost) by korin.warman.org.pl (8.9.1/8.8.5) with SMTP id MAA26792 for ; Wed, 9 Sep 1998 12:45:32 +0200 (CEST) X-Authentication-Warning: korin.warman.org.pl: abial owned process doing -bs Date: Wed, 9 Sep 1998 12:45:31 +0200 (CEST) From: Andrzej Bialecki X-Sender: abial@korin.warman.org.pl To: freebsd-current@FreeBSD.ORG Subject: Adding sysctl, part II Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-2020518627-905337931=:19836" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-2020518627-905337931=:19836 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, Well, I kind of figured out I probably need to use SYSCTL_PROC, and applied the following patch to machdep.c: Index: machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.307 diff -r1.307 machdep.c 213a214,222 > static int > sysctl_hw_msgbuf SYSCTL_HANDLER_ARGS > { > return(sysctl_handle_opaque(oidp,msgbufp,MSGBUF_SIZE,req)); > } > > SYSCTL_PROC(_machdep, OID_AUTO, msgbuf, CTLTYPE_STRUCT|CTLFLAG_RD, > 0, 0, sysctl_hw_msgbuf, "S,msgbuf",""); > and I wrote a simple program to get the info (attached). BUT... it returns garbage instead of msbguf contents... Also, there is yet another problem which I need to solve: with above sysctl I get only the msgbufp contents, and I need to also know the value of struct msgbuf in order to know where to start and stop reading. Any suggestions are appreciated... Andrzej Bialecki -------------------- ++-------++ ------------------------------------- ||PicoBSD|| FreeBSD in your pocket? Go and see: Research & Academic |+-------+| "Small & Embedded FreeBSD" Network in Poland | |TT~~~| | http://www.freebsd.org/~picobsd/ -------------------- ~-+==---+-+ ------------------------------------- --0-2020518627-905337931=:19836 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="test.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="test.c" I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8dW5pc3RkLmg+DQojaW5j bHVkZSA8c3lzL3R5cGVzLmg+DQojaW5jbHVkZSA8c3lzL21zZ2J1Zi5oPg0K I2luY2x1ZGUgPHN5cy9zeXNjdGwuaD4NCg0KaW50DQptYWluKGludCBhcmdj LCBjaGFyICphcmd2W10pDQp7DQoJaW50IGksbGVuOw0KCWNoYXIgKm1pYj0i bWFjaGRlcC5tc2didWYiOw0KCXVfY2hhciAqYnVmOw0KDQoJaT1zeXNjdGxi eW5hbWUobWliLE5VTEwsJmxlbixOVUxMLE5VTEwpOw0KCWlmKGk8MCkgew0K CQlwZXJyb3IoInN5c2N0bCIpOw0KCQlleGl0KC0xKTsNCgl9DQoJZnByaW50 ZihzdGRlcnIsImxlbj0lZFxuIixsZW4pOw0KCWJ1Zj0odV9jaGFyICopY2Fs bG9jKDEsbGVuKTsNCglzeXNjdGxieW5hbWUobWliLGJ1ZiwmbGVuLE5VTEws TlVMTCk7DQoJZnByaW50ZihzdGRlcnIsImxlbj0lZFxuIixsZW4pOw0KCXdy aXRlKDEsYnVmLGxlbik7DQp9DQo= --0-2020518627-905337931=:19836-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message