Open System Services Porting Guide (G06.24+, H06.03+)
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction to Porting
- 2 The Development Environment
- 3 Useful Porting Tools
- 4 Interoperating Between User Environments
- Purpose of Interoperability
- The OSS User Environment
- OSS Commands for the Guardian User
- Guardian Commands for the UNIX User
- OSS Pathname and Guardian Filename Conversions
- Running the OSS Shell and Commands From TACL
- Running Guardian Commands From the OSS Shell
- Running OSS Processes With Guardian Attributes
- Using OSS Commands to Manage Guardian Objects
- 5 Interoperating Between Programming Environments
- 6 OSS Porting Considerations
- 7 Porting UNIX Applications to the OSS Environment
- 8 Migrating Guardian Applications to the OSS Environment
- General Migration Guidelines
- C Compiler Issues for Guardian Programs
- Using New and Extended Guardian Procedures
- Using OSS Functions in a Guardian Program
- Interoperating With OSS Programs
- Starting an OSS Program From the Guardian Environment
- C Compiler Considerations for OSS Programs
- Porting a Guardian Program to the OSS Environment
- How Arguments Are Passed to the C or C++ Program
- Differences in the Two Run-Time Environments
- Which Run-Time Routines Are Available
- Use of Common Run-Time Environment (CRE) Functions
- Replacing Guardian Procedure Calls With Equivalent OSS Functions
- Which IPC Mechanisms Can Be Used
- Interactions Between Guardian and OSS Functions
- 9 Porting From Specific UNIX Systems
- 10 Native Migration Overview
- 11 Porting or Migrating Sockets Applications
- 12 Porting Threaded Applications
- A Equivalent OSS and UNIX Commands for Guardian Users
- B Equivalent Guardian Commands for OSS and UNIX Users
- C Equivalent Inspect Debugging Commands for dbx Commands
- D Equivalent Native Inspect Debugging Commands for dbx Commands
- E Standard POSIX Threads Functions: Differences Between the Previous and Current Standards
- Glossary
- Index
The Development Environment
Open System Services Porting Guide—520573-006
2-16
C and C++ Compilation Using the c89 Utility
By default on a TNS/R platform, nld performs dynamic linking by searching first
for the file libc.srl and then libc.a. nld then performs static linking by
searching for the file libarchive.a. nld then performs dynamic linking by
searching first for the file libnative.srl and then libnative.a.
On a TNS/E platform, eld performs dynamic linking by searching first for the file
libc.so and then libc.a. eld then performs static linking by searching for the
file libarchive.a. eld then performs dynamic linking by searching first for the
file libnative.so and then libnative.a.
•
The following example compiles file.c and links the PIC linkfile into a PIC
program called a.out.
c89 file.c -lc -Wcall_shared -WBstatic -l archive -WBdynamic
-l native
ld (if the target platform is TNS/R) or eld (if the target platform is TNS/E)
performs dynamic linking by searching first for the file libc.so and then libc.a.
ld or eld then performs static linking by searching for the file libarchive.a. ld
or eld then performs dynamic linking by searching first for the file libnative.so
and then libnative.a.
•
The following command compiles the source file mydll.c and links the PIC linkfile
to create a DLL.
c89 -Wshared -o mydll mydll.c
ld or eld performs the linking and creates a DLL in a file named mydll.
•
The following example compiles file.c with SQL/MP support enabled with the
native C compiler.
c89 -Wsql=release2,sqlmap -c file.c
An SQL map is included in the listing, and the release 2 version of SQL/MP
features is used. The SQL/MP preprocessor is run; the SQL/MP compiler is not
run. Note that there is no blank space after the comma (,) and no space before or
after the equal sign. Because the -c flag is used, no binding is performed.
•
The following example compiles file.c with SQL/MX support enabled with the
native C compiler, and creates file.o if there are no errors in compilation:
c89 -Wsqlmx=listing -c file.c
The SQL/MX preprocessor is run; the SQL/MX compiler is not run. An SQL error
log named file.eL is created if necessary because listing is specified, and an
SQL module definition file named file.m is created. Note that there is no blank
space after the comma (,). Because the -c flag is used, no binding is performed.
•
The following example uses the TNS C compiler. The source file test.c is
compiled into test.o. The warnings of types 96, 93, and 168 are suppressed:
c89 -c -Wccom="nowarn(96,93,168)" test.c