Re: getenv, putenv



floyd@xxxxxxxxxx (Floyd L. Davidson) writes:
Bhawna <bvnbhati@xxxxxxxxx> wrote:
Hi,

I am running a multithreaded application in which I am trying to set
an environment variable using putenv. The string I am using as
argument to putenv was created as

char *str=strdup(<local var>);

1) Don't use an auto variable.

This doesn't matter. The string needs to be alive for as it is still
part of the environment, not some random pointer to it.

2) The symbol "str" violates the implemenation's
name space if you have also included <strings.h>.

I don't think so. SUS only reserves any identifier beginning with str,
followed by a lower case letter.
.



Relevant Pages

  • Re: Floyd Rose tuning stability
    ... here previously) with a Floyd Rose bridge. ... string breaks and the whole tuning goes kablammo). ... It should stay very close to pitch, ... How much does it go out of tune? ...
    (alt.guitar)
  • Re: getenv, putenv
    ... Bhawna wrote: ... an environment variable using putenv. ... The string I am using as ...
    (comp.os.linux.development.apps)
  • Re: putenv() error returns?
    ... Henry Townsend wrote: ... putenv() that 'the argument should point to a string of the form "name=value"', but in looking at the ERRORS section the only defined error is ENOMEM "Insufficient memory was available". ... Of course I could try this on my platform (Solaris) and see what happens. ...
    (comp.unix.programmer)
  • Re: getenv, putenv
    ... an environment variable using putenv. ... The string needs to be alive for as it is still ... and the reservation only applies to identifiers with file ... so an identifier with block scope can safely be called 'str'. ...
    (comp.os.linux.development.apps)
  • Re: Slightly OT: WTB a Gibson Floyd Rose
    ... They also resemble an aluminum brick bolted to the guitar. ... That's why I'm so hot on the idea of this Floyd. ... just uses a different mounting system. ... I know the string spacing will be Fender-ish. ...
    (alt.guitar.amps)