/* Return the number of bytes of data written into the circular buffer.  */
static unsigned gs_buf_data_avail(struct gs_buf *gb)
/* Return the number of bytes of data written into the circular buffer.  */
static unsigned gs_buf_data_avail(struct gs_buf *gb)
{
	return (gb->buf_size + gb->buf_put - gb->buf_get) % gb->buf_size;
}