/*)LIBRARY
*/

#include	<rsts.h>

rs_write(channel, buffer, buflen, block, blockmsb, modifier)
int		channel;		/* Channel to read from		*/
char		*buffer;		/* I/O buffer			*/
int		buflen;			/* Buffer size			*/
int		block;			/* Block number for disk	*/
int		blockmsb;		/* High-byte for disk block	*/
int		modifier;		/* Device modifier		*/
/*
 * Write to this channel. Return zero on success, else error code
 */
{
	register int	errcode;

	clrxrb();
	xrb.xrlen	= buflen;	/* Buffer length		*/
	xrb.xrbc	= buflen;	/* Number of bytes to write	*/
	xrb.xrloc	= buffer;	/* Buffer start			*/
	xrb.xrci	= channel * 2;	/* Channel number		*/
	xrb.xrblkm	= blockmsb;	/* High-byte for disk i/o	*/
	xrb.xrblk	= block;	/* Block number			*/
	xrb.xrmod	= modifier;	/* Device (record) modifier	*/
	return(rstsys(_WRITE));
}
