Seq_Read(3)

Synopsis

cc [ flag ... ] file ... -lunify -levents -lpvm3 -lgpvm3 -lthread -ll -lsocket -lnsl -lw -lposix4 -lucb [ library ... ]

#include "unify.h"

int Seq_Read(seg_id_type seg, char *buff, int len)

Description

Seq_Read reads the next len bytes from the sequential segment referenced by seg into the buffer pointed to by buff. If len bytes are not available, Seq_Read blocks until len bytes are available.

A sequential segment behaves like a circular buffer. If a process uses Seq_Write(3) to write more data than a segment can hold before a reading process can read the data, old data will be overwritten. The length of the segment is determined when it is created with Create_Seg(3). Get_Limit(3) can be called to determine if data has been overwritten.

Return Values

On success Seq_Read returns the number of bytes read. Otherwise, a value of -1 is returned.

Errors

An error may occur if one of the following conditions is met:

seg is not a valid segment identifier.
The segment reference by seg is not a sequential segment.

See Also

Create_Seg(3), Get_Limit(3), Seq_Wakeup(3), Seq_Write(3)


RCS status $Id: Seq_Read.html,v 1.2 1998/01/14 16:09:26 dieter Exp $