Solaris Transition Guide

Chapter 16 Tools and Resources

This chapter discusses the changes to tools and resources for the development environment.

ioctl() Requests

All ioctls related to dkio(7I), filio, mtio(7I), sockio(7I), streamio(7I), termio(7I), and termios(7I) are supported in this release.

A few incompatibilities exist between the SunOS release 4 termios structure and Solaris 7 termios structure. For example, the Solaris 7 termios structure does not include a c_line field.

The following ioctls requests, defined in <sys/ttold.h>, are not implemented in this release.

The following ttycom ioctl requests are not in the Solaris 7 operating environment.

Table 16-1 shows the ioctls supported in the Solaris 7 operating environment.

Table 16-1 ioctl() Support

ioctl()

Description 

DKIOCGPART

These requests are replaced with DKIOCGAPART and DKIOCSAPART in Solaris 7 software.

DKIOCGCONF

This request is replaced with DKIOCINFO in Solaris 7 software, which includes the combined information of the SunOS release 4 DKIOCGCONF and DKIOCINFO structures.

DKIOCSCMD

This request succeeds only for IPI drives. This ioctl fails for SCSI devices. Use the USCSI ioctl for SCSI devices.

DKIOCGLOG

EINVAL is returned. DKIOCWCHK toggles the write check on the diskette drive.

filio

The following filio ioctl requests are not supported in this release or SVR4: FIOSETOWN, FIOGETOWN, FIOCLEX, FIONCLEX. filio ioctl requests are not defined in the ABI or SVID.

mtio

Not all devices support all mtio ioctl requests in Solaris 7. See the mtio(7) man pages.

sockio

The following sockio ioctl requests are implemented in SVR4 and Solaris 7 software: SIOCSPGRP, SIOCGPGRP, SIOCATMARK. sockio ioctl requests are not defined in the ABI or SVID.

streamio

All SunOS release 4 streamio ioctl requests are implemented in Solaris 7 software, the ABI, SVID, and SVR4. The I_FDINSERT request requires an argument that points to a strfdinsert structure. The SunOS release 4 strfdinsert structure includes an fd (int) field, while the ABI, SVID, or SVR4 strfdinsert structure includes a fildes (int) field instead.

audioio

The SunOS release 4 <sun/audioio.h> file has been moved to <sys/audioio.h> for Solaris 7 software. Additionally, in Solaris 7 software, there are enhancements to the interface. See the audio(7), audioamd(7), or dbri(7) man pages for more information.

termio, termios

All SunOS release 4 termio and termios ioctl requests are implemented in Solaris 7 software, the ABI, SVID, and SVR4. There are a few incompatibilities between the SunOS release 4 termios structure and Solaris 7 software, or the ABI, SVID, or SVR4 termios structure. The SunOS release 4 termios structure includes a c_line field that is not supported by the other releases. The c_cflag (hardware control of the terminal) can have CRTSCTS (enable RTS/CTS flow control) under the SunOS release 4 software, but this value is not defined in the Solaris 7 software, the ABI, SVID, or SVR4. However, the functionality is supported through the termiox(7) interface.

ptrace() Request Values

The ptrace() facility is implemented on top of /proc. New applications should use proc(4) directly.

The ptrace() routine in Solaris 7 software is present solely to support applications running in BCP mode. It uses integers 1 - 9 as request values, while the SunOS release 4 routine defines request values as symbolic constants in <sys/ptrace.h>. The following SunOS release 4 request symbolic constants are compatible with Solaris 7 software.

The SunOS release 4 PTRACE_CONT addr argument specifies where the stopped process should resume execution, unless addr = 1, in which case execution resumes from where the process had stopped. The equivalent Solaris 7 request 7 requires that addr always be equal to 1 and that execution always resumes from where the process stopped. Also, the Solaris 7 request 7 cancels all pending signals before the process resumes execution except those specified by data. The SunOS release 4 PTRACE_CONT does not cancel all pending signals.

Table 16-2 shows SunOS release 4 valid requests that are not supported by the Solaris 7 ptrace() routine.

Table 16-2 ptrace() Requests Not Supported by Solaris 7 Software

PTRACE_ATTACH

PTRACE_GETWINDOW

PTRACE_DETACH

PTRACE_SETWINDOW

PTRACE_GETREGS

PTRACE_22

PTRACE_SETREGS

PTRACE_23

PTRACE_GETFPREGS

PTRACE_26

PTRACE_SETFPREGS

PTRACE_27

PTRACE_READDATA

PTRACE_28

PTRACE_WRITEDATA

PTRACE_SYSCALL

PTRACE_READTEXT

PTRACE_DUMPCORE

PTRACE_WRITETEXT

PTRACE_SETWRBKPT

PTRACE_GETFPAREGS

PTRACE_SETACBKPT

PTRACE_SETFPAREGS

PTRACE_CLRDR7

Libraries

