DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
API compatibility

Sockets interface

SCO OpenServer, SCO UnixWare 2.1.X, and UnixWare 7 all support the sockets interface. Although there are many similarities between the implementations, the differences are significant enough that a compatibility library is provided in /OpenServer/lib so that SCO OpenServer binaries can run on UnixWare 7 without modification.

Applications compiled with the UnixWare and OpenServer Development Kit that use the UnixWare 7 libsocket interfaces require the appropriate Binary Compatibility Module (BCM) to run on SCO OpenServer or SCO UnixWare 2.1.X.

The default action on both SCO UnixWare 2.1.X and UnixWare 7 is UNIX95 sockets behavior; this essentially translates to linking with /usr/lib/libsocket.so.2. The BCM for SCO UnixWare 2.1.X installs the UnixWare 7 sockets library.

On SCO OpenServer, the BCM translates sockets calls to use the SCO OpenServer sockets API.

To compile and link a program using UnixWare 7 sockets, do the following:

  1. Include the following header files at the beginning of your source files. The syntax of the include preprocessor directives to use are:
       #include <netdb.h>
       #include <sys/types.h>
       #include <sys/socket.h>
       #include <net/if.h>
       #include <netinet/in.h>
       #include <netinet/if_ether.h>
    

  2. Specify the libsocket and libnsl libraries as two of the libraries to be searched on the cc command line, in the order shown:
       cc -lsocket -lnsl ...
    
    or use:
       cc -lxnet ...
    

Socket addressing

The type of socket address structure passed to a socket routine (such as connect) depends on the address and protocol families used by your application.

Platform Supported
Address
Families
sockaddr
structure
UnixWare 7 AF_UNIX
AF_INET
AF_INET6
AF_UNIX requires a socketaddr_un structure as defined in sys/un.h. AF_INET requires a sockaddr_in structure as defined in netinet/in.h. AF_INET6 requires a sockaddr_in6 structure as defined in netinet/in.h. Each of these UnixWare 7 sockaddr structures have been modified to support variable length sockets. The net result of this modification is that the family member has been shortened to 8 bits and a new 8-bit member inserted before it called len. For more information on the UnixWare 7 sockaddr structure, see: unix(7sock) and inet(7tcp).
SCO UnixWare 2.1.X AF_UNIX
AF_INET
AF_UNIX requires a socketaddr_un structure as defined in sys/un.h. AF_INET requires a sockaddr_in structure as defined in netinet/in.h. These structures are compatible with the SCO OpenServer structures. Variable length sockets are not supported.
SCO OpenServer AF_UNIX
AF_INET
AF_UNIX requires a socketaddr_un structure as defined in sys/un.h. AF_INET requires a sockaddr_in structure as defined in netinet/in.h. These structures are compatible with the SCO UnixWare 2.1.X structures. Variable length sockets are not supported.


Next topic: libsocket compatibility table (accept - ether_ntohost)
Previous topic: TLI/XTI compatibility table

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004