Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - _cmdname(): (5 Items)
   
_cmdname()  
_cmdname() doesn't behave the same under 6.3.2 and 6.4 (the same binary build under 6.3.2 )

When run from a machine called value

under QNX 6.3.2 : 

cd /net/neutrino/u/mcharest/logc/bin
./testApp
_cmdname() returned ./testApp.

under QNX6 6.4.0

cd /net/neutrino/u/mcharest/logc/bin
./testApp
_cmdname() returned /net/value/net/neutrino/u/mcharest/logc/bin/.testApp


This is causing grief to our code any way to get the same behavior.  I'm surprise it's different since it is using libc.
so.2 and not libc.so.3





Re: _cmdname()  
On Tue, Nov 25, 2008 at 01:07:53PM -0500, Mario Charest wrote:
> _cmdname() doesn't behave the same under 6.3.2 and 6.4 (the same binary build under 6.3.2 )
> 
> When run from a machine called value
> 
> under QNX 6.3.2 : 
> 
> cd /net/neutrino/u/mcharest/logc/bin
> ./testApp
> _cmdname() returned ./testApp.
> 
> under QNX6 6.4.0
> 
> cd /net/neutrino/u/mcharest/logc/bin
> ./testApp
> _cmdname() returned /net/value/net/neutrino/u/mcharest/logc/bin/.testApp
> 
> 
> This is causing grief to our code any way to get the same behavior.  I'm surprise it's different since it is using 
libc.so.2 and not libc.so.3
> 

Proc sets this up when loading the process so it's not
a libc issue.  This looks to have been done on purpose
and it now matches how it's doc'd as behaving.

Regards,

-seanb
Re: _cmdname()  
On Tue, Nov 25, 2008 at 01:07:48PM -0500, Mario Charest wrote:
> _cmdname() doesn't behave the same under 6.3.2 and 6.4 (the same binary build under 6.3.2 )

As Sean said, this was a bug fix - _cmdname() needs to always return the
full path so that it's a valid file name to open even if the application does
a chdir().

> This is causing grief to our code any way to get the same behavior.  I'm surprise it's different since it is using 
libc.so.2 and not libc.so.3

There's no way to get the old behaviour. What kind of grief is it causing
you?

BTW, libc.so.2 is pretty much a shell with just GCC compiler support
routines defined within it. Even if you run a 6.3.2 binary that wants to
use libc.so.2, the vast majority of the functions being invoked are actually
in libc.so.3.
Re: _cmdname()  
I've mentioned this change in the 6.4.0 release notes.
RE: _cmdname()  

-----Original Message-----
From: Brian Stecher [mailto:community-noreply@qnx.com] 
Sent: November-25-08 2:46 PM
To: ostech-core_os
Subject: Re: _cmdname()

On Tue, Nov 25, 2008 at 01:07:48PM -0500, Mario Charest wrote:
> _cmdname() doesn't behave the same under 6.3.2 and 6.4 (the same binary build under 6.3.2 )

As Sean said, this was a bug fix - _cmdname() needs to always return the
full path so that it's a valid file name to open even if the application does
a chdir().

> This is causing grief to our code any way to get the same behavior.  I'm surprise it's different since it is using 
libc.so.2 and not libc.so.3

There's no way to get the old behaviour. What kind of grief is it causing
you?

Already fix, it`s because we use the output of cmdname which is send to fullpath().  The output is then parsed to 
extract some component and the code wasn`t able to handle two /net.  

BTW, libc.so.2 is pretty much a shell with just GCC compiler support
routines defined within it. Even if you run a 6.3.2 binary that wants to
use libc.so.2, the vast majority of the functions being invoked are actually
in libc.so.3.

I see 

Thanks.