This release is compliant with the System V Interface Definition, Third Edition (SVID 3). Programs written with the SunOS release 4.1 System V libraries are easy to port to this release. Programs using the SunOS release 4 BSD C library require more effort.

Reorganized Libraries

Several functions and groups of functions were moved into different libraries. This can cause references to these functions to be flagged as undefined when compiling a SunOS release 4 application in the Solaris 7 environment.

After a compile, check the man page of any functions flagged as undefined. The synopsis lists both the -l linker option and any include files that you need to resolve the symbol.

Shared Libraries

Shared libraries do not currently support minor version numbers.

Files for shared initialized data (.sa) are no longer required; no .sa files are provided with the Solaris 7 software.

Resource Limits

In previous releases, static table allocations were used for resources such as file descriptors and active processes. These resources are now dynamically allocated, so they are limited by the physical memory available. Table 16-3 shows the resource limits.

Table 16-3 Resource Limits

Configuration 

Limitation 

RLIMIT_CORE

Maximum size of core file (in bytes) that can be created by a process 

RLIMIT_CPU

Maximum amount of CPU time (in seconds) that a process can use 

RLIMIT_DATA

Maximum size of a process's heap (in bytes) 

RLIMIT_FSIZE

Maximum size of a file (in bytes) that can be created by a process 

RLIMIT_NOFILE

One more than the maximum number of file descriptors that can be created by a process 

RLIMIT_VMEM

Maximum size (in bytes) to which a process's mapped address space may grow 

RLIMIT_STACK

Maximum size (in bytes) of a process's stack 


Note -

Any shared objects that need the networking libraries must be dynamically linked. The networking libraries require libdl.so.1. An archive library is not available.


Table 16-4 shows SunOS release 4 and Solaris 7 libraries and their locations.

Table 16-4 Comparison of Library Locations

Library Name 

SunOS release 4 Directory 

Solaris 7 Directory 

libbsdmalloc.a

/usr/lib

/usr/lib

libc.a

/usr/lib and /usr/5lib

/usr/lib

libc.so.1.7

/usr/lib

/usr/lib

libc.so.2.7

/usr/5lib

/usr/lib

libc_p.a

/usr/5lib

Not available 

libcurses.a

/usr/lib and /usr/5lib

/usr/ucblib and /usr/ccs/lib

libcurses_p.a

/usr/5lib

Not available 

libdbm.a

/usr/lib

/usr/ucblib

libdl.so.1.0

/usr/lib

/usr/lib

libg.a

/usr/lib

Not available 

libkvm.a

/usr/lib

Not available  

libkvm.so.0.3

/usr/lib

/usr/lib

libl.a

/usr/lib

/usr/ccs/lib

libln.a

/usr/lib

Not available 

liblwp.a

/usr/lib

Not available 

libm.a

/usr/lib

/usr/lib and /usr/lib/libp

libmp.a

/usr/lib

/usr/lib

libnbio.a

/usr/lib

Not available 

libnsl.a

/usr/lib

/usr/lib

libpixrect.a

/usr/lib

Not available

libpixrect.so.2.14

/usr/lib

Not available 

libposix.a

/usr/lib

Not available 

libresolv.a

/usr/lib

/usr/lib

librpcsvc.a

/usr/lib

/usr/lib

libsuntool.so.0.54

/usr/lib

Not available 

libsunwindow.so.0.55

/usr/lib

Not available 

libsvidm.a

/usr/5lib

Not available 

libsvidm_p.a

/usr/5lib

Not available 

libtermcap.a

/usr/lib and

/usr/5lib

/usr/ucblib and /usr/ccs/lib

libtermlib.a

/usr/lib and

/usr/5lib

/usr/ccs/lib

libxgl.so.1.1

/usr/lib

/opt/SUNWits/

Graphics-sw/xgl/lib

libxpg.a

/usr/xpg2lib

Not available 

liby.a

/usr/lib and

/usr/5lib

/usr/ccs/lib

Using make

There are two make utilities available in the Solaris 7 operating environment. The default version, /usr/ccs/bin/make, is identical to the SunOS release 4 make command. The SVR4 version is available in /usr/ccs/lib/svr4-make.

Using the default version, your Makefiles will not need changes. However, some of the commands used in your Makefiles may have changed. For example, install(1), commonly used in Makefiles, could produce unexpected results because of changes to the options, as shown in the following examples.

The version of install(1B) in /usr/ueb is compatible with the SunOS release 4 version.

Check the compatibility tables in Appendix A, Commands Reference Table, for information about individual interfaces.

Using SCCS

The Solaris 7 operating environment source code control system (SCCS) is slightly different from the SunOS release 4 version. The same set of commands and subcommands are supported in both environments. SCCS directories and s.files used on SunOS release 4 systems work equally well on Solaris 7 systems.

In the SunOS release 4 software, the SCCS commands were located in the /usr/sccs directory. These commands are located with the other programming tools in /usr/ccs/bin in the Solaris 7 operating environment.

