ssize_t wsize;
int wsize;
__put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap){	register int fd, page;	size_t size;	ssize_t wsize;	size = hashp->BSIZE;	if ((hashp->fp == -1) && open_temp(hashp))		return (-1);	fd = hashp->fp;	if (hashp->LORDER != BYTE_ORDER) {		register int i;		register int max;		if (is_bitmap) {			max = hashp->BSIZE >> 2;	/* divide by 4 */			for (i = 0; i < max; i++)				M_32_SWAP(((int *)p)[i]);		} else {			max = ((uint16 *)p)[0] + 2;            /* bound the size of max by             * the maximum number of entries             * in the array             */            if(max > (size / sizeof(uint16)))                return(DATABASE_CORRUPTED_ERROR);			for (i = 0; i <= max; i++)				M_16_SWAP(((uint16 *)p)[i]);		}	}	if (is_bucket)		page = BUCKET_TO_PAGE(bucket);	else		page = OADDR_TO_PAGE(bucket);	if ((MY_LSEEK(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) ||	    ((wsize = write(fd, p, size)) == -1))		/* Errno is set */		return (-1);	if (wsize != size) {		errno = EFTYPE;		return (-1);	}	/* put the page back the way it was so that it isn't byteswapped	 * if it remains in memory - LJM	 */	if (hashp->LORDER != BYTE_ORDER) {		register int i;		register int max;		if (is_bitmap) {			max = hashp->BSIZE >> 2;	/* divide by 4 */			for (i = 0; i < max; i++)				M_32_SWAP(((int *)p)[i]);		} else {    		uint16 *bp = (uint16 *)p;			M_16_SWAP(bp[0]);			max = bp[0] + 2;			/* no need to bound the size if max again			 * since it was done already above			 */			/* do the byte order re-swap			 */			for (i = 1; i <= max; i++)				M_16_SWAP(bp[i]);		}	}	return (0);}