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





[EMAIL PROTECTED]



_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to