How to programmatically set EXTSHM=ON for shmat()

  • Permalink
  • submit to reddit
  • Email
  • Follow


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
Reply gregn2211 (2) 1/10/2006 5:25:30 AM

See related articles to this posting


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
Reply 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
Reply gregn2211 (2) 1/15/2006 10:59:08 PM
comp.unix.aix 10891 articles. 6 followers. Post

2 Replies
225 Views

Similar Articles

[PageSpeed] 23


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Algorithm to combine or-sets of and-sets, where each element of an and-set is an or-set of and-sets
As part of an abduction procedure, see http://code.google.com/p/biohacker/source/browse/trunk/BPS/ltms/abduction.lisp if interested, I need to efficiently solve the following problem: Given an or-set of and-sets, for example, (:OR (:AND A B C) (:AND D E A)) and given a dictionary, where each element of an and-set is listed, with another or-set of and-sets as value, for example, A -> (:OR (:AND 1 2) (:AND 3 4)) B -> (:OR (:AND 2 3) (:AND 4)) C -> (:OR (:AND 1) (:AND 3)) D -> (:OR (:AND 1) (:AND 3 4)) E -> (:OR (:AND 1 2) (:AND 3)) find a new minimal or-set of and-set consistent,...

Set of sets
Is there a Latex (or indeed a mathematical) symbol for 'the set of sets'? Cheers. On Jun 19, 10:43=A0am, "Axis" <zedc...@hotmail.co.uk> wrote: > Is there a Latex (or indeed a mathematical) symbol for 'the set of sets'? > > Cheers. I'm not sure what you mean. I'd write something like B=3D\{A_1,\ldots,A_T\} "Joris" <pinkse@gmail.com> wrote in message news:583b3c5c-a019-4be7-a936-876f06160b05@l28g2000vba.googlegroups.com... On Jun 19, 10:43 am, "Axis" <zedc...@hotmail.co.uk> wrote: > Is there a Latex (...

set of sets
I thought rewriting __hash__ should be enough to avoid mutables problem but: class H(set): def __hash__(self) return id(self) s=H() f=set() f.add(s) f.remove(s) the add succeeds the remove fails eventually not calling hash(s). Thanks for help Paolino ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it Paolino wrote: > I thought rewriting __hash__ should be enough to avoid mutables problem > but: > > class H(set): > def __hash__(self) > return id(self) > > s=H() > >...

Setting and more Settings
I have a Epson 4990 and a spyder2 express. The Epson twain configuration allows me to set color control in one of three ways 1. continuous auto exposure. on this option you must set a gamma value from 1.0 to 3.0 (in 0.1 increments) 2. ICM With a source and a target. The source is locked as (EPSON standard) The target has a choice of monitorRGB or sRGB 3. No color correction What would be the best choice for the above options ? Also, given the fact that I am using the spyder2 to load Monitor calibration settings into my video card at windows ...

sets of sets
I'm trying to read a recent paper I found at http://csr.uvic.ca/~vanemden/Publications/STPCS.pdf (The description intrigued me because the author is exploring RT. I'll try to contact the author with my question, but I thought I'd mention it here as others may be interested.) Anyway, at the top of page 5, he defines something I can only call "UNION S" (since I don't know know how to type the set union operator symbol). Can anybody suggest whether I'm reading it right? What I think it says in prose is "the set of x such that x is a member...

Set onBlur() programmatically?
Is it possible to set the onBlur of a link or other focusable element programmatically? A search of the archive showed plenty of examples of setting the onBlur() for each link or form element when it was defined, but I am after something that can iterate all links in the page and add a common onBlur functionality to every one. [ I only require this to fix problems with particular pages, but then I need to apply the fix to whatever focusable elements are on the page. ] -- Andrew Thompson http://www.PhySci.org/ Open-source software suite http://www.PhySci.org/codes/ Web & IT Help h...

Setting DSN programmatically ?
Hello. I have a MS Access front-end working with PostgreSQL database. I have successfully created saved File DSN. My paa-through queries are referring to that file as well as linked tables. But I don't understand what will happen when I distribute my front-end to some other PC. How will Access know where is File DSN ? Is there any way that I set the connection programmatically. For example, some login form with neccessary informations ? Thanks. I use only DSN-less connections with SQL Server, Oracle and other databases. It makes things so much easier and so much more portable. Belo...

