/* Return the number of bytes of space available in the circular buffer.  */
static unsigned gs_buf_space_avail(struct gs_buf *gb)
/* Return the number of bytes of space available in the circular buffer.  */
static unsigned gs_buf_space_avail(struct gs_buf *gb)
{
	return (gb->buf_size + gb->buf_get - gb->buf_put - 1) % gb->buf_size;
}