strdup is not part of the C standard library as defined by ANSI/ISO.
I'm not certain but I believe it is part of the POSIX standard.  The IBM
manual claims it is also part of the X/Open Portability Guide 4.2.  

If your cross platform concerns include MAC, Windows,
Linux/Unix/Solaris/HPUX, embedded systems, etc., then your decision is
driven in one direction by the C standard.  If your concerns are more
limited, such as just MVS, OS/390, and z/OS, then the IBM library might
let you make a different decision.

strdup is in the OS/390 2.10 version of the compiler and run-time
library and I expect it has been carried forward to z/OS.  You should
check the Run-Time Library Reference since it seems like you need to
define a special macro to" activate" it as an extension. 

-----Original Message-----
From: Steve Rawlins [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 28, 2006 4:06 PM
To: [email protected]
Subject: C function strdup

Anybody use function "strdup" (malloc & duplicate a string) from an MVS
"C" program?

We are using  C compiler V2 R10 OS/390 C   on ZOS v1.4

and we are trying to keep our code cross-platform compatible.

Is strdup (string duplicate) function supported by MVS?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to