Solaris 64-bit Developer's Guide

Preface

The capabilities of the SolarisTM operating environment continue to expand to meet customer needs. The Solaris operating environment was designed to fully support both the 32-bit and 64-bit architectures. It provides an environment for building and running 64-bit applications that can use large files and large virtual address spaces. At the same time, it continues to provide maximum source and binary compatibility and interoperability for 32-bit applications. In fact, most of the system commands that run and have been built on the Solaris 64-bit implementation are 32-bit programs.

The major differences between the 32-bit and the 64-bit application development environments are that 32-bit applications are based on the ILP32 data model, where ints, longs, and pointers are 32 bits, while 64-bit applications are based on the LP64 model, where longs and pointers are 64 bits and the other fundamental types are the same as in ILP32.

Most applications can remain as 32-bit programs with no changes required. Conversion is necessary only if the application has one or more of the following requirements:

Specific interoperability issues can also require code changes. For example, if your application uses files larger than 2 gigabytes, you might want to convert it to 64-bit.

In some cases, it is better to convert applications to 64-bit for performance reasons. For example, you might need the 64-bit registers to do efficient 64-bit arithmetic or you might want to take advantage of other performance improvements that a 64-bit instruction set provides.

Who Should Use This Book

This document is written for C and C++ developers and provides guidance on how to determine whether an application is 32-bit or 64-bit. It lists the similarities and differences between the 32-bit and 64-bit application environments, explains how to write code that is portable between the two environments, and describes the tools provided by the operating system for developing 64-bit applications.

How This Book Is Organized

This book is organized into the following chapters.

Related Books

For further reading, the following are recommended:

Ordering Sun Documents

Fatbrain.com, an Internet professional bookstore, stocks select product documentation from Sun Microsystems,TM Inc.

For a list of documents and how to order them, visit the Sun Documentation Center on Fatbrain.com at http://www1.fatbrain.com/documentation/sun.

Accessing Sun Documentation Online

The docs.sun.comSM Web site enables you to access Sun technical documentation online. You can browse the docs.sun.com archive or search for a specific book title or subject. The URL is http://docs.sun.com.

What Typographic Conventions Mean

The following table describes the typographic changes used in this book.

Table P-1 Typographic Conventions

Typeface or Symbol 

Meaning 

Example 

AaBbCc123

 The names of commands, files, and directories; on-screen computer output

Edit your .login file.

Use ls -a to list all files.

machine_name% you have mail.

AaBbCc123

 What you type, contrasted with on-screen computer outputmachine_name% su Password:

AaBbCc123

 Command-line placeholder: replace with a real name or value

To delete a file, type rm filename.

AaBbCc123

Book titles, new words or terms, or words to be emphasized. 

Read Chapter 6 in User's Guide.

These are called class options.

Do not save changes yet.

Shell Prompts in Command Examples

The following table shows the default system prompt and superuser prompt for the C shell, Bourne shell, and Korn shell.

Table P-2 Shell Prompts

Shell 

Prompt 

 C shell promptmachine_name%
 C shell superuser promptmachine_name#
 Bourne shell and Korn shell prompt$
 Bourne shell and Korn shell superuser prompt#


Note -

The term "IA" refers to the Intel 32-bit processor architecture, which includes the Pentium, Pentium Pro, Pentium II, Pentium II Xeon, and Pentium III processors and compatible microprocessor chips made by AMD and Cyrix.