Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - realpath() on QNX.: (2 Items)
   
realpath() on QNX.  
Hello,
I am having trouble understating the nature of realpath() on QNX.
On Linux realpath("/proc/self/exe", buf) returns the name of the executable
> real_path (name of the executable)
>/home/abc/real_path
while on QNX
realpath("/proc/self/exefile",buf) returns
/proc/self/exefile .
I have attached the sample program for the same. In the program change /exe
to exefile on QNX.

Regards
-Akshat
Attachment: HTML sf-attachment-mime28152 621 bytes Text real_qnx.cpp 285 bytes
Re: realpath() on QNX.  
Just open the path and read() on the fd.

On Mon, Dec 22, 2014 at 06:18:19PM +0530, Akshat Gill wrote:
> Hello,
> I am having trouble understating the nature of realpath() on QNX.
> On Linux realpath("/proc/self/exe", buf) returns the name of the executable
> > real_path (name of the executable)
> >/home/abc/real_path
> while on QNX
> realpath("/proc/self/exefile",buf) returns
> /proc/self/exefile .
> I have attached the sample program for the same. In the program change /exe to
> exefile on QNX.
> 
> Regards
> -Akshat
> 

> /*
>  * Read the contents of the named symbolic links
>  */
> #include <limits.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
>  
>  
> int main( int argc, char** argv )
> {
>     char *buf = NULL; 
>     printf("## The value ::%s\n",realpath("/proc/self/exe", buf ));
>  
>   return( 0 );
> }