How to programmatically set EXTSHM=ON for shmat()

Hi,

I am looking for a way of setting EXTSHM=ON programmatically (in C)
such that it is recognised by shmat() calls in the same process (yes I
know it can be set in the environment at the shell level, but I don't
want to do that, I want it built into the application, library etc.). I
am using AIX 5.x. (see the shmat() man page for information about the
effect of setting the environment variable EXTSHM)

Simply coding a 'putenv("EXTSHM=ON")' only works for a subsequent
shmat() call if there is an exec() call after the putenv().

One kludgy way I have found (for a simple application) is to re-exec()
the main() of the program with EXTSHM=ON set, but this technique is not
suitable for hiding away in a library.

Does anybody know of any other way?

Thanks,
Greg

0
gregn2211 (2)
1/10/2006 5:25:30 AM
comp.unix.aix 10937 articles. 0 followers. drkirkby (98) is leader. Post Follow

2 Replies
310 Views

Similar Articles

[PageSpeed] 55
gregn2211 wrote:
> I am looking for a way of setting EXTSHM=ON programmatically (in C)
> such that it is recognised by shmat() calls in the same process (yes I
> know it can be set in the environment at the shell level, but I don't
> want to do that, I want it built into the application, library etc.).

You can't.  It takes effect at exec time, and by then it's too late.
You either set it in your shell, or use putenv/exec, or use a
shell script wrapper for your application.  No other options.

> the main() of the program with EXTSHM=ON set, but this technique is not
> suitable for hiding away in a library.

Why on earth are you trying to hide on OS-level setting?  If your
code requires EXTSHM, document the requirement and get on with
your life.
0
noway (263)
1/12/2006 3:24:20 AM
Hi Gary,

I just think the usage of this EXTSHM environment variable is kludgy,
and the developers of AIX could have achieved the same thing in a much
better way using an API or maybe even a linker option etc. (considering
that EXTSHM has performance ramifications and setting it can actually
break existing applications). Other UNIXes dont have such a restriction
on the number of shared memory segments used by an app, and even if
they did, they certainly wouldn't control it using an environment
variable. That's why I am trying to hide it, because I dont want to
have the requirement that some stupid environment variable be set prior
to running the software, the software should be able to set it itself.
Obviously a shell script wrapper is OK for confining the setting to a
particular application, but if you are just writing a plugin library to
an existing application, then that's not really an option.
Anyway, thanks for your input. At the least, I can check if EXTSHM is
not set, and issue an error message.

Greg

0
gregn2211 (2)
1/15/2006 10:59:08 PM
Reply:
Similar Artilces:

problem while setting srcollLeft a value
Here is my code : <DIV class = "scrollbar" id="HeaderDiv" scrolling="yes" > <xsl:attribute name = "style"> BORDER-RIGHT: medium none; BORDER-TOP: medium none; Z-INDEX: 150; LEFT: 1px; OVERFLOW: hidden; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; POSITION: absolute; TOP: 1px; HEIGHT: 35px WIDTH: <xsl:number value="Grid/GridConfig/@Width"/>; </xsl:attribute> ================================================================ Here i am trying to set the value of scrollLeft : onscroll ="debugger; if...

How to evaluate a notebook programmatically?
Hi, In one notebook, "gui.nb", I have the code for a user interface. In another, "functional.nb" I have around 3000 lines of code, in several hundred cells. I want to click a button (or something similar) in gui.nb, and tell Mathematica to execute all the cells in functional.nb. Functional.nb will use values for global variables that have been assigned in gui.nb, and gui.nb will display the results of the execution of functional.nb. Seems straightforward. Now in functional.nb, we group all the cells together, so that we can manually execute them all w...

Re: data set update #3
Alex, I've never tried the approach which datanull suggested, but one you might what to consider is the data step update statement. Take a look at: http://xrl.us/bi558 HTH, Art -------- On Wed, 9 Apr 2008 10:28:36 -0700, Alex Tang <Alex.Tang@CREDITONE.COM> wrote: >Hi there, > >Here I get a question of data manipulation. > >I have two data sets, say, couple of hundred numerical variables. Both >of them have same variables. > >First one is the data set I am working on. It's large, say million >observation. > >Second on is simply the mean of each...

Re: separating sets of job streams #4
We use the expedient of a globally defined command file we called "WAITFOR". The idiosyncrasy is that one must enclose the parameter in "triple quotes". (Double quote + single quote + parm + single quote + double quote.) We currently use a pause of 20 seconds, although this has changed over the years. The result is a SHOWTIME displayed in the $STDLIST until the job it is waiting for is finished. This can be used by any kind of PARENT job and nest as deep as you like. No message files required. (In a sense, it treats the job it is waiting for as the message.) ...

