\hypertarget{opal__getcwd_8h}{\section{opal/util/opal\+\_\+getcwd.h File Reference}
\label{opal__getcwd_8h}\index{opal/util/opal\+\_\+getcwd.\+h@{opal/util/opal\+\_\+getcwd.\+h}}
}


Per \href{https://svn.open-mpi.org/trac/ompi/ticket/933,}{\tt https\+://svn.\+open-\/mpi.\+org/trac/ompi/ticket/933,} use a combination of \$\+P\+W\+D and getcwd() to find the current working directory.  


{\ttfamily \#include \char`\"{}opal\+\_\+config.\+h\char`\"{}}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int \hyperlink{opal__getcwd_8h_a2e90aaa01cc4beb5e9b548451313eb92}{opal\+\_\+getcwd} (char $\ast$buf, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Per \href{https://svn.open-mpi.org/trac/ompi/ticket/933,}{\tt https\+://svn.\+open-\/mpi.\+org/trac/ompi/ticket/933,} use a combination of \$\+P\+W\+D and getcwd() to find the current working directory. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Per \href{https://svn.open-mpi.org/trac/ompi/ticket/933,}{\tt https\+://svn.\+open-\/mpi.\+org/trac/ompi/ticket/933,} use a combination of \$\+P\+W\+D and getcwd() to find the current working directory. 



\subsection{Function Documentation}
\hypertarget{opal__getcwd_8h_a2e90aaa01cc4beb5e9b548451313eb92}{\index{opal\+\_\+getcwd.\+h@{opal\+\_\+getcwd.\+h}!opal\+\_\+getcwd@{opal\+\_\+getcwd}}
\index{opal\+\_\+getcwd@{opal\+\_\+getcwd}!opal\+\_\+getcwd.\+h@{opal\+\_\+getcwd.\+h}}
\subsubsection[{opal\+\_\+getcwd}]{\setlength{\rightskip}{0pt plus 5cm}B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C int opal\+\_\+getcwd (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{buf, }
\item[{size\+\_\+t}]{size}
\end{DoxyParamCaption}
)}}\label{opal__getcwd_8h_a2e90aaa01cc4beb5e9b548451313eb92}


Per \href{https://svn.open-mpi.org/trac/ompi/ticket/933,}{\tt https\+://svn.\+open-\/mpi.\+org/trac/ompi/ticket/933,} use a combination of \$\+P\+W\+D and getcwd() to find the current working directory. 

Use \$\+P\+W\+D instead of getcwd() a) if \$\+P\+W\+D 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().


\begin{DoxyParams}{Parameters}
{\em buf} & Caller-\/allocated buffer to put the result \\
\hline
{\em size} & Length of the buf array\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em O\+P\+A\+L\+\_\+\+E\+R\+R\+\_\+\+O\+U\+T\+\_\+\+O\+F\+\_\+\+R\+E\+S\+O\+U\+R\+C\+E} & If internal malloc() fails. \\
\hline
{\em O\+P\+A\+L\+\_\+\+E\+R\+R\+\_\+\+T\+E\+M\+P\+\_\+\+O\+U\+T\+\_\+\+O\+F\+\_\+\+R\+E\+S\+O\+U\+R\+C\+E} & If the supplied buf buffer was not long enough to handle the result. \\
\hline
{\em O\+P\+A\+L\+\_\+\+E\+R\+R\+\_\+\+B\+A\+D\+\_\+\+P\+A\+R\+A\+M} & If buf is N\+U\+L\+L or size$>$I\+N\+T\+\_\+\+M\+A\+X \\
\hline
{\em O\+P\+A\+L\+\_\+\+E\+R\+R\+\_\+\+I\+N\+\_\+\+E\+R\+R\+N\+O} & If an other error occurred \\
\hline
{\em O\+P\+A\+L\+\_\+\+S\+U\+C\+C\+E\+S\+S} & If all went well and a valid value was placed in the buf buffer. \\
\hline
\end{DoxyRetVals}
