Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
catopen() behavior on solaris-opetron and solaris-sparc
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
mukesh  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 10:21
Newsgroups: comp.unix.programmer
From: mukesh <mukeshm...@gmail.com>
Date: Fri, 6 Nov 2009 02:21:22 -0800 (PST)
Local: Fri 6 Nov 2009 10:21
Subject: catopen() behavior on solaris-opetron and solaris-sparc
Hello,

catopen()  function behaves in different ways on solaris-sparc and
solaris-opteron O/S platforms.

If NLSPATH is exported pointing to NLSPATH=/home/expert/msg/%N and
test.cat file is in /home/expert/msg/ folder in that case

if we call :
   rc = catopen("test", 0)

then on solaris-sparc it returns   -1 whereas on solaris-opteron
platform it succeed.

which is the correct behavior ... ??

Thanks

Mukesh


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Casper H. S. Dik  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 10:32
Newsgroups: comp.unix.programmer
From: Casper H.S. Dik <Casper....@Sun.COM>
Date: 06 Nov 2009 10:32:42 GMT
Local: Fri 6 Nov 2009 10:32
Subject: Re: catopen() behavior on solaris-opetron and solaris-sparc

mukesh <mukeshm...@gmail.com> writes:
>Hello,
>catopen()  function behaves in different ways on solaris-sparc and
>solaris-opteron O/S platforms.
>If NLSPATH is exported pointing to NLSPATH=/home/expert/msg/%N and
>test.cat file is in /home/expert/msg/ folder in that case
>if we call :
>   rc = catopen("test", 0)
>then on solaris-sparc it returns   -1 whereas on solaris-opteron
>platform it succeed.
>which is the correct behavior ... ??

What are the permissions of the files?

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mukesh  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 11:35
Newsgroups: comp.unix.programmer
From: mukesh <mukeshm...@gmail.com>
Date: Fri, 6 Nov 2009 03:35:09 -0800 (PST)
Local: Fri 6 Nov 2009 11:35
Subject: Re: catopen() behavior on solaris-opetron and solaris-sparc
On Nov 6, 3:32 pm, Casper H.S. Dik <Casper....@Sun.COM> wrote:

catalog file has read permission on both the pltaforms(sparc and
opteron).

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Casper H. S. Dik  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 13:05
Newsgroups: comp.unix.programmer
From: Casper H.S. Dik <Casper....@Sun.COM>
Date: 06 Nov 2009 13:05:22 GMT
Local: Fri 6 Nov 2009 13:05
Subject: Re: catopen() behavior on solaris-opetron and solaris-sparc

What does truss reveal?

Perhaps the files are machine dependent.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mukesh  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 14:13
Newsgroups: comp.unix.programmer
From: mukesh <mukeshm...@gmail.com>
Date: Fri, 6 Nov 2009 06:13:01 -0800 (PST)
Local: Fri 6 Nov 2009 14:13
Subject: Re: catopen() behavior on solaris-opetron and solaris-sparc
On Nov 6, 6:05 pm, Casper H.S. Dik <Casper....@Sun.COM> wrote:

truss output on solaris-opteron :
.....
....

fxstat(2, 4, 0x07E58400)                        = 0
close(4)                                        = 0
open("/home/expert/msg/test", O_RDONLY) Err#2 ENOENT
brk(0x080895C0)                                 = 0
brk(0x0808B5C0)                                 = 0
brk(0x0808B5C0)                                 = 0
brk(0x0808D5C0)                                 = 0
brk(0x0808D5C0)                                 = 0
brk(0x080955C0)                                 = 0
brk(0x080955C0)                                 = 0
brk(0x080A55C0)                                 = 0
......
......

-
 Mukesh


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Casper H. S. Dik  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 14:17
Newsgroups: comp.unix.programmer
From: Casper H.S. Dik <Casper....@Sun.COM>
Date: 06 Nov 2009 14:17:57 GMT
Local: Fri 6 Nov 2009 14:17
Subject: Re: catopen() behavior on solaris-opetron and solaris-sparc

Is the catopen() file created on SPARC or on x86?

Both need a different file.

The catopen files are binary files and they can only be
used on system with same-endian.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mukesh  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 14:31
Newsgroups: comp.unix.programmer
From: mukesh <mukeshm...@gmail.com>
Date: Fri, 6 Nov 2009 06:31:32 -0800 (PST)
Local: Fri 6 Nov 2009 14:31
Subject: Re: catopen() behavior on solaris-opetron and solaris-sparc
On Nov 6, 7:17 pm, Casper H.S. Dik <Casper....@Sun.COM> wrote:

> Is the catopen() file created on SPARC or on x86?

> Both need a different file.

> The catopen files are binary files and they can only be
> used on system with same-endian.

> Casper
> --
> Expressed in this posting are my opinions.  They are in no way related
> to opinions held by my employer, Sun Microsystems.
> Statements on Sun products included here are not gospel and may
> be fiction rather than truth.

Hi Casper,

thanks for your quik response !!

the catalog files are created on the respective platform.

FYI:
If exported NLSPATH=/home/expert/msg/%N.cat in that case it works fine
on solaris-opteron.

The question here is why the catopen() library function behaving in
the different way on solaris-opteron and other UNIX platforms(solaris-
sparc, AIX, HPUX, LINUX) ?

-
 Mukesh


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Barry Margolin  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 02:17
Newsgroups: comp.unix.programmer
From: Barry Margolin <bar...@alum.mit.edu>
Date: Fri, 06 Nov 2009 21:17:08 -0500
Local: Sat 7 Nov 2009 02:17
Subject: Re: catopen() behavior on solaris-opetron and solaris-sparc
In article
<7a46ae7d-621a-4b82-bff8-2aba41b01...@l2g2000yqd.googlegroups.com>,

 mukesh <mukeshm...@gmail.com> wrote:
