zabbix-agent2/src/libs/zbxcommon/file.c
/******************************************************************************
 *                                                                            *
 * Function: zbx_write_all                                                    *
 *                                                                            *
 * Purpose: call write in a loop, iterating until all the data is written.    *
 *                                                                            *
 * Parameters: fd      - [IN] descriptor                                      *
 *             buf     - [IN] buffer to write                                 *
 *             n       - [IN] bytes count to write                            *
 *                                                                            *
 * Return value: SUCCEED - n bytes successfully written                       *
 *               FAIL    - less than n bytes are written                      *
 *                                                                            *
 ******************************************************************************/
zbx_write_all

Purpose: call write in a loop, iterating until all the data is written.
zbx_write_all Purpose : call write in a loop iterating until all the data is written .
int	zbx_write_all(int fd, const char *buf, size_t n)
{
	while (0 < n)
	{
		ssize_t	ret;
		if (-1 != (ret = write(fd, buf, n)))
		{
			buf += ret;
			n -= (size_t)ret;
		}
		else if (EINTR != errno)
			return FAIL;
	}
	return SUCCEED;
}
int zbx_write_all ( int fd , const char * buf , size_t n ) { while ( 0 < n ) { ssize_t ret ; if ( -1 != ( ret = write ( fd , buf , n ) ) ) { buf += ret ; n -= ( size_t ) ret ; } else if ( EINTR != errno ) return FAIL ; } return SUCCEED ; }
Function: zbx_write_all                                                    
                                                                            
 Purpose: call write in a loop, iterating until all the data is written.
Function : zbx_write_all Purpose : call write in a loop iterating until all the data is written .