From owner-freebsd-hackers Tue Mar 23 14:40:22 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from pak.texar.com (pak.texar.com [207.112.49.1]) by hub.freebsd.org (Postfix) with ESMTP id 7FF0E15417 for ; Tue, 23 Mar 1999 14:39:42 -0800 (PST) (envelope-from dseg@pak.texar.com) Received: (from dseg@localhost) by pak.texar.com (8.8.8/8.8.3) id RAA01221; Tue, 23 Mar 1999 17:39:25 -0500 (EST) Date: Tue, 23 Mar 1999 17:39:24 -0500 (EST) From: Dan Seguin To: freebsd-hackers@freebsd.org Subject: syscalls Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi all. Is it possible to make syscalls from KLDs? I had assumed that the indirect syscall(SYS_call, ...) would do the trick, but all I get is a panic (12, page fault) when I try to load the KLD. Is there anything special I need to do before calling syscall()? What I'm trying to do is create a socket/connect channel for auditing purposes. So... /* Code snippet */ { #include #include int sockfd; sockfd = syscall(SYS_socket, AF_UNIX, SOCK_STREAM, 0); } etc, etc. This appears in a function that is called upon KLD LOAD. I've tried __syscall((quad_t) SYS_socket, AF_UNIX, SOCK_STREAM, 0), to no avail. Thanks for your help. DSeg To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message