sock(7sock)
sock --
socket interface driver
Description
The socket driver is used to provide socket
emulation to applications. Sockets provide an alternative
to TLI as an entry point into transport providers, such as
tcp(7tcp).
The socket driver is a character device that acts as an
alternate stream head, augmenting the functions of the
standard stream head. It also provides support for
miscellaneous functions such as
select(3C).
The behavior of sockets in handling asynchronous events and errors
was changed in UnixWare® 7 release 7.1.1. Compatibity with behavior
in earlier releases of UnixWare 7 may be obtained using the
SI_U7COMPAT
ioctl(2)
command on the socket file descriptor:
#include <sys/sockmod.h>
...
int err, fd, x;
...
/* Create a socket */
fd = socket(domain, type, protocol);
...
/* Select new behavior */
x = 0;
err = ioctl(fd, SI_UW7COMPAT, &x);
...
/* Select old behavior */
x = 1;
err = ioctl(fd, SI_UW7COMPAT, &x);
In the above examples, the value passed in by the argument x
controls the behavior of the socket as follows:
0-
Select new behavior:
-
For
read(2),
recv(3sock),
recvmsg(3sock)
and
recvfrom(3sock),
an asynchronous error causes the function to return with an
error without reading any data.
-
For
write(2),
send(3sock),
sendmsg(3sock)
and
sendto(3sock),
an asynchronous error causes the function to return with an
error without writing any data.
-
For
poll(2),
an asynchronous error causes POLLERR to be set in
the
revent
member of the file descriptor's pollfd structure.
-
For
select(3C),
an asynchronous error causes an exception to be set in the
exceptfds fd_set that corresponds to the file descriptor.
1-
Select old behavior:
-
connect(3sock)
blocks all signals except
SIGHUP, SIGINT, SIGQUIT, and SIGTERM.
-
connect(3sock)
always returns EINPROGRESS when first called to establish
an asynchronous connection.
-
If data received by a connectionless socket is not for the connected address,
getsockopt(3sock)
can retrieve EINVAL set for SO_ERROR.
Other operations may set the asynchronous error returned by SO_ERROR.
Default socket behavior is controlled by the value of the
inconfig(1Mtcp)
ss_uw7_compat parameter.
Files
/dev/socksys-
device interface to the socket driver
References
Intro(7tcp),
ifconfig(1Mtcp),
inconfig(1Mtcp),
inet(7tcp),
slattach(1Mtcp)
socket(7tcp),
sockio(7sock),
unix(7sock),
usock(7sock),
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004