Innerhalb
Nach weiteren Dokumenten suchen
Support-Ressourcen
| 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() 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
| TIOCMODG | TIOCMIDS | TIOCSBRK |
| TIOCCBRK | TIOCSETX | TIOCGETX |
| OTTYDISC | NETLDISC | NTTYDISC |
TABLDISC
KBLDISC | NTABLDISC | MOUSELDISC |
-
Table 16-2 shows ttycom ioctl requests that are not in the Solaris 2.4 operating environment.
-
Table 16-2 ttycom ioctl
| TIOCSCTTY | TIOCGETPGRP | TIOCSETPGRP |
| TIOCNOTTY | TIOCMSET | TIOCMGET |
| TIOCMBIS | TIOCMBIC | TIOCTCNTL |
| TIOCSIGNAL | TIOCSSOFTCAR | TIOCGSOFTCAR |
| TIOCISPACE | TIOCISIZE | TIOCCONS |
TIOCPKT
TIOCOUTQ | TIOCUCNTL | TIOCSTI |
-
Table 16-3 shows the ioctls supported in the Solaris 2.4 operating environment.
-
Table 16-3 ioctl
| ioctl() | Description |
| DKIOCGPART | These requests are replaced with DKIOCGAPART and DKIOCSAPART in Solaris 2.4 software. |
| DKIOCGCONF | This 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. |
| DKIOCSCMD | This request succeeds only for XD, XY, and 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 floppy device. |
| filio | The 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. |
| mtio | mtio ioctl requests are not supported in Solaris 2.4 software, the ABI, SVID, or SVR4. |
| sockio | The 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 |
| streamio | All 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. |
| audioio | The 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, termios | All 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_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.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
| 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_RSS | Maximum size (in bytes) to which a process's resident size 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-6 shows SunOS release 4.x and Solaris 2.4 libraries and their locations.
-
Table 16-6
| Library Name | SunOS release 4.x Directory | Solaris 2.4 Directory |
| libbsdmalloc.a | /usr/lib | Not 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/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 | /usr/lib |
| 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/ccs/lib, and
/usr/ccs/libp |
| libmp.a | /usr/lib | /usr/lib |
| libnbio.a | /usr/lib | Not available |
-
Table 16-6
| Library Name | SunOS release 4.x Directory | Solaris 2.4 Directory |
| 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,
/usr/5lib | /usr/ucblib, and
/usr/ccs/lib |
| libtermlib.a | /usr/lib, and
/usr/5lib | /usr/ccs/lib |
| libxgl.so.1.1 | /usr/lib | Not available |
| 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 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 Command | SunOS release 4.x Location | Solaris 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 Command | SunOS release 4.x Location | Solaris 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 Command | SunOS release 4.x Location | Solaris 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 Command | Description |
| dis | Object code disassembler for COFF |
| 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 |
-
Table 16-12 lists the SunOS release 4.x commands that are now unbundled.
-
Table 16-12
| Unbundled Command | Description |
| cb | A 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 |
-
Table 16-12
| Unbundled Command | Description |
| gprof | Displays call-graph profile data |
| indent | Indents and formats C program source files |
| inline | In-line procedure call expander |
| lint | A C program verifier |
| objdump | Dumps selected parts of a COFF object file |
| ranlib | Converts archives to random libraries |
| tcov | Constructs test coverage analysis and statement-by-
statement profile |
| trace | Traces system calls and signals |
|
|