This chapter discusses Solaris 7 networking features as they relate to the programming environment, as well as issues concerning the improved internationalization features.
The Solaris 7 operating environment includes the following networking features:
Distributed file system (DFS), which centralizes the file system utilities
Network information services plus (NIS+) including NFS
Name service switch file
See NIS+ Transition Guide and NFS Administration Guide for more information on using these services.
The Solaris 7 operating environment supports the network information service (NIS), the SunOS release 4 name service, and the network information services plus (NIS+), an enterprise-naming service of heterogenous distributed systems. See "NIS+" for the nature of NIS+ support available in the Solaris 7 operating environment.
NIS+ provides improved security, a more detailed model for objects in the name space, and faster updates than NIS.
The NIS+ programmer interfaces are documented in section 3N of the man Pages(3): Library Routines.
The nsswitch.conf file simplifies name service administration. Applications can use this file to select a name service. This information no longer needs to be hard-coded into the service. See the nsswitch.conf(4) man page for more information on the format of this file.
The Network Interface Tap (NIT) provided in SunOS release 4 is no longer required. Now Ethernet drivers are real STREAMS drivers that can be opened and communicated with directly.
See pfmod(7M), bufmod(7M), and dlpi(7P)
The Solaris 7 Ethernet drivers and other data link drivers support the connectionless Data Link Provider Interface (DLPI) Version 2 specification.
Sockets are supported in the Solaris 7 operating environment. Unlike the SunOS release 4 software, sockets are no longer implemented completely in the kernel. They are now in a library, libsocket, implemented on STREAMS.
Most of the changes in the Solaris 7 operating environment improve on previous internationalization features. For complete information on internationalization support, see Developer's Guide to Internationalization.
Application developers concerned with internationalizing their programs should follow these guidelines:
Call setlocale(3C) to set up the LANG
environment variable
Use standard code sets and follow 8-bit boundaries
Use strftime(3C) to print the date and time
Replace strcmp(3) with strcoll(3C) for user-visible collation
Call gettext(3C) or catget(3C) to retrieve translated strings from locale-specific message catalogs
The Solaris 7 operating environment supports extended UNIX code (EUC), VTF8, PCK, and B165. This allows multibyte and multiple code sets on one system.
The SunOS release 4 software supported single-byte representation of non-ASCII characters. The Solaris 7 operating environment supports multibyte representation. This support is needed for Asian language character sets, which contain thousands of characters.
The multibyte functions are included in libc and provide the following features:
Multibyte-to-wide character conversions
Wide character standard I/O
Wide character classification
Wide character formatting
The Solaris 7 operating environment supports multibyte file names; however, login and machine names should be restricted to ASCII characters.
SunOS release 4 support for message catalogs is enhanced in the Solaris 7 operating environment to enable the creation of message catalogs using multibyte characters.
Using message catalogs, an application can display messages at run-time in the native language in which an application was run. These message catalogs must first be created for the native language specified by the language locale.
The SunOS release 5.7 locale database (/usr/lib/locale/locale) is completely different from the locale database of SunOS release 5. This is transparent to the user, however.
Most of the system commands in the Solaris 7 operating environment have been messaged. Many of these commands can pass through multibyte character representations. The increased number of messaged commands makes localization efforts easier.
The installtxt(1) command has been replaced with msgfmt(1). Use the new xgettext(1) command to extract messages.
Changes to strftime(3C) affect date and time formats. Shell programs that rely on the output format of the date(1) command will have to be updated to handle the new format.
chrtbl(8) and catdef(8) are replaced by localedef(1).
The /usr/xpg2lib/libxpg2.a archive library is no longer available. These routines have been included in libc.
Table 17-1 shows the new location of these interfaces.
Table 17-1 xpg2lib Library Routine Locations
Routine |
Solaris 7 Location |
---|---|
/usr/lib/libc |
|
/usr/lib/libc |
|
/usr/lib/libc |
|
/usr/lib/libc |
|
/usr/lib/libc |
|
/usr/lib/libc |
|
Not supported. |
|
/usr/lib/libc |
|
/usr/lib/libc |
|
/usr/lib/libc |
|
/usr/lib/libc |
|
/usr/lib/libc |
|
/usr/lib/libc |
|
/usr/lib/libc |
Programs that use these routines no longer need to pass -lxpg2 to the C compiler although some may need to include libintl.h. (See Table 17-1 for these routines.)
The catgetmsg(3C) routine is no longer available.
The order of locale categories in the string returned by setlocale(3C) differs between the SunOS release 4 and the Solaris 7 software. This string is normally used by a subsequent call to setlocale(3C), and the order should not matter. Applications should not rely on a specific order of locale categories.