AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only

PSE module pass can't load

  • 1.  PSE module pass can't load

    Posted Sat June 16, 2012 12:19 AM

    Originally posted by: SystemAdmin


    #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?
    #AIX-Forum