/*---------------------------------------------------------------*/
/*   Copyright (c) 1988 Regents of the University of California  */
/*                 All Rights Reserved                           */
/*---------------------------------------------------------------*/
/*
      @(#)wbuff.c	1.3  (UCLA, IGPP) 20 Apr 1994 
 */

/* -- WBUFF ------------------------------------------------ */
/* Writes a record to the file buffer using pwrite.          *
/*                                                           */
/* ENTRY REQUIREMENTS:                                       */
/*	NONE.                                                */
/*                                                           */
/* RETURN VALUES:                                            */
/* 	Returns the number of bytes written from the file    */
/*	or -1 for an error                                   */
/*                                                           */
/*      Development History:                                 */
/*              Begun:  8/30/86 - Marco Zagha                */
/*                  Under GG44 support.                      */
/*              Update: 2/1/87 - Marco Zagha                 */
/*                  Under GG44 support.                      */
/* --------------------------------------------------------- */
wbuff()
{
  extern int Buffstarted;
  extern int Buffdesc;
  extern int Currentrec;
  extern char *Rbuffer;
  extern int Next_start;

  if (!Buffstarted) return (-1);

  setrecord(Currentrec);
  return (pwrite(Buffdesc,Rbuffer,Next_start));
}

