Topic
1 reply Latest Post - ‏2013-07-29T14:47:44Z by GarlandJoseph
SystemAdmin
SystemAdmin
549 Posts
ACCEPTED ANSWER

Pinned topic PSE module pass can't load

‏2012-06-17T03:51:20Z |
#include <errno.h>
#include <sys/stream.h>

static int passclose(), passopen
(), passrput(), passwput();
static struct module_info minfo = { 0, "pass", 0, INFPSZ, 2048, 128 };
static struct qinit rinit = { passrput, 0, passopen, passclose, 0, &minfo };
static struct qinit winit = { passwput, 0, 0, 0, 0, &minfo };
struct streamtab passinfo = { &rinit, &winit };

static int
passclose (queue_t *q)
{
return 0;
}

static int
passopen (queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp)
{
return 0;
}

static int
passrput (queue_t *q, mblk_t *mp)
{
putnext(q, mp);
return 0;
}

static int
passwput (queue_t *q, mblk_t *mp)
{
putnext(q, mp);
return 0;
}
#include <sys/device.h>
#include <sys/strconf.h>

int
passconfig(int cmd, struct uio *uiop)
{
static strconf_t conf = {
"pass", &passinfo, STR_NEW_OPEN,
};

switch (cmd) {
case CFG_INIT: return str_install(STR_LOAD_MOD, &conf);
case CFG_TERM: return str_install(STR_UNLOAD_MOD, &conf);
default: return EINVAL;
}
}

this code is copy from <<Communications Programming Concepts>>
why str_install() return EINVAL?
  • GarlandJoseph
    GarlandJoseph
    10 Posts
    ACCEPTED ANSWER

    Re: PSE module pass can't load

    ‏2013-07-29T14:47:44Z  in response to SystemAdmin

    What is the exact error message? Where is this blowing up? How are you trying to "load" this code....please give exact command sequence and error messages.