12.07.2015 Views

z/VM: TCP/IP Programmer's Reference - z/VM - IBM

z/VM: TCP/IP Programmer's Reference - z/VM - IBM

z/VM: TCP/IP Programmer's Reference - z/VM - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1. General Programming InformationPorting ConsiderationsThis chapter contains fundamental, technical information that programmers needto know before they attempt to work with the application program interfaces (API)provided with <strong>TCP</strong>/<strong>IP</strong>.Important NoteIn order to develop or port applications in the C programming language thatinterface directly to <strong>TCP</strong>, UDP, and <strong>IP</strong>, or which modify <strong>TCP</strong>/<strong>IP</strong> for <strong>VM</strong> Ccomponents, the following are required:v <strong>IBM</strong> C for <strong>VM</strong>/ESA Compiler, Version 3 Release 1 (5654-033)v Language Environment, which is included in the base release.Accessing System Return MessagesTo access system return values while running your C program, use only theerrno.h include statement supplied with the compiler. To access <strong>TCP</strong>/<strong>IP</strong> networkreturn values, add the following include statement to your C program:#include Printing System Return MessagesTo print only system errors, use perror(), a procedure available in the C compilerrun-time library. To print both system and network errors, use tcperror(), aprocedure provided by <strong>IBM</strong> and included with <strong>TCP</strong>/<strong>IP</strong> Level 320 for <strong>VM</strong>.Compiling and Linking C ApplicationsThis section describes how to compile and link-edit C applications that use the<strong>TCP</strong>/<strong>IP</strong> C sockets1. Access the <strong>TCP</strong>/<strong>IP</strong> client minidisk (<strong>TCP</strong>MAINT 592) ahead of the S-disk toavoid conflicts with OpenEdition ® for <strong>VM</strong>/ESA.Establish the C development environment:– Access the C compiler– SET LDRTBLS 25 (the number you need depends on your program)– GLOBAL LOADLIB SCEERUNNote: CMSLIB is required only when the program will run in a 370-modevirtual machine.2. Compile your programs, ensuring that the preprocessor symbol <strong>VM</strong> isdefined. For example:CC myprog (DEF(<strong>VM</strong>)With OpenEdition for <strong>VM</strong>/ESA you can also use the c89 command and themake shell utility.© Copyright <strong>IBM</strong> Corp. 1987, 2001 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!