V7/usr/man/man3/pkopen.3

Find at most related files.
including files from this version of Unix.

.TH PKOPEN 3 deprecated
.SH NAME
pkopen, pkclose, pkread, pkwrite, pkfail \- packet driver simulator
.SH SYNOPSIS
.B char *pkopen(fd)
.PP
.B pkclose(ptr)
.br
.B char *ptr;
.PP
.B pkread(ptr, buffer, count)
.br
.B char *ptr, *buffer;
.PP
.B pkwrite(ptr, buffer, count)
.br
.B char *ptr, *buffer;
.PP
.B pkfail()
.SH DESCRIPTION
These routines are a user-level implementation of the 
full-duplex
end-to-end communication protocol described in
.IR pk (4).
If
.I fd
is a file descriptor open for reading and writing,
.I pkopen
carries out the initial synchronization and returns an identifying
pointer.
The pointer
is used as the first parameter to
.I pkread,
.I pkwrite,
and
.I pkclose.
.PP
.I Pkread, pkwrite
and
.I pkclose
behave analogously to
.I read, write
and
.IR close (2).
However, a write of zero bytes
is meaningful and will produce a corresponding
read of zero bytes.
.SH SEE ALSO
pk(4), pkon(2)
.SH DIAGNOSTICS
.I Pkfail
is called upon persistent breakdown of communication.
.I Pkfail
must be supplied by the user.
.PP
.I Pkopen
returns a null (0) pointer if packet protocol
can not be established.
.PP
.I Pkread
returns \-1 on end of file,
0 in correspondence with a 0-length write.
.SH BUGS
This simulation of
.IR pk (4)
leaves something to be desired
in needing special read and write routines, and in
not being inheritable across calls of
.IR exec (2).
Its prime use is on systems that lack
.I pk.
.br
These functions use
.IR alarm (2);
simultaneous use of
.I alarm
for other puposes may cause trouble.