One difference between SunOS release 4 and Solaris 7 utilities is the handling of unreadable s.files. The SunOS release 4 commands print an error and continue when they encounter an unreadable s.file. The Solaris 7 commands silently ignore the error.

Determining Application Compatibility

Although the Binary Compatibility Package is not provided as a development environment, it requires sound programming practices that can improve binary compatibility with future releases.

The Binary Compatibility Package provides compatibility for dynamically linked and statically linked applications, as well as hybrids that are partially static and partially dynamically linked.

The Binary Compatibility Package works with well-behaved user applications. Well-behaved applications do not:

Applications that are not well-behaved can produce unpredictable results.

Information on using the Binary Compatibility Package is available in Binary Compatibility Guide.

Packaging Applications

The Solaris 7 operating environment is bundled in units called packages. These packages contain all the files and information you need to add or remove software from your system.

A package consists of the following components:

Add-on application software should be packaged so it can be installed on a Solaris 7 system from diskette, tape, or CD-ROM. Application Packaging Developer's Guide provides guidelines for building your packages.

Packaging Utilities

Several utilities are provided to create and manipulate packages. Table 16-5 lists commands that are useful for creating packages.

Table 16-5 Commands for Creating Packages

pkgproto

Generates prototype file entries for input to the pkgmk command

pkgmk

Produces an installable package 

pkgtrans

Translates package format 

Table 16-6 lists commands that are useful for adding and removing packages.

Table 16-6 Commands for Adding and Removing Packages

pkgadd

Adds software package to the system 

pkgask

Stores answers to a request script 

pkgrm

Removes a package from the system 

pkgchk

Checks accuracy of installation 

Table 16-7 lists commands that provide information about packages.

Table 16-7 Commands for Providing Information About Packages

pkginfo

Displays software package information about installed packages 

pkgparam

Displays package parameter values

Toolkits

This section discusses OPEN LOOK Intrinsics ToolKit (OLIT) and XViewTM.

OLIT

The OPEN LOOK Intrinsics Toolkit (OLIT) is based on Xt Intrinsics. It provides a set of functions common to many widget sets to create, employ, and destroy user interface components for an X environment.

XView

The XView Window Toolkit provides an implementation of the OPEN LOOK Graphical User Interface (GUI) specification. It provides a migration path for SunViewTM applications.

XView uses variable-length attribute-value lists based on varargs to specify objects to be created, such as windows, menus, and scrollbars. This eliminates most of the boilerplate software usually found in procedural interfaces, since the usual behavior is already defined.

Finding SunOS release 4 Tools

Most SunOS release 4 programming tools are still available and stil provide the same capabilities, but many are in new locations. All bundled programming tools are now in the /usr/ccs/bin library except cpp, which is now in the /usr/ccs/lib library. Table 16-8 shows the programming tools and their SunOS release 4 locations.

Table 16-8 Bundled Programming Tools

SunOS Release 4 Command 

SunOS Release 4 Location 

admin

/usr/sccs

ar

/usr/bin

as

/usr/bin

cdc

/usr/sccs

comb

/usr/sccs

cpp

/usr/lib/cpp

delta

/usr/sccs

error

/usr/ucb

get

/usr/sccs

help

/usr/sccs

ld

/usr/bin

lex

/usr/bin

lorder

/usr/bin

m4

/usr/bin

make

/usr/bin

nm

/usr/bin

prof

/usr/bin

prs

/usr/sccs

prt

/usr/sccs

ranlib

/usr/bin

rmdel

/usr/sccs

sact

/usr/sccs

sccs

/usr/ucb

sccsdiff

/usr/sccs

size

/usr/bin

strip

/usr/bin

symorder

/usr/ucb

tsort

/usr/bin

unget

/usr/sccs

unifdef

/usr/ucb

val

/usr/sccs

vc

/usr/old

what

/usr/sccs

yacc

/usr/bin

yaccpar

/usr/lib

Table 16-9 lists the new Solaris 7 programming tools and their descriptions.

Table 16-9 New Programming Tools

New Command 

Description 

dis

Object code disassembler  

dump

Dumps selected parts of an object file 

exstr

Extracts strings from source files 

mcs

Manipulates the comment section of an object file 

regcmp

Regular expression compiler 

truss

Traces system calls and signals 

ptools

Miscellaneous /proc utilities

Table 16-10 lists the SunOS release 4 commands that are unbundled in SunOS release 5.7.

Table 16-10 Unbundled Programming Tools

Unbundled Command 

Description 

cb

Simple C program beautifier 

cc

C compiler 

cflow

Generates a flow graph for a C program 

cscope

Interactively examines a C program 

ctrace

Generates a C program execution trace 

cxref

Generates a C program cross-reference 

dbx

Source-level debugger 

dbxtool

Window-based source-level debugger 

gprof

Displays call-graph profile data 

indent

Indents and formats C program source files 

inline

In-line procedure call expander 

lint

C program verifier 

objdump

Dumps selected parts of a COFF object file 

tcov

Constructs test coverage analysis and statement-by-statement profile