setting local time without restarting server
Hi, Is there a function that would allow me to set the local time while the server is running? I can't seem to find anything on this... Thanks, Peter ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org On Thu, May 13, 2004 at 12:56:48 -0600, Anony Mous <A.Mous@shaw.ca> wrote: > Hi, > > Is there a function that would allow me to set the local time while the > server is running? I can't seem to find anything on this... You prob...

FA: Aminet Set 2- 4 CD Set (121540910466)
FA: Aminet Set 2- 4 CD Set (121540910466) ...

Access Simulink programmatically
Hi All, Is there any way to access Simulink programatically (using COM Automation) through C# / VB .Net? can somebody reply with examples of sample code. Thanks, Sarang ...

setting bounds for fmincon
hi, I am new to MATLAB and I want to use the function fmincon to estimate 8 parameters, let us say for example: erp=[a1 a2 a3 a4 a5 a6 a7 a8] However i want the parameters to be bounded in such a way that a1>a2>a3>a4>a5>a6>a7>a8 Is there a way that I can do this? I would be really grateful. Thanks in advance. On 4 Apr., 09:12, "Nihal " <nihal.i...@gmail.com> wrote: > hi, > I am new to MATLAB and I want to use the function fmincon to estimate 8 parameters, let us say for example: > > erp=[a1 a2 a3 a4 a5 a6 a7 a8] > > Howev...

second set of eyes needed
Platform: Oracle 9.2 on Solaris 5.9 Recently started getting problems on a dev db of maxing out 'processes.' Made the decision to enable shared server, so added 'dispatchers' init parm, fiddled with shared pool and large pool sizes. When this all seemed to check out I replicated the same changes to qa, pre-prod and prod databases and to a set of dev/qa/pre-prod/prod 'sister' db's that live on another net. All but one of a total of 8 distinct db (and that one is one of the two prod db's) are showing mts dispatchers and shared server connections. The one db is...

How to set the axis
Hello group, I want to move(animate) an object from one point to another point. How to do this in java3d? I know I can use position interpolator. But it takes the Y-axis as the default one. How can I set the axis so that I move the object from point (x1,y1,z1) to (x2,y2,z2). thanks in advance. ...

[Semi-OT] Apple TV set (again)
One day they might print the story and they'll actually be right, until then they simply keep on guessing and hoping. :-\ From MacRumors.com ... Analyst Claims Apple Launching 55- and 65-Inch 4K Televisions Late Next Year ------------------------------------------------------------- Apple will launch 55- and 65-inch 4K ultra-high definition televisions late next year, if an analyst report from Masahiko Ishino at Advanced Research Japan is to be believed. Bloomberg shared the report, claiming the displays will have a frameless design wit...

Re-set a date
I have a dataset with two dates. The startdate is in chronological order by id: Startdate Finishdate id 04NOV07 04JAN08 55 08DEC07 07FEB08 55 02JAN08 03MAR08 55 07MAR08 07MAY08 55 10JUN05 10AUG05 76 17JUN05 16SEP05 76 09FEB06 11APR06 76 05NOV04 06DEC04 79 28MAR07 28MAY07 79 If the Finishdate is greater than the next Startdate, it needs to be reset to one day before the Startdate. Therefore, the result would look like this: Startdate Finishdate id 04N...

set(get(gcf,'JavaFrame'),'Maximized',1)
I'm trying to load a maximized figure. Adding Yair Altman's hack to the openingFcn function: set(get(gcf,'JavaFrame'),'Maximized',1); or even manually changing the size of the figure from within the openingFcn does indeed work, but only for a few miliseconds because later on later on gui_mainfcn continues, which in turn calls movegui('onscreen'), and that, in line 185 of movegui.m [Matlab r2007a] defines a margin of 30 pixels from the left hand side of the screen. Hence the figure is again resized and it no longer remains maximized. Annoying, to say the least. ...

