Seq_Write(3)

Synopsis

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

#include "unify.h"

int Seq_Write(seg_id_type seg, void *buff, int len)

Description

Seq_Write writes len bytes from the buffer pointed to by buff to the sequential segment referenced by seg. If several processes write to a sequential segment, no ordering of writes is guaranteed. That is, processes reading from seg with Seq_Read(3) may each see different orderings of the data. All reading processes are guaranteed to see the data written by a call to Seq_Write as a single contiguous block.

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_Write returns 0. 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_Read(3)


RCS status $Id: Seq_Write.html,v 1.1 1998/01/07 23:20:28 dieter Exp $