[Previous]
[Contents]
[Next]

searchenv()

search the directories in a given environment variable

Synopsis:

#include <stdlib.h>
void   searchenv( const char *__name,
                  const char *__env_var,
                  char *__buf );

Description:

The searchenv() function searches for the file specified by name in the list of directories assigned to the environment variable specified by env_var. Common values for env_var are "PATH", "LIB" and "INCLUDE".


Note: In contrast to the _searchenv() function, searchenv() doesn't search the current directory unless it's specified in the env_var. The behavior of searchenv() is usually preferred over that of the _searchenv() function.

The full pathname is placed in the buffer pointed to by the argument buffer. If the specified file can't be found, buffer contains an empty string.

Examples:

See _searchenv().

Classification:

QNX

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

getenv(), putenv(), _searchenv(), setenv()


[Previous]
[Contents]
[Next]