Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - POSIX free application development: (4 Items)
   
POSIX free application development  
let us imagine a simple application whose fragment is below;

int fd = open("/home/my.txt", O_RDLY);
if( fd != -1 )
{
     read(....);
     close();
}

Is it possible to replace the calls to open() and read() and close() by QNX Native APIs like ConnectAttach(), MsgSend(),
 ConnectDetach(), etc?

Where can I find the sample code for this QNX native call flow?

RE: POSIX free application development  
It's certainly possible: that's how libc implements those routines after all ;-)  However, trying to actually duplicate 
POSIX semantics, you'll discover that there is quite a lot of code to write....  If all you need is an IPC mechanism 
though, it's not only feasible but actually recommended.  There is no actual need to tie yourself to POSIX open/read/
write/close semantics unless you are really dealing with something "file-like".  For plain IPC, MsgSend, MsgReceive, and
 MsgReply are the way to go.

Lots of documentation is available via http://www.qnx.com/developers/docs/
A brief introduction to the various out of the box IPC mechanisms can be found in http://www.qnx.com/developers/docs/6.5
.0_sp1/topic/com.qnx.doc.neutrino_sys_arch/ipc.html?cp=13_10_3
Re: RE: POSIX free application development  
Thanks for confirming...

I know QNX comes with a built in system trace facility (available in the instrumented kernel). Is it possible to roll 
out ones own? Meaning: what if I wanted to build a tool that could the number of times any executing application on the 
QNX system made calls to system functions - POSIX or native (like MsgSend, etc). Possible?
RE: RE: POSIX free application development  
No.  But you can build and application that counts the number of time an operation is performed based on the API that 
comes with the  instruction kernel.

-----Message d'origine-----
De : Manoj Sati [mailto:community-noreply@qnx.com] 
Envoyé : Saturday, March 01, 2014 12:17 AM
À : ostech-core_os
Objet : Re: RE: POSIX free application development

Thanks for confirming...

I know QNX comes with a built in system trace facility (available in the instrumented kernel). Is it possible to roll 
out ones own? Meaning: what if I wanted to build a tool that could the number of times any executing application on the 
QNX system made calls to system functions - POSIX or native (like MsgSend, etc). Possible?



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post109120
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com