How to define _FILE_OFFSET_BITS & _LARGE_FILES macro for Solaris and HP-AIX
<p>I Have a C Program as follow.
I don't what to use stat64 instead of stat in both Solaris &amp; HP-AIX.
I want to build this Program this on both Solaris &amp; HP-AIX.</p>

<pre><code>#include "zunx.h"
#include &lt;nls.h&gt;

/*
 * NAME:        zunx_file_exists
 *
 * PURPOSE:     Checks if a file exists.
 *
 * INVOCATION:  boolean zunx_file_exists(name)
 *              char *name;
 *
 * INPUTS:      name    - file to check
 *
 * OUTPUTS:     TRUE or FALSE
 *
 * DESCRIPTION: zunx_file_exists does a stat on the specified file,
 *              and returns TRUE if a stat is found.  No check is
 *              made to determine what type of file it is.
 */
boolean zunx_file_exists
   (const char *buf)
{

#if defined(UNIX)
   struct stat fstat;

   if (buf != NULL &amp;&amp; stat(I2E1(buf), &amp;fstat) == 0)
      return TRUE;
   else
      return FALSE;
#endif

#ifdef NT_OS
   struct _stat64 fstat;

   if (buf != NULL &amp;&amp; _stat64((char *) I2E1(buf), &amp;fstat) == 0)
      return TRUE;
   else
      return FALSE;
#endif
}
</code></pre>

<p>I came across  a macro in Solaris like :</p>

<pre><code> #ifdef UNIX
    #define _FILE_OFFSET_BITS 64
 #endif
</code></pre>

<p>is this definition is correct for above program?</p>

<p>for HP-AIX its use <code>_LARGE_FILES</code> macro.</p>

<p>but I don't know how to define this macro in above program in order to run successfully on both OS.</p>

<p>Please suggest some ideas.</p>