Right. And I would have expected that you should have gotten a compiler warning about the assumed type of "realpath" being "int", since a declaration wasn't found without #define _XOPEN_SOURCE_EXTENDED 1
Also, according to the documentation you will get an EINVAL error if the second argument (the buffer) is NULL. Kirk Wolf Dovetailed Technologies http://dovetail.com On Wed, Apr 11, 2012 at 12:40 PM, McKown, John < [email protected]> wrote: > before the > > #include <stdlib.h> > > insert the line: > > #define _XOPEN_SOURCE_EXTENDED 1 > > as shown here: > http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/EDCLB1B0/3.791 > > or include the compile parm: -D_XOPEN_SOURCE_EXTENDED=1 > > > -- > John McKown > Systems Engineer IV > IT > > Administrative Services Group > > HealthMarkets(r) > > 9151 Boulevard 26 * N. Richland Hills * TX 76010 > (817) 255-3225 phone * > [email protected] * www.HealthMarkets.com > > Confidentiality Notice: This e-mail message may contain confidential or > proprietary information. If you are not the intended recipient, please > contact the sender by reply e-mail and destroy all copies of the original > message. HealthMarkets(r) is the brand name for products underwritten and > issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake > Life Insurance Company(r), Mid-West National Life Insurance Company of > TennesseeSM and The MEGA Life and Health Insurance Company.SM > > > > > -----Original Message----- > > From: IBM Mainframe Discussion List > > [mailto:[email protected]] On Behalf Of Paul Gilmartin > > Sent: Wednesday, April 11, 2012 12:07 PM > > To: [email protected] > > Subject: realpath() syntax? > > > > z/OS 1.12. The source: > > > > /* Doc: Print the resolved pathname of each argument > > */ > > #include <stdlib.h> > > /* appears to contain: > > char *realpath(const char * __restrict__, > > char * __restrict__); > > */ > > > > int main( int argc, char ** argv ) { > > > > char *resolved_name; > > > > /* This is OK. */ > > realpath( "xyzzy", NULL ); > > > > /* This is OK. */ > > resolved_name = "wombat"; > > > > /* this gets: > > ERROR CCN3068 realpath3.c:22 > > Operation between types "char*" and "int" is not allowed. */ > > resolved_name = realpath( "xyzzy", NULL ); > > > > } > > > > My compile command is: > > > > user@MVS:167$ gmake realpath3 > > > > LC_CTYPE= c89 -I.. -D_XOPEN_SOURCE -D_OE_SOCKETS > > -Wa,"ASA,RENT" -DPLATFORM=OS390 -o realpath3 > > ../source/realpath3.c /usr/lib/Xaw.x /usr/lib/SM.x > > /usr/lib/ICE.x /usr/lib/X11.x -lcurses -lm > > in $ENV: /bin/sh -h $ > > ERROR CCN3068 ./../source/realpath3.c:22 Operation between > > types "char*" and "int" is not allowed. > > CCN0793(I) Compilation failed for file > > ./../source/realpath3.c. Object file not created. > > FSUM3065 The COMPILE step ended with return code 12. > > FSUM3017 Could not compile ../source/realpath3.c. Correct the > > errors and try again. > > > > Help! > > > > Thanks, > > gil > > > > ---------------------------------------------------------------------- > > 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

