Put the following at the top of your source file.
*#define* *_POSIX_SOURCE*
BTW, I would *seriously* advise you to to build your software in the
UNIX file system and not PDS members. The only time I use a PDS is when
I'm forced to by
my employers and that's because our home grown SCM product is not UNIX
aware. You can then enjoy all the benefits and tools available on UNIX,
like makefiles.
On 2/08/2013 12:43 PM, Ze'ev Atlas wrote:
Hi all
In working on PCREGREP, the grep utility of the PCRE package I am porting to
z/OS, I've encountered an issue that I do not know how to resolve:
I figured out that z/OS behaves mostly like UNIX and not like Windows, so I
added my macro to this line:
#if (defined HAVE_SYS_STAT_H && defined HAVE_DIRENT_H && defined
HAVE_SYS_TYPES_H) || defined NATIVE_ZOS
instructing the compiler to choose the next few lines. Notice the #include
<sys/stat.h>:
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
...
struct stat statbuf;
...
The manual SA22-7821-13 "XL C/C++ Run-Time Library Reference" states clearly
that sys/stat.h contains a:
struct stat definition.
I also looked at the library CEE.SCEEH.SYS.H and the said struct is indeed
available. Yet I consistently get this error message:
ERROR CBC3007 ZATLAS1.DEV.C(QCREGREP):554 "struct stat" is undefined.
And I cannot figure out why. I cannot ask the Unix/Linux crowd since the issue
seems to be specific to z/OS compiler.
[If you try that at home, there were more issues but they were obvious and I
resolved them easily.]
Thanks
ZA
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN