Solaris 1.x to Solaris 2.x Transition Guide
  Suchtext Nur in diesem Buch
Dieses Buch im PDF-Format herunterladen

Tools and Resources

16

This chapter discusses the changes to tools and resources for the development environment. This chapter contains the following sections:
ioctl() Requestspage 165
ptrace() Request Valuespage 168
Librariespage 170
Using makepage 172
Using SCCSpage 173
Determining Application Compatibilitypage 173
Packaging Applicationspage 174
Toolkitspage 176
Finding SunOS Release 4.x Toolspage 176

ioctl() Requests

All ioctls related to dkio, filio, mtio, sockio, streamio, termio, and termios are supported in this release.
A few incompatibilities exist between the SunOS release 4.x termios structure and Solaris 2.4 termios structure. Solaris 2.4 termios structure does not include a c_line field as it does in SunOS release 4.x. In the SunOS release 4.x, the c_cflag (hardware control of the terminal) can have CRTSCTS (enable RTS/CTS flow control), but this value is not defined in SVR4 or the Solaris 2.4 operating environment.
Table 16-1 shows ioctls defined in <sys/ttold.h> that are not implemented in this release.
Table 16-1 ioctl
TIOCMODGTIOCMIDSTIOCSBRK
TIOCCBRKTIOCSETXTIOCGETX
OTTYDISCNETLDISCNTTYDISC
TABLDISC
KBLDISC
NTABLDISCMOUSELDISC
Table 16-2 shows ttycom ioctl requests that are not in the Solaris 2.4 operating environment.
Table 16-2 ttycom ioctl
TIOCSCTTYTIOCGETPGRPTIOCSETPGRP
TIOCNOTTYTIOCMSETTIOCMGET
TIOCMBISTIOCMBICTIOCTCNTL
TIOCSIGNALTIOCSSOFTCARTIOCGSOFTCAR
TIOCISPACETIOCISIZETIOCCONS
TIOCPKT
TIOCOUTQ
TIOCUCNTLTIOCSTI
Table 16-3 shows the ioctls supported in the Solaris 2.4 operating environment.
Table 16-3 ioctl
ioctl()Description
DKIOCGPARTThese requests are replaced with DKIOCGAPART and DKIOCSAPART in Solaris 2.4 software.
DKIOCGCONFThis request is replaced with DKIOCINFO in Solaris 2.4 software, which includes the combined information of the SunOS release 4.x DKIOCGCONF and DKIOCINFO structures.
DKIOCSCMDThis request succeeds only for XD, XY, and IPI drives. This ioctl fails for SCSI devices. Use the USCSI ioctl for SCSI devices.
DKIOCGLOGEINVAL is returned. DKIOCWCHK toggles the write check on the floppy device.
filioThe following filio ioctl requests are not supported in this release or SVR4: FIOSETOWN, FIOGETOWN, FIOCLEX, FIONCLEX. filio ioctl requests not defined in the ABI or SVID.
mtiomtio ioctl requests are not supported in Solaris 2.4 software, the ABI, SVID, or SVR4.
sockioThe following sockio ioctl requests are implemented in SVR4 and Solaris 2.4 software: SIOCSPGRP, SIOCGPGRP, SIOCCATMARK. sockio ioctl requests are not defined in the ABI or SVID.
Table 16-3 ioctl
ioctl()Description
streamioAll SunOS release 4.x streamio ioctl requests are implemented in Solaris 2.4 software, the ABI, SVID, and SVR4. The I_FDINSERT request requires an argument that points to a strfdinsert structure. The SunOS release 4.x strfdinsert structure includes an fd (int) field, while the ABI, SVID, or SVR4 strfdinsert structure includes a fildes (int) field instead.
audioioThe SunOS release 4.x <sun/audioio.h> file has been moved to <sys/audioio.h> for Solaris 2.4 software. Additionally, in Solaris 2.4 software, there are enhancements to the interface. See audio(7), audioamd(7), or dbri(7) for more information.
termio, termiosAll SunOS release 4.x termio and termios ioctl requests are implemented in Solaris 2.4 software, the ABI, SVID, and SVR4. A few incompatibilities exist between the SunOS release 4.x termios structure and Solaris 2.4 software, or the ABI, SVID, or SVR4 termios structure. The SunOS release 4.x 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 SunOS release 4.x, but this value is not defined in Solaris 2.4 software, the ABI, SVID, or SVR4.

ptrace() Request Values

The ptrace() routine in Solaris 2.4 software uses integers 1 - 9 as request values, while the SunOS release 4.x routine defines request values as symbolic constants in <sys/ptrace.h>. The following SunOS release 4.x request
symbolic constants are compatible with Solaris 2.4 software:
PTRACE_TRACEME, PTRACE_PEEKTEXT, PTRACE_PEEKDATA,
PTRACE_PEEKUSER, PTRACE_POKETEXT, PTRACE_POKEDATA,
PTRACE_POKEUSER, PTRACE_CONT, PTRACE_KILL, PTRACE_SINGLESTEP.

The SunOS release 4.x PTRACE_CONT (Solaris 2.4 request 7) 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 Solaris 2.4 request 7 (SunOS release 4.x PTRACE_CONT) requires that addr always be equal to 1 and that execution always resumes from where the process had stopped. Also, the Solaris 2.4 request 7 cancels all pending signals, except those specified by data, before the process resumes execution. The SunOS release 4.x PTRACE_CONT does not cancel all pending signals.
Table 16-4 shows SunOS release 4.x valid requests that are not supported by the Solaris 2.4 ptrace() routine.
Table 16-4 ptrace
PTRACE_ATTACHPTRACE_GETWINDOW
PTRACE_DETACHPTRACE_SETWINDOW
PTRACE_GETREGSPTRACE_22
PTRACE_SETREGSPTRACE_23
PTRACE_GETFPREGSPTRACE_26
PTRACE_SETFPREGSPTRACE_27
PTRACE_READDATAPTRACE_28
PTRACE_WRITEDATAPTRACE_SYSCALL
PTRACE_READTEXTPTRACE_DUMPCORE
PTRACE_WRITETEXTPTRACE_SETWRBKPT
PTRACE_GETFPAREGSPTRACE_SETACBKPT
PTRACE_SETFPAREGSPTRACE_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.x BSD C library require more effort.

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 2.4 software.

Resource Limits

The Solaris 2.4 operating environment handles resource limits differently from SunOS release 4.x. In previous releases, static table allocations were used for resources such as file descriptors and active processes. These resources are now dynamically allocated. This means that they are limited by the physical memory available. Table 16-5 shows the resource limits.
Table 16-5
ConfigurationLimitation
RLIMIT_COREMaximum size of core file (in bytes) that can be created by a process
RLIMIT_CPUMaximum amount of CPU time (in seconds) that a process can use
RLIMIT_DATAMaximum size of a process's heap (in bytes)
RLIMIT_FSIZEMaximum size of a file (in bytes) that can be created by a process
RLIMIT_NOFILEOne more than the maximum number of file descriptors that can be created by a process
RLIMIT_RSSMaximum size (in bytes) to which a process's resident size may grow
RLIMIT_STACKMaximum 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-6 shows SunOS release 4.x and Solaris 2.4 libraries and their locations.
Table 16-6
Library NameSunOS release 4.x DirectorySolaris 2.4 Directory
libbsdmalloc.a/usr/libNot available
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/5libNot available
libcurses.a/usr/lib, and
/usr/5lib
/usr/ucblib, and
/usr/ccs/lib
libcurses_p.a/usr/5libNot available
libdbm.a/usr/lib/usr/ucblib
libdl.so.1.0/usr/lib/usr/lib
libg.a/usr/libNot available
libkvm.a/usr/lib/usr/lib
libkvm.so.0.3/usr/lib/usr/lib
libl.a/usr/lib/usr/ccs/lib
libln.a/usr/libNot available
liblwp.a/usr/libNot available
libm.a/usr/lib/usr/ccs/lib, and
/usr/ccs/libp
libmp.a/usr/lib/usr/lib
libnbio.a/usr/libNot available
Table 16-6
Library NameSunOS release 4.x DirectorySolaris 2.4 Directory
libnsl.a/usr/lib/usr/lib
libpixrect.a/usr/libNot available
libpixrect.so.2.14/usr/libNot available
libposix.a/usr/libNot available
libresolv.a/usr/lib/usr/lib
librpcsvc.a/usr/lib/usr/lib
libsuntool.so.0.54/usr/libNot available
libsunwindow.so.0.55/usr/libNot available
libsvidm.a/usr/5libNot available
libsvidm_p.a/usr/5libNot available
libtermcap.a/usr/lib,
/usr/5lib
/usr/ucblib, and
/usr/ccs/lib
libtermlib.a/usr/lib, and
/usr/5lib
/usr/ccs/lib
libxgl.so.1.1/usr/libNot available
libxpg.a/usr/xpg2libNot available
liby.a/usr/lib, and
/usr/5lib
/usr/ccs/lib

