dag_tx_get_stream_space(3)

NAME
dag_tx_get_stream_space - retrieve the location of free space in a transmit stream's memory buffer

SYNOPSIS
#include "dagapi.h "

uint8_t*
dag_tx_get_stream_space(int dagfd, int stream_num, uint32_t size);

DESCRIPTION
It is necessary to acquire a pointer into the stream's memory buffer at which to write the records to be transmitted. When packet transmission is being performed using the zero-copy dag_tx_stream_commit_bytes(3) routine, dag_tx_get_stream_space blocks the transmission until the requested space is available. While polling for space to become available, it will sleep in poll time increments as set with dag_set_stream_poll(3), freeing the CPU for other processes.

RETURN VALUE
On success dag_tx_get_stream_space returns a pointer to the requested space, otherwise it returns NULL with errno set appropriately.

ERRORS

EBADF
    dagfd is an invalid file descriptor.

EINVAL
    stream_num refers to a stream that has not been attached.

ENOMEM
    stream_num refers to a stream that has no memory allocated to its buffer.

ENOTTY
    stream_num does not refer to a transmit stream.

EXAMPLE
FIXME Sample code.

SEE ALSO
dag_tx_get_stream_count(3), dag_tx_stream_commit_bytes(3), dag_tx_stream_copy_bytes(3).

BUGS
Report bugs to <support@endace.com>.

LAST UPDATED
$Author: koryn $
$Revision: 2474 $
$Date: 2005-11-10 11:13:19 +1300 (Thu, 10 Nov 2005) $

COPYRIGHT
(c) 2004-2005 Endace Technology, Hamilton, New Zealand. All Rights Reserved.