srv_bzero

Description

Set the contents of a memory location to zero.

Syntax

CS_VOID srv_bzero(locationp, count)
CS_VOID     *locationp;
CS_INT        count;

Parameters

locationp

A non-null pointer to the address of the buffer to be zeroed.

count

The number of bytes at locationp to set to 0x00.

Returns

None.

Examples

Example 1

#include          <ospublic.h>
/*
 ** Local Prototype
 */
CS_RETCODE           ex_srv_bzero PROTOTYPE((
 CS_VOID              *locationp,
 CS_INT               cnt
 ))
/*
 ** EX_SRV_BZERO
**     Example routine to set the contents of a section of memory
 **     to zero using srv_bzero
**
** Arguments:
**
**     memp          Pointer to section of memory.
**     count         Number of bytes to set to zero.
**
** Returns
**     CS_SUCCEED     Arguments were valid and srv_bzero called.
**     CS_FAIL        An error was detected.
**
 */
CS_RETCODE      ex_srv_bzero(memp, count)
CS_VOID         *memp;
CS_INT          count;
{
     /* Check arguments. */
     if(memp == (CS_VOID *)NULL)
     {
          return(CS_FAIL);
     }
     if(count < 0)
     {
          return(CS_FAIL);
     }

     /*
     ** Set the section of memory to the value 0x00.
     */
     (CS_VOID)srv_bzero(memp,count);
     return(CS_SUCCEED);
}

Usage

See also

srv_bmove