Using make

There are two make utilities available in the Solaris 2.4 operating environment. The default version, /usr/ccs/bin/make, is identical to the SunOS release 4.x 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. (See the following code sample.)

  In a SunOS 4.x Makefile:  
  install:  
       install -o bin -g bin -m 444 target.c /usr/bin/target  
  
  In a SunOS 5.4 Makefile:  
  install:  
       install -u bin -g bin -m 444 target.c /usr/bin/target  

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

Using SCCS

The Solaris 2.4 operating environment source code control system (SCCS) has minor differences from the SunOS release 4.x version. The same set of commands and subcommands are supported in both environments. SCCS directories and s.files used on SunOS release 4.x systems work equally well on Solaris 2.4 systems.
In SunOS release 4.x, 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 2.4 operating environment.
One difference between SunOS release 4.x and Solaris 2.4 utilities is the handling of unreadable s.files. The SunOS release 4.x commands print an error and continue when they encounter an unreadable s.file. The Solaris 2.4 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.
Information on using the Binary Compatibility Package is available in Solaris Binary Compatibility Guide.

Well-Behaved Applications

The Binary Compatibility Package works with well-behaved user applications. Well-behaved applications meet the following requirements:
  • They do not trap directly to the kernel
  • They do not write directly to any system files
  • They do not use /dev/kmem, /dev/mem, or libkvm
  • They do not use unpublished SunOS interfaces
  • They do not rely on customer-supplied drivers
Applications that are not well-behaved can produce unpredictable results.

Dynamically Linked and Statically Linked Executables

The Binary Compatibility Package provides compatibility for dynamically linked and statically linked applications.

Packaging Applications

The Solaris 2.4 operating environment is bundled in units called packages. These packages contain all of the files and information you need to add or remove software from your system.
A package consists of the following components:
  • pkginfo file - This is an ASCII file that sets characteristics of the package. It consists of a list of macro=value pairs that describe the package and set control parameters for its installation. See the pkginfo(4) man page for more information.

    prototype file - This is an ASCII file that defines the contents of the package. It contains one entry for each deliverable object (for example, files, directories, and links). It also contains installation entries for package information files, such as pkginfo, depend, and copyright files, and scripts. See the prototype(4) man page for more information.

    copyright file -This is an ASCII file that provides a copyright notice for the package. Its contents (including comment lines) are displayed during package installation. See the copyright(4) man page for more information.

    Package contents - The contents of the package.

Scripts - Scripts can be used to control installation or removal of a package, to request input from the user, or to perform an action on all objects of a particular class. Scripts must be executable by the Bourne shell.
Add-on application software should be packaged so it can be installed on a Solaris 2.4 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-7 lists commands that are useful for creating packages.
Table 16-7
pkgproto....Generates prototype file entries for input to the pkgmk command