set LinkMasterFields programmatically
Hi: I have a database created in A2003 that I'm converting to A2007. It's throwing an error that's driving me crazy because the code has worked perfectly for years in A2003. I have a main form with an unbound subform, and I change the subform's recordsource based on what the user is doing. So there's some standard code that handles that switch. The subform is called "changeSub" ....snip Me!changeSub.SourceObject = "xxx subform" Me!changeSub.LinkMasterFields = "callID" Me!changeSub.LinkChildFields = "callID&q...

Set textfield programmatically
Can someone explain how to programmatically set the text in a textfield in an iPhone app? A code snippet would be very helpful. Thanks. In article <gqh80605tl@enews2.newsguy.com>, "fripper" <young@indiana.edu> wrote: > Can someone explain how to programmatically set the text in a textfield in > an iPhone app? A code snippet would be very helpful. > > Thanks. [textField setText:@"some Text"]; That doesn't work. Do I need to use Interface Builder to make some sort of connection between the test field control and my ...

programmatically set a Favourites Folder
Hi. Is there a way in SAS 9.1.3 on Windows XP to programmatically create a Favourite Folder for use in the Explorer Dock in the SAS environment? Thanks, Jared Jared, I would still take a look at the two threads mentioned in my previous post. If you combine those ideas with the idea provided in the following thread ( http://xrl.us/uase ), namely permanently assigning a libname in an autoexec.sas file, I think you may be able to accomplish what you want. Art --------- On Tue, 16 Jan 2007 21:17:01 -0800, webonomic <webonomic@GMAIL.COM> wrote: >I'll clarify. Just like a pers...

character-set setting
All - What's the proper setting that I need to have for the character-set option? I currently use ISO-8859-1 and only use English, not specia characters, etc. but it's annoying because I get messages in UTF-8 and I get that notice at the top of each email. I know I can enable quell-charset-warning, but I was wondering if I should change the value of character-set to something else. Thank you for your help. DJ *** DJ-usenet (edon.johnson@cashette.comet) wrote in comp.mail.pine on May...: :) What's the proper setting that I need to have for the character-set :) option? There ...

Set Page Scaling programmatically
I'm creating a PDF document using FOP but to print it correctly, I have to set Page Scaling to None in the print dialog box. Is there a way to programmically stop page scaling (ie default it to None?) Thanks for help. ...

How to programmatically set a tunable parameter?
In Simulink, if you set the inline option in the Configuration/Optimization for your model, you can make a parameter tunable by hitting the Configure button and adding it to the Global (tunable) parameters list. I want to perform the same functionality programmatically yet I have been unable to find a Matlab command to do this? Can this be done programmatically? There are a couple of ways to tackle this. A. If you are using straight MATLAB variables for your parameters, e.g. you say K1 = MyValue to create the parameters, then you need to set the following 2 model properties. set_param(gcs,...

Setting up a RAID set
I've read the instructions on how to set up a RAID set on my machine. I'll be using an external drive to mirror my boot drive for backup purposes. Mac Help doesn't provide much detail. What happens to the data that is on the disks when I set up the RAID set? Each disk is 500GB. There is about 150GB of data on the boot disk that I cannot afford to lose. -- It's singing Jim, but not as we know it. In article <2007082823505275249-@news.internode.on.net>, Scott wrote: > What happens to the data that is on the disks when I set up the RAID > set? It goes away...

Set volume label programmatically ?
Hi, Is there a way of setting the volume label programmatically on VMS ? Any system services to achive the same as SET VOLUME / LABEL -Malav Malav wrote: > Hi, > > Is there a way of setting the volume label programmatically on VMS ? > Any system services to achive the same as SET VOLUME / LABEL > > -Malav > I don't think so. I did a quick scan of the code for SET VOLUME and it is does it 'by hand'. So you are left with LIB$SPAWN. -- John Reagan HP Pascal/{A|I}MACRO for OpenVMS Project Leader Hewlett-Packard Company In article <inYfg.1420$5R5....

Set of Sets and eql?
I recently discovered the 'set' library after browing www.ruby-doc.org. It's very useful - I'm using it all the time now. I especially like Set#classify. One thing that tripped me up: require 'set' a = [1, 2].to_set b = [3, 4].to_set # Set of Sets pairs = [a, b].to_set e = [1, 2].to_set p(pairs.include?(e)) # -> false p(a == e) # -> true p(a.eql?(e)) # -> false This is with "ruby 1.9.0 (2004-02-28) [i686-linux]". I've commented on `eql?' before, e.g. Structs used to use reference equality (before 1....

Setting CGI parameter programmatically
I have a form with a couple of submit buttons, plus a "pseudolink" that is also supposed to submit the form; the submitted form data feeds to a CGI script. The two submit buttons have the name "go_for_it", so that when the form is submitted, the CGI script looks for the value of the CGI parameter "go_for_it". I want the pseudolink to set the value of this CGI parameter prior to submitting the form, but I can't get it to work. Here's the latest version of the HTML+JavaScript code for the pseudolink: <a onclick="var f = document.forms['...

programmatic processor sets trouble
Hi, In my program I'm trying to set myself to different processor sets at different times during execution. I've given myself PRIV_SYS_RES_CONFIG by adding sys_res_config to my entry in /etc/ user_attr so I think I should be able to do this. I'm doing something roughly like this (I've stripped error handling etc from this example): if (pset_exists) pset_destroy(pset); pset_create(&pset)) unsigned b = get_bitmask(), i = 0; while (b) { if (b&1) { pset_assign(pset, i, NULL); b >>= 1; i++; } pset_bind(pset, P_PID, P_MYID, NULL)) No errors o...