> On Nov 6, 7:17 pm, Casper H.S. Dik <Casper....@Sun.COM> wrote:
> > Is the catopen() file created on SPARC or on x86?

> > Both need a different file.

> > The catopen files are binary files and they can only be
> > used on system with same-endian.

> > Casper

Casper, did you read the truss he posted?  It got an error from open(),
so how can the file format be relevant?

> Hi Casper,

> thanks for your quik response !!

> the catalog files are created on the respective platform.

> FYI:
> If exported NLSPATH=/home/expert/msg/%N.cat in that case it works fine
> on solaris-opteron.

> The question here is why the catopen() library function behaving in
> the different way on solaris-opteron and other UNIX platforms(solaris-
> sparc, AIX, HPUX, LINUX) ?

For some reason, those other platforms are adding a .cat suffix, even
though it wasn't in your NLSPATH value.  I don't see any mention of this
default suffix in the POSIX specification, I guess it's an extension.

So if your catalog filename ends in .cat, you need to include that in
either NLSPATH or in the name argument to catopen(), rather than depend
on this non-portable behavior.

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mukesh  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 05:07
Newsgroups: comp.unix.programmer
From: mukesh <mukeshm...@gmail.com>
Date: Fri, 6 Nov 2009 21:07:29 -0800 (PST)
Local: Sat 7 Nov 2009 05:07
Subject: Re: catopen() behavior on solaris-opetron and solaris-sparc
On Nov 7, 7:17 am, Barry Margolin <bar...@alum.mit.edu> wrote:

Other platforms are not adding .cat suffix rather they are returning
-1, it is succeeding only on solaris -x86 platform. That's why I
thought of posting this issue.

Why catopen() behaves in different way on solaris-x86 than other UNIX
platforms(including solaris-sparc).
Is there any implementaion specific issue.
if yes .. then in that case I think atleast it should consistent
across both the solaris-x86 and the solaris-sparc platforms.

-
  Mukesh


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Casper H. S. Dik  
View profile   Translate to Translated (View Original)
 More options 7 Nov, 10:26
Newsgroups: comp.unix.programmer
From: Casper H.S. Dik <Casper....@Sun.COM>
Date: 07 Nov 2009 10:26:01 GMT
Local: Sat 7 Nov 2009 10:26
Subject: Re: catopen() behavior on solaris-opetron and solaris-sparc

Barry Margolin <bar...@alum.mit.edu> writes:
>In article
><7a46ae7d-621a-4b82-bff8-2aba41b01...@l2g2000yqd.googlegroups.com>,
> mukesh <mukeshm...@gmail.com> wrote:
>> On Nov 6, 7:17 pm, Casper H.S. Dik <Casper....@Sun.COM> wrote:
>> > Is the catopen() file created on SPARC or on x86?

>> > Both need a different file.

>> > The catopen files are binary files and they can only be
>> > used on system with same-endian.

>> > Casper
>Casper, did you read the truss he posted?  It got an error from open(),
>so how can the file format be relevant?

I didn't react to that posting; but yes, it looks like the file wasn't
even there.

>For some reason, those other platforms are adding a .cat suffix, even
>though it wasn't in your NLSPATH value.  I don't see any mention of this
>default suffix in the POSIX specification, I guess it's an extension.

But why does it work differently between Solaris SPARC & x86?

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Barry Margolin  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 06:00
Newsgroups: comp.unix.programmer
From: Barry Margolin <bar...@alum.mit.edu>
Date: Sun, 08 Nov 2009 01:00:09 -0500
Local: Sun 8 Nov 2009 06:00
Subject: Re: catopen() behavior on solaris-opetron and solaris-sparc
In article
<d1b7169a-a57c-44db-8b6d-571415ff3...@j24g2000yqa.googlegroups.com>,

I got confused about which platforms are behaving one way or the other.  
Your messages weren't very clear about it.  In any case, the point is
that if it works, the implementation is adding .cat automatically.

> Why catopen() behaves in different way on solaris-x86 than other UNIX
> platforms(including solaris-sparc).
> Is there any implementaion specific issue.
> if yes .. then in that case I think atleast it should consistent
> across both the solaris-x86 and the solaris-sparc platforms.

I don't know.  Maybe there was an earlier version of catopen() that
worked this way, and it's for backward compatibility.

Mac OS X's catopen() has extensions that allow other % codes in addition
to POSIX's %N.

> -
>   Mukesh

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mukesh  
View profile   Translate to Translated (View Original)
 More options 9 Nov, 10:29
Newsgroups: comp.unix.programmer
From: mukesh <mukeshm...@gmail.com>
Date: Mon, 9 Nov 2009 02:29:34 -0800 (PST)
Local: Mon 9 Nov 2009 10:29
Subject: Re: catopen() behavior on solaris-opetron and solaris-sparc
On Nov 8, 11:00 am, Barry Margolin <bar...@alum.mit.edu> wrote:

I think it's bug in sun studio on solaris-x86.

From catopen manual :

http://www.opengroup.org/onlinepubs/000095399/functions/catopen.html

++++++++++++++
nl_catd catopen(const char *name, int oflag);
….
….
The full set of metacharacters is:

%N The value of the name parameter passed to catopen()
….

RETURN VALUES
Upon successful completion, catopen() returns a message
catalog descriptor for use on subsequent calls to cat-
gets() and catclose(). Otherwise it returns (nl_catd) -1.
...
...

ERRORS
The catopen() function may fail if:
...
...
ENOENT The message catalogue does not exist or the
name argument points to an empty string.
...
++++++++++++++++++
From above if message catalog file doesn't exist then catopen should
return -1(ENOENT).
So on other UNIX platforms it works as expected except solaris-x86.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google