One problem about ioctl during porting from Solaris to Linux - Portable

This is a discussion on One problem about ioctl during porting from Solaris to Linux - Portable ; Hi, During porting one application from Solaris to Linux, we encountered one problem about the function iotcl. Our codes are as below: ================================================== ============= if (ioctl(4, I_PUSH, "ptem") printf(" Error\n"); } ================================================== ============= we found the return value of ioctl ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: One problem about ioctl during porting from Solaris to Linux

  1. One problem about ioctl during porting from Solaris to Linux

    Hi,

    During porting one application from Solaris to Linux, we encountered one
    problem about the function iotcl.
    Our codes are as below:
    ================================================== =============
    if (ioctl(4, I_PUSH, "ptem") < 0) {
    printf(" Error\n");
    }
    ================================================== =============

    we found the return value of ioctl is always <0.
    Could anyone tell us how to deal with this issue? Is there any replacement
    on Linux?

    Thanks in advance!

    Yu




  2. Re: One problem about ioctl during porting from Solaris to Linux

    > During porting one application from Solaris to Linux, we encountered one
    > problem about the function iotcl.
    > Our codes are as below:
    > ================================================== =============
    > if (ioctl(4, I_PUSH, "ptem") < 0) {
    > printf(" Error\n");
    > }
    > ================================================== =============
    >
    > we found the return value of ioctl is always <0.



    I_PUSH is a Streams thing. It adds a Streams module above a driver
    or existing Streams stack that you've already got open. In the
    Streams world, it's how you build protocol stacks.

    There is no direct replacement in Linux. Streams is not part of
    Linux by default -- they re-invented their own methods for building
    stacks, polling buffers and flow control. While there is an add-on
    Streams environment for Linux (LiS), that probably won't help you
    very much. You'd be looking at not just porting your application,
    but also the module that corresponds to the name "ptem" that you
    are trying to push. And probably the drivers that lay below it.

    So you're probably looking for a wholesale replacement of what you
    are working with. If you give details on what you are trying to
    do (what protocol, etc), folks my be able to suggest an alternative.

    Regards,
    Steve

    ------------------------------------------------------------------------
    Steve Schefter phone: +1 705 725 9999 x26
    The Software Group Limited fax: +1 705 725 9666
    642 Welham Road,
    Barrie, Ontario CANADA L4N 9A1 Web: www.wanware.com


+ Reply to Thread