Introduction To The Oracle® Solaris Developer Documentation: Part No: E26999-02 September 2013
Introduction To The Oracle® Solaris Developer Documentation: Part No: E26999-02 September 2013
Introduction To The Oracle® Solaris Developer Documentation: Part No: E26999-02 September 2013
Developer Documentation
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual
property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license,
transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software,
unless required by law for interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is
applicable:
U.S. GOVERNMENT END USERS. Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or
documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and
agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system,
integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the
programs. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently
dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall
be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any
liability for any damages caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered
trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro
Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and
its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation
and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.
Ce logiciel et la documentation qui laccompagne sont protgs par les lois sur la proprit intellectuelle. Ils sont concds sous licence et soumis des restrictions
dutilisation et de divulgation. Sauf disposition de votre contrat de licence ou de la loi, vous ne pouvez pas copier, reproduire, traduire, diffuser, modifier, breveter,
transmettre, distribuer, exposer, excuter, publier ou afficher le logiciel, mme partiellement, sous quelque forme et par quelque procd que ce soit. Par ailleurs, il est
interdit de procder toute ingnierie inverse du logiciel, de le dsassembler ou de le dcompiler, except des fins dinteroprabilit avec des logiciels tiers ou tel que
prescrit par la loi.
Les informations fournies dans ce document sont susceptibles de modification sans pravis. Par ailleurs, Oracle Corporation ne garantit pas quelles soient exemptes
derreurs et vous invite, le cas chant, lui en faire part par crit.
Si ce logiciel, ou la documentation qui laccompagne, est concd sous licence au Gouvernement des Etats-Unis, ou toute entit qui dlivre la licence de ce logiciel
ou lutilise pour le compte du Gouvernement des Etats-Unis, la notice suivante sapplique:
U.S. GOVERNMENT END USERS. Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or
documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and
agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system,
integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the
programs. No other rights are granted to the U.S. Government.
Ce logiciel ou matriel a t dvelopp pour un usage gnral dans le cadre dapplications de gestion des informations. Ce logiciel ou matriel nest pas conu ni nest
destin tre utilis dans des applications risque, notamment dans des applications pouvant causer des dommages corporels. Si vous utilisez ce logiciel ou matriel
dans le cadre dapplications dangereuses, il est de votre responsabilit de prendre toutes les mesures de secours, de sauvegarde, de redondance et autres mesures
ncessaires son utilisation dans des conditions optimales de scurit. Oracle Corporation et ses affilis dclinent toute responsabilit quant aux dommages causs
par lutilisation de ce logiciel ou matriel pour ce type dapplications.
Oracle et Java sont des marques dposes dOracle Corporation et/ou de ses affilis. Tout autre nom mentionn peut correspondre des marques appartenant
dautres propritaires quOracle.
Intel et Intel Xeon sont des marques ou des marques dposes dIntel Corporation. Toutes les marques SPARC sont utilises sous licence et sont des marques ou des
marques dposes de SPARC International, Inc. AMD, Opteron, le logo AMD et le logo AMD Opteron sont des marques ou des marques dposes dAdvanced Micro
Devices. UNIX est une marque dpose dThe Open Group.
Ce logiciel ou matriel et la documentation qui laccompagne peuvent fournir des informations ou des liens donnant accs des contenus, des produits et des services
manant de tiers. Oracle Corporation et ses affilis dclinent toute responsabilit ou garantie expresse quant aux contenus, produits ou services manant de tiers. En
aucun cas, Oracle Corporation et ses affilis ne sauraient tre tenus pour responsables des pertes subies, des cots occasionns ou des dommages causs par laccs
des contenus, produits ou services tiers, ou leur utilisation.
130915@25097
Contents
Preface .....................................................................................................................................................5
3
Contents
Introduction to the Oracle Solaris Developer Documentation is a starting point for developers
working on the Oracle Solaris Operating System (Oracle Solaris OS).
Note This Solaris release supports systems that use the SPARC and x86 families of processor
architectures: UltraSPARC, SPARC64, AMD64, Pentium, and Xeon EM64T. The supported
systems appear in the Solaris OS: Hardware Compatibility Lists at http://www.oracle.com/
webfolder/technetwork/hcl/index.html. This document cites any implementation
differences between the platform types.
For supported systems, see the Solaris OS: Hardware Compatibility Lists.
5
Preface
Typographic Conventions
The following table describes the typographic conventions that are used in this book.
AaBbCc123 The names of commands, files, and directories, Edit your .login file.
and onscreen computer output
Use ls -a to list all files.
machine_name% you have mail.
aabbcc123 Placeholder: replace with a real name or value The command to remove a file is rm
filename.
AaBbCc123 Book titles, new terms, and terms to be Read Chapter 6 in the User's Guide.
emphasized
A cache is a copy that is stored
locally.
Do not save the file.
Note: Some emphasized items
appear bold online.
Shell Prompt
C shell machine_name%
7
8
1
C H A P T E R 1
The Oracle Solaris Operating System (Oracle Solaris OS) provides developers with numerous
interfaces, frameworks, and tools to take advantage of Oracle Solaris technologies. This manual
provides a roadmap for developers to learn about the Oracle Solaris OS and provides links to
sources of further information. The following topics are covered:
Learning About Development on the Oracle Solaris OS on page 9
Map to the Oracle Solaris OS Man Page Collection on page 11
Building Applications in the Oracle Solaris OS on page 12
Programming to Specific Hardware and Configurations on page 19
Network Programming in the Oracle Solaris OS on page 21
Programming with Oracle Solaris Interfaces and Frameworks on page 22
9
Learning About Development on the Oracle Solaris OS
The NetBeans IDE provides developers with tools for creating professional cross-platform
desktop, enterprise, web, and mobile applications. For documentation, see the
Documentation, Training & Support area on the NetBeans.org site. For a summary
explanation of the NetBeans software, see Using the NetBeans IDE on page 15.
An additional set of tools can be used with the Oracle Solaris Studio tools to develop parallel
applications designed to run on distributed-memory systems. See Using Oracle Message
Passing Toolkit on page 17, formerly Sun HPC ClusterTools, for more information.
Oracle University Instructor-led courses, online courses, white papers, and other
information on the Oracle Solaris OS and other technologies are among the resources
available at Oracle University.
Retail books You can also learn about the Oracle Solaris OS from books published by
commercial publishers.
Notable books for Oracle Solaris developers are:
Solaris 10 System Administration Essentials by Solaris Engineers; Prentice Hall PTR;
November 30, 2009.
Solaris 10 Security Essentials by Sun Microsystems Security Engineers; Prentice Hall
PTR; November 23, 2009.
Solaris 10 ZFS Essentials by Scott Watanabe; Prentice Hall PTR; January 4, 2010.
Solaris ZFS Administration Guide; Sun Microsystems; Vervante; 2009.
Solaris Application Programming by Darryl Gove, Prentice Hall PTR, January 6, 2008.
Solaris Performance and Tools: DTrace and MDB Techniques for Solaris 10 and
OpenSolaris by Richard McDougall, Jim Mauro, and Brendan Gregg, Prentice Hall PTR,
July 30, 2006.
Solaris Internals: Solaris 10 and OpenSolaris Kernel Architecture by Jim Mauro and
Richard McDougall, Prentice Hall PTR, July 20, 2006.
Solaris Systems Programming by Rich Teer, Prentice Hall PTR, August 19, 2004.
The Java Tutorial, Fourth Edition by Isaac Rabinovitch, Sharon Zakhour, Scott Hommel,
Jacob Royal and Thomas Risser, September 29, 2006.
Oracle Solaris 10 OS product literature For product literature on the Oracle Solaris 10
OS including data sheets, tours, case studies, and white papers, see the Solaris Operating
System web site.
Other Oracle Solaris documentation The following documentation sources can be useful
to developers, although these manuals are less directly involved with Oracle Solaris OS
development:
Solaris 10 System Administrator Collection
Solaris 10 On Sun Hardware Documentation
Solaris 10 International Language Support Collection
Java Tutorials
Java EE 5 Tutorial
Viewing man pages on OTN offers several advantages over viewing man pages from the
command line. Each section or volume is presented as a book with an index and preface, and an
alphabetized list of items with their short descriptions. In some sections, an introductory page
provides an overview of the section.
The man pages for the Oracle Solaris OS are organized into sections and volumes as follows:
man pages section 1: User Commands Describes the non-administration commands on the
system. The Intro(1) man page provides information on man page command syntax for
users, guidelines for developers who are designing new man pages, and an explanation of
the subdivisions within Section 1.
man pages section 1M: System Administration Commands Describes commands for system
maintenance and other administrative purposes. The Intro(1M) man page repeats the man
page command syntax explanation from the User Commands volume.
man pages section 2: System Calls section Describes prototypes and descriptions for the
various system calls that can be made in the Oracle Solaris OS. This section focuses on calls
that directly invoke UNIX system primitives. The Intro(2) man page provides a list of error
returns from system calls as well as a glossary of system call terminology.
Section 3 provides information on library calls and is divided into the following volumes:
man pages section 3: Library Interfaces and Headers volume Describes general libraries
that do not fit into the other categories. The Intro(3) man page provides the complete
organization of the Section 3 libraries, a brief explanation of multithreaded applications,
and a few basic definitions.
man pages section 3: Basic Library Functions volume Describes the core C library
functions that are basic to application development.
man pages section 3: Networking Library Functions volume Describes libraries that are
related to networking, such as LDAP and RPC.
man pages section 3: Curses Library Functions volume Describes libraries for displaying
characters and graphics.
man pages section 3: Realtime Library Functions volume Describes libraries for
performing realtime activities.
Note Most developers should use the more powerful Oracle Solaris Studio and NetBeans
development and build tools. See Using the Oracle Solaris Studio Tools on page 14 and
Using the NetBeans IDE on page 15.
Kernel-Level Debugging
The Modular Debugger mdb is an extensible, general purpose debugging tool for the Oracle
Solaris OS. The Oracle Solaris Modular Debugger Guide describes how to use the mdb(1)
command to debug complex software systems. The guide emphasizes the facilities that are
available for debugging the Oracle Solaris kernel and associated device drivers and modules.
The guide includes a complete reference for the mdb language syntax, debugger features, and the
mdb module programming API.
The Oracle Solaris Modular Debugger Guide also features information on kmdb, the kernel-level
analogue to mdb.
Download Oracle Solaris Studio software from Oracle Solaris Studio Downloads.
Note that the Oracle Solaris Studio IDE installs its own version of the NetBeans IDE. This
NetBeans installation is not intended to be used independently of the Oracle Solaris Studio
software, and you might experience errors if you use it separately. If you want to use the
NetBeans IDE, you should install the NetBeans IDE separately from installing Oracle Solaris
Studio or Oracle Solaris Studio Express software.
Sun Memory Error Discovery Tool (Discover) An advanced development tool for
detecting memory access errors.
Uncover A simple and easy to use command-line tool for measuring code coverage of
applications.
DLight A separate tool for Oracle Solaris Studio 12.2, different from the DLight tool that is
integrated into the Oracle Solaris Studio 12 Update 1 IDE. The Oracle Solaris Studio 12.2
DLight tool includes three profiling tools for processes in the AMP stack, in addition to
profiling tools for C, C++, and Fortran programs.
Oracle Solaris Studio dmake make tool A command-line tool for building targets in
distributed, parallel, or serial mode.
Math libraries A floating-point environment that is supported by software and hardware
on SPARC and x86 platforms that run the Oracle Solaris OS.
OpenMP A portable, pragma-based parallel programming model for shared memory
multiprocessor architectures, is natively accepted and compiled by all three Oracle Solaris
Studio compilers.
Performance Analyzer A GUI and command-line tool for collecting and analyzing
performance data.
Thread Analyzer A GUI and command-line tool for analyzing the execution of
multithreaded programs and checking for a variety of multithreaded programming errors.
Sun Performance Library A library of Sun-specific extensions and features for using
optimized, high-speed mathematical subroutines for solving linear algebra and other
numerically intensive problems.
Java EE and Web Applications Build web applications using Ajax, JavaScript, and CSS.
Support for frameworks including JSF, Struts, Spring and Hibernate. Full set of tools for EJB
development.
Ruby and Ruby on Rails Development Powerful Ruby editor with code completion and
debugger, and full support for Ruby on Rails. Includes the JRuby runtime.
Visual Mobile Development Create, test and debug GUI applications that run on mobile
phones, set-top boxes, and PDAs.
C and C++ Development Full-featured C/C++ editor, debugger, project templates,
support for multiple project configurations, remote development, performance profiling,
and packaging of completed projects.
Visit the netbeans.org web site for more information. New users might find the following pages
particularly useful:
Guided Video Tour of the NetBeans IDE
NetBeans IDE Java Quick Start Tutorial
NetBeans documentation
NetBeans Plugin Portal for plugin modules
NetBeans Wiki with New and Noteworthy, community documentation, and answers to
Frequently Asked Questions
Ruby on Rails A framework for web application development. Ruby is the object-oriented
programming language. Rails is an open source Ruby framework for developing web-based,
database-driven applications. In Web Stack, Ruby includes extensions for OpenSSL, curses,
Tcl/Tk, and readline. The NetBeans IDE includes support for Ruby and JRuby.
Squid A fully-featured HTTP/1.0 proxy server. Squid offers a rich access control,
authorization and logging environment to develop web proxy and content serving
applications.
memcached memcached is a high-performance, distributed memory object caching
system, which speeds up dynamic web applications by alleviating database load.
Tomcat Servlet container server software, which processes Java Servlet and JavaServer Pages
(JSP) applications to provide dynamic web pages.
For Oracle Solaris 10, the latest Oracle Message Passing Toolkit can be downloaded from the
Oracle Message Passing Toolkit page.
The Oracle Message Passing Toolkit can be used with the Oracle Solaris Studio compilers for C,
C++, and Fortran. The Oracle Message Passing Toolkit is integrated with Oracle Solaris Studio
Performance Analyzer to deliver full profiling capabilities for MPI applications, including MPI
States, a feature unique to Performance Analyzer. The Oracle Message Passing Toolkit also
supports the popular Totalview and Allinea DDT parallel debuggers.
See the Sun HPC ClusterTools documentation set for complete information about using the
Oracle Message Passing Toolkit.
applications. The JavaHelp System product page includes links for downloading JavaHelp
software and the JavaHelp System User's Guide and other documentation. Note that the
JavaHelp system is not an authoring system, but a help infrastructure. The product page also
includes information about third-party help authoring tools that support the JavaHelp system.
In addition, you can subscribe to the mailing list to get help from other JavaHelp users.
The Solaris on x86 Platforms Device Support list shows drivers and the devices they support for
x86 Oracle Solaris 10 systems. Select an Oracle Solaris 10 release and then select a device type
such as Network, Storage, or Video. Drivers of that type that are bundled in that selected release
are displayed.
The Oracle Device Detection Tool helps you to detect whether the Oracle Solaris 10 OS can be
installed on your x86, x64, or SPARC systems.
The Hardware Certification Test Suite (HCTS) includes system certification tests, controller
certification tests, a command-line interface , and a browser-based user interface. HCTS tests
certify systems, motherboards, and various network, storage, and serial I/O controllers to work
with the Oracle Solaris OS. HCTS collects log files, determines test pass or fail results, and
generates a final test report. Hardware that passes HCTS certification testing is eligible to be
included in the Hardware Compatibility List as Certified.
In addition, you can parallelize applications to enable them to reap the benefits of running in a
clustered environment. Oracle Message Passing Toolkit, formerly Sun HPC ClusterTools, is a
set of parallel development tools for high-end distributed memory applications. See Using
Oracle Message Passing Toolkit on page 17 for more information.
The book contains information on the rpcgen tool and the portmap utility. The book also
contains code examples on the use of RPC.
Programming Interfaces
The Programming Interfaces Guide describes programming interfaces that are specific to the
Oracle Solaris environment.
The Oracle Solaris OS includes two utilities that enable application developers to verify an
application's compliance with the Oracle Solaris Application Binary Interface (ABI).
Compliance with the Oracle Solaris ABI ensures that your code is portable across releases of the
Oracle Solaris OS. The Oracle Solaris ABI defines the interfaces that are available for the use of
application developers.
The appcert(1) utility statically examines the Oracle Solaris library interfaces used by ELF
binaries for instances of private interface usage. The apptrace(1) tool uses the link-auditing
capability of the run time linker to dynamically trace library routine calls as the application
runs.
The Device Driver Tutorial provides hands-on information about how to develop device
drivers for the Oracle Solaris OS. This book includes step-by-step descriptions for writing,
building, installing, loading, and testing simple device drivers. This book also gives an overview
of the driver development environment and the tools available to develop drivers. Links to
driver development resources and techniques for avoiding some driver development problems
are also provided.
The Writing Device Drivers manual provides much more complete information about
developing drivers for character-oriented devices and block-oriented devices. Specific devices
such as network devices, USB devices, and SCSI target and HBA devices are covered as well.
The Writing Device Drivers manual includes the following additional topics:
Multithreaded re-entrant drivers
Driver autoconfiguration
Programmed I/O
Direct Memory Access (DMA)
Power management
Hardening drivers
Device context management
Compilation, installation, testing, and debugging drivers
Guidelines for drivers for 64-bit environments