OpenMPI  0.1.1
opal_getcwd.h File Reference

Per https://svn.open-mpi.org/trac/ompi/ticket/933, use a combination of $PWD and getcwd() to find the current working directory. More...

#include "opal_config.h"

Go to the source code of this file.

Functions

BEGIN_C_DECLS OPAL_DECLSPEC int opal_getcwd (char *buf, size_t size)
 Per https://svn.open-mpi.org/trac/ompi/ticket/933, use a combination of $PWD and getcwd() to find the current working directory. More...
 

Detailed Description

Per https://svn.open-mpi.org/trac/ompi/ticket/933, use a combination of $PWD and getcwd() to find the current working directory.

Function Documentation

BEGIN_C_DECLS OPAL_DECLSPEC int opal_getcwd ( char *  buf,
size_t  size 
)

Per https://svn.open-mpi.org/trac/ompi/ticket/933, use a combination of $PWD and getcwd() to find the current working directory.

Use $PWD instead of getcwd() a) if $PWD exists and b) is a valid synonym for the results from getcwd(). If both of these conditions are not met, just fall back and use the results of getcwd().

Parameters
bufCaller-allocated buffer to put the result
sizeLength of the buf array
Return values
OPAL_ERR_OUT_OF_RESOURCEIf internal malloc() fails.
OPAL_ERR_TEMP_OUT_OF_RESOURCEIf the supplied buf buffer was not long enough to handle the result.
OPAL_ERR_BAD_PARAMIf buf is NULL or size>INT_MAX
OPAL_ERR_IN_ERRNOIf an other error occurred
OPAL_SUCCESSIf all went well and a valid value was placed in the buf buffer.