On Thu, 3 Dec 2020 11:49:05 -0500, Gord Tomlin wrote:

>On 2020-12-03 10:12 AM, Charles Mills wrote:
>> I believe you, but why then is the macro undefined? Why is the definition 
>> now commented out?
>> 
I suspect there's a buffer overrun hazard associated with a statically compiled
PATH_MAX.  Interesting, apparently well-researched link:
        https://eklitzke.org/path-max-is-tricky

>> >From <limits.h> (actually CEE.SCEEH.H(LIMITS)) on z/OS V2R4:
>> /*
>>   *  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
>>    */
>
>"an application may use the/fpathconf/()  
><https://pubs.opengroup.org/onlinepubs/009696699/functions/fpathconf.html>,/pathconf/()
>  <https://pubs.opengroup.org/onlinepubs/009696699/functions/pathconf.html>, 
>and/sysconf/()  
><https://pubs.opengroup.org/onlinepubs/009696699/functions/sysconf.html>  
>functions to
>determine the actual value of a limit at runtime."
>
>(<https://pubs.opengroup.org/onlinepubs/009696699/basedefs/limits.h.html>)
> 
OpenGroup/Single UNIX requires an "allocating" form of realpath();
z/OS XL C/C++ fails to provide one.

More:
What is the OP doing with this?

Even more:
   https://eklitzke.org/path-max-is-tricky

Rexx ADDRESS SYSCALL realpath
returns strings which appear correct but seem to exceed the
PATH_MAX computed by pathconf().  When I expressed astonishment
about that on MVS-OE, WJS replied:
   http://vm.marist.edu/htbin/wlvtype?MVS-OE.61764
   I suspect C passes a buffer of PATH_MAX+1.  The REXX support tends to use a
   local 4K scratch buffer for system call output areas when it can, and does
   in this case.
I.e. just define it as 4K and hope for the best.

I'll try this on Linux:
   ( set -x; while true; do mkdir wombat; cd wombat; pwd; done )

-----Original Message-----
From: Paul Gilmartin 
Sent: Wednesday, December 2, 2020 3:33 PM

read: https://www.zsh.org/mla/workers/2000/msg03393.html
etc. and weep.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to