Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pkopen(3) [v7 man page]

PKOPEN(3)						     Library Functions Manual							 PKOPEN(3)

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

Check Out this Related Man Page

fread(3s)																 fread(3s)

       fread, fwrite - buffered binary input/output

       #include <stdio.h>

       size_t fread(ptr, size, nitems, stream)
       void *ptr;
       size_t size, nitems;
       FILE *stream;

       size_t fwrite(ptr, size, nitems, stream)
       void *ptr;
       size_t size, nitems;
       FILE *stream;

       The  function  reads  into a block beginning at ptr, nitems of data of the size size (usually sizeof *ptr) from the named input stream.	It
       returns the number of items actually read.

       If stream is stdin and the standard output is line buffered, then any partial output line will be flushed before any call to to satisfy the

       The function appends, at most, nitems of data of the size size (usually sizeof *ptr) beginning at ptr  to  the  named  output  stream.	It
       returns the number of items actually written.

Return Values
       The and functions return 0 upon end of file or error.

See Also
       read(2), write(2), fopen(3s), getc(3s), gets(3s), printf(3s), putc(3s), puts(3s), scanf(3s)

Man Page