search the directories in a given environment variable
#include <stdlib.h> void searchenv( const char *__name, const char *__env_var, char *__buf );
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".
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.
See _searchenv().
QNX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
getenv(), putenv(), _searchenv(), setenv()