pkgmk......Produces an installable package

pkgtrans....Translates package format

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

Table 16-8 Commands for Adding and Removing Packages
pkgadd.....Add software package to the system
pkgask.....Store answers to a request script
pkgrm......Remove a package from the system
pkgchk.....Check accuracy of installation
Table 16-9 lists commands that provide information about packages.

Table 16-9 Commands for Providing Information About Packages
pkginfo....Display software package information about installed packages
pkgparam....Display package parameter values

Toolkits

This section discusses changes to OLIT and XView.

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 SunView 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.x Tools

Most programming tools are still available in the Solaris 2.4 operating environment, and they provide the same capabilities, but many are in new locations. All bundled programming tools are now in two directories: /usr/ccs/bin and /usr/ccs/lib. Table 16-10 shows the programming tools and their locations.
Table 16-10
SunOS release 4.x CommandSunOS release 4.x LocationSolaris 2.4 Location
admin/usr/sccs/usr/ccs/bin
ar/usr/bin/usr/ccs/bin
as/usr/bin/usr/ccs/bin
cdc/usr/sccs/usr/ccs/bin
comb/usr/sccs/usr/ccs/bin
Table 16-10
SunOS release 4.x CommandSunOS release 4.x LocationSolaris 2.4 Location
cpp/usr/lib/cpp/usr/ccs/lib
delta/usr/sccs/usr/ccs/bin
error/usr/ucb/usr/ccs/bin
get/usr/sccs/usr/ccs/bin
help/usr/sccs/usr/ccs/bin
ld/usr/bin/usr/ccs/bin
lex/usr/bin/usr/ccs/bin
lorder/usr/bin/usr/ccs/bin
m4/usr/bin/usr/ccs/bin
make/usr/bin/usr/ccs/bin
nm/usr/bin/usr/ccs/bin
prof/usr/bin/usr/ccs/bin
prs/usr/sccs/usr/ccs/bin
prt/usr/sccs/usr/ccs/bin
rmdel/usr/sccs/usr/ccs/bin
sact/usr/sccs/usr/ccs/bin
sccs/usr/ucb/usr/ccs/bin
sccsdiff/usr/sccs/usr/ccs/bin
size/usr/bin/usr/ccs/bin
strip/usr/bin/usr/ccs/bin
symorder/usr/ucb/usr/ccs/bin
tsort/usr/bin/usr/ccs/bin
unget/usr/sccs/usr/ccs/bin
unifdef/usr/ucb/usr/ccs/bin
val/usr/sccs/usr/ccs/bin
vc/usr/old/usr/ccs/bin
Table 16-10
SunOS release 4.x CommandSunOS release 4.x LocationSolaris 2.4 Location
what/usr/sccs/usr/ccs/bin
yacc/usr/bin/usr/ccs/bin
yaccpar/usr/lib/usr/ccs/bin
Table 16-11 lists the new Solaris 2.4 commands and their descriptions.
Table 16-11
New CommandDescription
disObject code disassembler for COFF
dumpDumps selected parts of an object file
exstrExtracts strings from source files
mcsManipulates the comment section of an object file
regcmpRegular expression compiler
trussTraces system calls and signals
Table 16-12 lists the SunOS release 4.x commands that are now unbundled.
Table 16-12
Unbundled CommandDescription
cbA simple C program beautifier
ccC compiler
cflowGenerates a flow graph for a C program
cscopeInteractively examines a C program
ctraceGenerates a C program execution trace
cxrefGenerates a C program cross-reference
dbxSource-level debugger
dbxtoolWindow-based source-level debugger
Table 16-12
Unbundled CommandDescription
gprofDisplays call-graph profile data
indentIndents and formats C program source files
inlineIn-line procedure call expander
lintA C program verifier
objdumpDumps selected parts of a COFF object file
ranlibConverts archives to random libraries
tcovConstructs test coverage analysis and statement-by-
statement profile
traceTraces system calls and signals