From owner-freebsd-questions@FreeBSD.ORG Wed May 16 17:47:30 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 754B616A403 for ; Wed, 16 May 2007 17:47:30 +0000 (UTC) (envelope-from iannone@info.ucl.ac.be) Received: from smtp2.sgsi.ucl.ac.be (smtp.dynsipr.ucl.ac.be [130.104.4.2]) by mx1.freebsd.org (Postfix) with ESMTP id B734C13C457 for ; Wed, 16 May 2007 17:47:29 +0000 (UTC) (envelope-from iannone@info.ucl.ac.be) Received: from smtp2.sgsi.ucl.ac.be (localhost.localdomain [127.0.0.1]) by smtp2.sgsi.ucl.ac.be (Postfix) with ESMTP id 5BFE6DB656 for ; Wed, 16 May 2007 19:28:36 +0200 (CEST) Received: from [130.104.229.121] (unknown [130.104.229.121]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: iannone@smtp2.sgsi.ucl.ac.be) by smtp2.sgsi.ucl.ac.be (Postfix) with ESMTP for ; Wed, 16 May 2007 19:28:36 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v752.2) To: freebsd-questions@freebsd.org Message-Id: From: Luigi Iannone Date: Wed, 16 May 2007 19:28:34 +0200 X-Mailer: Apple Mail (2.752.2) X-AV-Checked: ClamAV using ClamSMTP X-SGSI-MailScanner: Found to be clean X-SGSI-SpamCheck: X-SGSI-From: iannone@info.ucl.ac.be X-SGSI-Spam-Status: No Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: module compile error 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: Wed, 16 May 2007 17:47:30 -0000 Hi all, I'm trying to implement a freebsd module, but I'm blocked on the following error: When I try to compile my module, which has the following event handler static int module_event(module_t mod, int type, void *data) { int err = 0; int s; switch (type) { case MOD_LOAD: s = socket(AF_INET, SOCK_DGRAM, 0); /* THIS IS THE ERROR...*/ #ifdef LISP_DEBUG log(LOG_DEBUG," Module loaded "); #endif /* LISP_DEBUG */ break; case MOD_UNLOAD: #ifdef LISP_DEBUG log(LOG_DEBUG," Module unloaded"); #endif /* LISP_DEBUG */ break; default: err = EINVAL; break; } return err; } The compiler blocks with the error "warning: implicit declaration of function 'socket' ..... "warning: nested extern declaration of 'socket'". Any hint on what I do wrong? If this is not the correct mailinglist I apologies, just let me know where to send my question. Thanks iannone@info.ucl.ac.be