From owner-freebsd-questions@FreeBSD.ORG Mon Mar 14 02:13:23 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C736F106566C for ; Mon, 14 Mar 2011 02:13:23 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id A99FF8FC13 for ; Mon, 14 Mar 2011 02:13:23 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id p2E2DNEt074987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 13 Mar 2011 19:13:23 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id p2E2DNgr074986 for freebsd-questions@freebsd.org; Sun, 13 Mar 2011 19:13:23 -0700 (PDT) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA07747; Sun, 13 Mar 11 18:08:23 PST Date: Sun, 13 Mar 2011 19:08:20 -0700 From: perryh@pluto.rain.com To: freebsd-questions@freebsd.org Message-Id: <4d7d7894.ZVXy6HlL95xx+v0E%perryh@pluto.rain.com> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: logging to dmesg from userland X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 02:13:23 -0000 I am looking for a way to write into the kernel message buffer -- the one that dmesg prints out -- from a userland program, to help in relating kernel printf messages to the userland operations which provoked them. (Yes, I am aware of the potential DoS implications: the capability should be restricted to root, or at least to the "operator" group. I expect to use it only in single-user mode.) Is there a program, or a system call, which can do this? logger(1) seemed a likely prospect, but either it doesn't have this capability or I haven't found the formula.