User Guide

Ampex 1308911-02 5-57
libdd2 API Functions dst_space
5.18 dst_space
NAME
dst_space() - change current position by a specified number of blocks or files, or set current
position to end of data (EOD).
SYNOPSIS
#include <dd2.h>
int dst_space(int fd, int type, int count);
DESCRIPTION
dst_space() performs relative rather than absolute positioning. The current position can be
changed by:
Spacing forward or backward by the specified number of filemarks. The destination
position will be at the beginning or end of a file, respectively; i.e., at the end of tape (EOT)
side of a filemark when spacing forward, or the beginning of tape (BOT) side of a
filemark when spacing backward.
Spacing forward or backward by the specified number of user blocks within a file.
Spacing forward to EOD in the current partition.
PARAMETERS
fd The file descriptor returned by the open call.
type Specifies the type of relative positioning to perform. The following
definitions apply:
DST_SPACE_FILEMARKS
DST_SPACE_BLOCKS
DST_SPACE_TO_EOD
count Specifies the number or filemarks or data blocks to space over. Use a
positive value to space forward or a negative value to space backward.
The largest positive value is 1388607 (0x7fffff). The largest negative
value allowed is –1388608 (0xffffff).
RETURN VALUES
The return value is DST_SUCCESS (0) or DST_FAILURE (-1). See “DST API Overview” on
page 5-1 for information on
errno failure messages and associated DST result codes.