|
|
|
|
|
|
| Author |
Message |
Steve Schefter *nix forums beginner
Joined: 16 Mar 2005
Posts: 16
|
Posted: Thu Sep 22, 2005 12:31 pm Post subject:
Re: One problem about ioctl during porting from Solaris to Linux
|
|
|
| Quote: | 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 |
|
| Back to top |
|
 |
Dances With Crows *nix forums Guru
Joined: 01 Mar 2005
Posts: 328
|
Posted: Thu Sep 22, 2005 12:03 pm Post subject:
Re: One problem about ioctl during porting from Solaris to Linux
|
|
|
On Thu, 22 Sep 2005 17:09:04 +0800, Gavin Yu staggered into the Black
Sun and said:
| Quote: | During porting one application from Solaris to Linux, we encountered
one problem:
if (ioctl(4, I_PUSH, "ptem") < 0)
we found the return value of ioctl is always <0.
|
Is it EINVAL, ENXIO, or something else? This *might* be important.
| Quote: | Could anyone tell us how to deal with this issue?
|
When porting stuff from $FOO to Linux, it's usually not productive to
ask "How do I do ioctl(dev, I_QUUX, "crap") in Linux?". It's usually
much more productive to say what exactly it is you need to do, then see
if anyone knows an alternative way to do that thing. There's not
necessarily a one-to-one mapping between functions available on
commercial Unices and functions available on Linux, in other words.
| Quote: | Is there any replacement on Linux?
|
The only reference to I_PUSH defined in the kernel code is
arch/sparc64/solaris/ioctl.c . That part of the code is pretty
uncommented and looks a bit like gobbledegook to me, but
IANAKernelHacker.
--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / "He is a rhythmic movement of the
-----------------------------/ penguins, is Tux." --MegaHAL |
|
| Back to top |
|
 |
Gavin Yu *nix forums beginner
Joined: 07 Sep 2005
Posts: 16
|
Posted: Thu Sep 22, 2005 7:09 am Post subject:
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 |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Jan 08, 2009 6:02 am | All times are GMT
|
|
Internet Advertising | Bankruptcy | Low Interest Credit Card | Loans | Looking for Credit Cards?
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|