1758563 Members
2011 Online
108872 Solutions
New Discussion юеВ

chatr and C++

 
VanderstraetenJ
New Member

chatr and C++

Hi,
I work on HP-UX B11.11 plateforms and I've used the chatr command on a binary file in order to use the third quadrant as data space.
'chatr +q3p enable name_fo_the_binary'

I would like to get, in a C/C++ software, the value of the theorical data space accessible for this process (I saw on the man that when you enable the third quadrant, this value is increased from 1.9GB to 2.85GB)

Is there any way to get this value on a C/C++ software ?

Thanks,

Julien V
5 REPLIES 5
Peter Godron
Honored Contributor

Re: chatr and C++

Julien,
I don't know of a direct command, but how about mallocing space until loop fails?
VanderstraetenJ
New Member

Re: chatr and C++

Thanks for the answer but I can't use this solution... I don't find it very "clean" and I must respect a lot of constraints and more precisely, time constraints...

I think that a C/C++ function (like tuneinfo that allow to get a lot of system tunable parameters), if it exists, should give best time performs and is really the best solution for me.

Julien
Peter Godron
Honored Contributor

Re: chatr and C++

Hi,
please see James's answer in :
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=72276

His program will display the data space used for a specific id of a RUNNING process. I am sure you could adapt his code.

If you enabled the 3rd quadrant, you already stated how much data space increases to, so why do you want to check in your program.

Please also read on a general note:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward the answers given to your questions.

VanderstraetenJ
New Member

Re: chatr and C++

Although I know the value I want to check in my program the theorical accessible data space because I need to make a 'generic' algorithm that can be used on similar (but not exactly the same) case (it will be include in a kind of toolbox).

I'm searching around the James' answers since this morning but I don't find what I really search...

Perhaps I'm too tired... ;-)

Thanks again,

Julien
Dennis Handly
Acclaimed Contributor

Re: chatr and aC++

I assume you know that you must link with -N in order to get the 1.9 GB?

And on IPF you must link with -N to even use chatr +as mpas?