Programmatically setting the Toggle Key?
I want to programmatically change the Toggle Key settings for a Boolean control. I can easily use the server property ToggleKeyBind to revoke any settings (by creating a default constant), but try as I might, I can't work out how to set the Return Key to the Toggle. If I use '\n' to insert a return character key, I get an error: "Error 15, Resource Not Found." I just cannot figure out how to programmatically set the Return Key as the Toggle setting. Does anyone know how to do this?Thanks in advance for everyone's suggestions. Is there anything unclear in the online h...

Setting up a Settings Table
I am creating an image gallery system, where there is an admin and multiple users upload images. Each user is restricted to uploading 8 images. Currently, I have this hard coded into a trigger. I would like it to use a table field instead... one that the admin can change on the fly. I want to call this table Settings, but I want to create insert 1 record, and then block all subsequent INSERT statements (there's only going to be 1 setting) so that the Settings table will only have 1 record in it for its entire lifetime. What's the best way to do this? I would create a table like ...

How to set proxy settings
Hallo I am trying to read a url, but I am working behind a proxy server. How can I set my proxy setting for my script to use. Hallo I am trying to read a image from a url, but I am working behind a proxy server. How can I set my proxy settings so I can get to read this image. I hope someone can help. ...

Programmatically setting a radio buttones
I am trying to programmatically set a radio button in a table of radio buttons. I have two problems with the code below: 1 - I can not prepare the <Form> statement to be printed by php. (syntax of the hyphens, quotes) my fault! 2 - If I delete the <Form> and </Form> statements I can build the table of radio buttons correctly, HTML wise. The fifth radio button has 'checked=True'. The problem is even though I set radio button 5 to be checked only the last radio button is checked when it is displayed on the screen. But viewing the page code says it should be th...

mapping from set to set
I'm mapping a set to another set (the y-axis 0<=y<=24 from 0<=y<=100) Unfortunately I'm getting peculiar output: (1,13743907) (2,13743907) (3,24) (4,13743907) (5,24) (6,24) (7,950046744) I guess I am invoking undefined behavior somewhere. Probably related to the floating point arithmetic. #include <stdio.h> #include <math.h> int max_x, max_y; float width; int iX(float x) { return (int)x; } int iY(float y) { return (int)(max_y) - roundf(y/width); } float f(float x) { return x*x; } int main(void) { int i; max_y = 24; max_x = 80; width = 100.0...

unpickling Set as set
Hi, Is there an easy way to unpickle the older Set as the newer set behind the scenes when using shelve? Amir The two are not of the same type: --------------------------------- In : import sets In : s1=sets.Set([1,2,3]) In : s2=set([1,2,3]) In: type(s1) Out: <class 'sets.Set'> In : type(s2) Out: <type 'set'> In : s1==s2 Out: False # oops! In: s2==set(s1) Out: True # aha! ---------------------------------- You'll have to just cast: unpickled_set=set(unpickled_set) -Nick V. Amir Michail wrote: > Hi, > > Is there an easy way to unpick...