niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » Linux » portable
One problem about ioctl during porting from Solaris to Linux
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Steve Schefter
*nix forums beginner


Joined: 16 Mar 2005
Posts: 16

PostPosted: Thu Sep 22, 2005 12:31 pm    Post subject: Re: One problem about ioctl during porting from Solaris to Linux Reply with quote

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

PostPosted: Thu Sep 22, 2005 12:03 pm    Post subject: Re: One problem about ioctl during porting from Solaris to Linux Reply with quote

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

PostPosted: Thu Sep 22, 2005 7:09 am    Post subject: One problem about ioctl during porting from Solaris to Linux Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 6:02 am | All times are GMT
navigation Forum index » *nix » Linux » portable
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Unknown in header problem -SOLVED- Light Speed Postfix 0 Thu Jul 03, 2008 10:40 am
No new posts problem with sending mail nuxia Postfix 0 Mon Apr 21, 2008 3:58 am
No new posts Postfix 2.3.8 Virtual problem Blotto Postfix 0 Fri Apr 04, 2008 6:11 am
No new posts Postfix sending problem for local domain remote email monkey_magix Postfix 0 Mon Sep 10, 2007 10:17 am
No new posts NFS server on Solaris 10 gurgle Solaris 0 Tue Sep 04, 2007 7:05 pm

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
[ Time: 0.3549s ][ Queries: 20 (0.2648s) ][ GZIP on - Debug on ]