Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

Mixed mode?

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Windows Server 2003 R2 SUA >> Mixed mode? Page: [1]
Login
Message << Older Topic   Newer Topic >>
Mixed mode? - Jul. 22, '06, 5:10:03 AM   
bdynin

 

Posts: 1
Joined: Jul. 22, '06,
Status: offline
I'm new to Interix.
I've a few basic questions.
1. Can I call 'mmap' (for example) from an EXE that also calls WIN32 functions?
2. If answer to (1) is yes, the next question: how to build such EXE? Should I use .H and .LIB files from Interix SDK?
3. If the above EXE is WIN32 console application project (C/C++) in VS2005, should I specify any additional options for the project?

Thanks a lot,
Boris
Post #: 1
RE: Mixed mode? - Jul. 23, '06, 1:03:02 AM   
Rodney

 

Posts: 3695
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
> I'm new to Interix.

Welcome

> 1. Can I call 'mmap' (for example) from an EXE that also calls WIN32 functions?

Time to backup a bit. The use of mixed mode is being misunderstood.
The intent of mixed mode is to allow an Interix (Unix) process to gain access to
Win32 API's. Not the other way around. That the resulting binary is marked as "Win32"
rather than as "Interix": this is to make the use of Win32 API from the process easier.
So the subsystem that nominally has authority over the process is CSRSS (Win32).
But the special way the headers are used and the libraries linked, for all intents
and purposes, is an Interix methodology.

So you look at it as "here's my Unix/Interix program, which Win32 API's must I use".

With this contextual change your questions get de-railed a bit.
The mmap() API can continue to be used in a mixed mode application.
But there's a twist specific to mmap() that requires no use of mixed mode. And this
fact goes back to at least Interix version 3.0. The file (or sections of file) that
you mmap() with an Interix process can be memory mapped by Win32 programs using Win32 API's.
Both sides play nicely with memory mapped files (or sections thereof).
I've written program that do this and I've documented it in earlier forum postings.

To other API's of course it is different.

When you build mixed mode applications you use Interix header files and libraries by default.
You selectively pick the minimal set of Win32 API's (the Oracle Win32 API set is the one MS
did as it's big example) to use in the program. As noted by one of the MS developers just a
short while ago the printf() you call is the Interix printf(), not the Win32 printf().

The "-R" flag with cc/c89 and gcc is what builds a mixed mode binary.
There's more information on the man pages of each of these commands for this option.

(in reply to bdynin)
Post #: 2
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> Windows Server 2003 R2 SUA >> Mixed mode? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.031