1PKOPEN(3)                  Library Functions Manual                  PKOPEN(3)
2
3
4

NAME

6       pkopen, pkclose, pkread, pkwrite, pkfail - packet driver simulator
7

SYNOPSIS

9       char *pkopen(fd)
10
11       pkclose(ptr)
12       char *ptr;
13
14       pkread(ptr, buffer, count)
15       char *ptr, *buffer;
16
17       pkwrite(ptr, buffer, count)
18       char *ptr, *buffer;
19
20       pkfail()
21

DESCRIPTION

23       These  routines are a user-level implementation of the full-duplex end-
24       to-end communication protocol described in pk(4).   If  fd  is  a  file
25       descriptor open for reading and writing, pkopen carries out the initial
26       synchronization and returns an identifying  pointer.   The  pointer  is
27       used as the first parameter to pkread, pkwrite, and pkclose.
28
29       Pkread,  pkwrite  and  pkclose  behave  analogously  to read, write and
30       close(2).  However, a write of zero bytes is meaningful and  will  pro‐
31       duce a corresponding read of zero bytes.
32

SEE ALSO

34       pk(4), pkon(2)
35

DIAGNOSTICS

37       Pkfail  is  called  upon persistent breakdown of communication.  Pkfail
38       must be supplied by the user.
39
40       Pkopen returns a null (0) pointer if packet protocol can not be  estab‐
41       lished.
42
43       Pkread  returns  -1 on end of file, 0 in correspondence with a 0-length
44       write.
45

BUGS

47       This simulation of pk(4) leaves something to be desired in needing spe‐
48       cial read and write routines, and in not being inheritable across calls
49       of exec(2).  Its prime use is on systems that lack pk.
50       These functions use alarm(2);  simultaneous  use  of  alarm  for  other
51       puposes may cause trouble.
52
53
54
55                                  deprecated                         PKOPEN(3)
Impressum