On 3/12/2020 11:12 pm, Charles Mills wrote:
I believe you, but why then is the macro undefined? Why is the definition now 
commented out?

 From <limits.h> (actually CEE.SCEEH.H(LIMITS)) on z/OS V2R4:

For the usual POSIX compliance reasons <sigh>!

FWIW, in IBM z/OS C++ code that's used by the JVM they set PATH_MAX to 1024 *https://github.com/eclipse/omr/blob/c3c479f9d5958df679349d0e02ed204329fda2da/port/unix/omrsysinfo.c#L181*



/*
  *  POSIX.1 1990 Section 2.8.5 Statement 1065 -
  *  these macros "shall be omitted on specific
  *  implementations where the corresonding value is
  *  >= the stated minimum, but where the value
  *  can vary depending on the file to which it is
  *  applied."
  *
  *
  */
/*
   * #define LINK_MAX
   * #define MAX_CANON
   * #define MAX_INPUT
   * #define NAME_MAX
   * #define PATH_MAX
   * #define PIPE_BUF
   */

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of David Crayford
Sent: Thursday, December 3, 2020 5:32 AM
To: [email protected]
Subject: Re: C macro for maximum path length?

PATH_MAX on z/OS is 1023. This is documented in lots of error messages and BPX 
assembler services.

On 3 Dec 2020, at 7:16 am, Charles Mills <[email protected]> wrote:

I have some code that compiles both under Windows Visual Studio and z/OS
XLC.

In Windows the maximum length of a file path is defined by _MAX_PATH and
__MAX_PATH (I guess MS thinks two macros are better than one).

What is the equivalent macro for XLC? Failing that, what *is* the maximum
path length so I can define my own macro?

Posix defines PATH_MAX and I see references to it in the z/OS doc but it
does not seem to be defined for my compile. How do I pick that up? And yes,
I have

#define _XOPEN_SOURCE_EXTENDED 1
#include <stdlib.h>

z/OS V2R4

Thanks,

Charles

----------------------------------------------------------------------
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

----------------------------------------------------------------------
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

Reply via email to