Finding the callstack programmatically
Hi, Is there a way to find the call stack at any point of time inside a (C/C++) program? Whenever my program raises a SIGSEGV, is it possible for me to print the function call stack in the SIGSEGV handler? Thanks. Ashutosh Ashutosh wrote: > Hi, > > Is there a way to find the call stack at any point of time inside a (C/C++) > program? > Whenever my program raises a SIGSEGV, is it possible for me to print the > function call stack in the SIGSEGV handler? yes, but not portably. for x86 (Linux, FreeBSD), you would have to do something like this: void print_stack(int what...

Hibernate set to map
HiI've last Hibernate tools Eclipse plugin and used it to reverseengineering a MySQL DB.Everything went well except that it generates sets like this: <set name="nreferences" inverse="true"> <key> <column name="notification_id" not-null="true"> <comment></comment> </column> </key> <one-to-manyclass="com.bs.proteo.notifications.bl.beans.Nreference" /> </set>My application is an Axis 1.3 web service and...

Google Floating Logo Pen Set #2
These groovy pens are unique and fun. Watch the Google logo float around in the top half of the pen with this perfect gift for friends or family. for more info http://www.googleiloveu.blogspot.com/ ...

Add a flag in set statement
Hi All, This could be a easy fix but I am just not able to get it. So I have : Data1 id vis 1 101 1 102 2 101 2 105 2 106 4 101 5 106 Data2 id vis 1 999 4 997 4 999 7 999 Basically, I want to stack this two dataset using set statement and create a flag variable say flg = 1 if id is on both dataset. I did data = three; set data1 (in =a) data2 (in=b); if a and b then flg =1; run; But the variable flg is missing in data three. How do i do this? Thanks. On Wed, 18 Jan 2012 12:18:41 -0800 (PST), Sharon toose <toosewho@gmail.com> wrote: >Hi All, >This could be a easy fi...

setting permissions through JT400
Does anyone know how one goes about setting permissions for *PUBLIC using the JT400 IFS access classes? When I attempt it, I get an exception that indicates *PUBLIC is not a valid user profile name. How about the owner's permission? and the primary group? I do not want to rely on inherited authority. ...

LabVIEW String Control: Can you move the "typing cursor" programmatically? [Or fire a key on the keyboard programmatically?]
[NOTE: The "typing cursor" is not to be confused with the Waveform Graph "C= ursor" List.]<br><br>I am working on a VI that watches what my end-users ar= e typing into a String Control [via the "UpdtWhileTyping" property of the S= tring Control] and corrects [on the fly] for some standard data-entry error= s that we see.<br><br>Most of the time, the corrected strings are shorter t= han what the user had typed, and the "typing cursor" remains at the end of = the string, as it should.<br><br>On very rare occasions, howev...

Accessing property set streams from IStorage
Hello, This question is related to COM/OLE- based structured storage support (i.e IStorage, IStream, IPropertyStorage etc...). I've got a root storage which contains regular IStreams's and also a few different property set streams (IPropertyStorage's). These property set streams were created on the root storage object using IPropertySetStorage::Create and can be accessed using their FMTID and calling IPropertySetStorage::Open. I'm getting access to the the IPropertySetStorage interface on my root storage by first calling a IStorage::QueryInterface (IID_IPrope...

difference between sets
I am writing a method that will send a message to another object, based on changes (if any) bewtween two sets of data. I anticipate that this method will be called about 50k-100k times - i.e. it needs to check if there has been any change in a set of data a very large number of times. The way I am currently thinking of implementing this is to store a local copy of the set, and then check for a difference between the local copy and the newly received set - and then send the appropriate message based on the difference. Because of the large number of times this function will be executed ...

Re: convert the format of sas data sets
Jerry, Your code looks generally correct and fits with my understanding: you have to essentially copy the data sets to get the correct format. You should be able to use the SASHELP.VTABLE view to drive your conversion macro rather than trying to compute the names of the data sets. Before you get too worked up about potential CPU hits and reduced performance, you may want to test one or two programs against AIX and Linux structures. You may find that the difference, if any, is too small too worry about. Also, if this is going to be an ongoing problem, you might want to revisit how the data s...

Setting ButtonDownFcn Properties
Hi, I'm trying to create a click-and-drag style graphical interface to modify the data behind plotted maps. The main interface is a GUI which allows the configuration of plots displayed in a secondary figure containing an axes and all the usual figure tools. On creation of the plot in this figure (through the GUI .m script) I'm trying to assign a ButtonDownFcn property with the 'set' command which runs a custom function to get and update handle data on a pattern of clicks. I can get the function to run without function arguements but can't get it to include the 'han...

[rfc-dist] RFC 5987 on Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters
A new Request for Comments is now available in online RFC libraries. RFC 5987 Title: Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters Author: J. Reschke Status: Standards Track Stream: IETF Date: August 2010 Mailbox: julian.reschke@greenbytes.de Pages: 10 Characters: 20108 Updates/Obsoletes/SeeAlso: None I-D Tag: draft-reschke-rfc2231-in-http-12.txt ...

programmatic /proc/
Is there any way to get the data found within /proc/[pid]/maps without having to write code that will read and parse that file? If anyone can provide any links for general C programmer usage of proc, common issues, or an alternative source of the data within, I would be grateful. On 2008-01-07, TheWhirligig <dal3k@hotmail.com> wrote: > Is there any way to get the data found within /proc/[pid]/maps without > having to write code that will read and parse that file? > > If anyone can provide any links for general C programmer usage of > proc, common issues, or an alternativ...