IP_MsgResize

Cogent API and Utilities: Version 4.1
Prev |  | Next

# `IP_MsgResize`

`IP_MsgResize` -- resizes the `IP_MsgBuffer`, if possible.

## Syntax

``int IP_MsgResize`(IP_Msg* message, int datalen);`

## Arguments

`message`

  A pointer to a message.

`datalen`

  The new length of the data portion of the `IP_MsgBuffer`, pointed to as `message->msg`.

## Returns

`0` on success, `-1` on failure and `errno` is set:

- ENOSYS - the message is either not resizable or not dynamic.

- ENOMEM - the memory reallocation returned `NULL`.

The `msg` portion of message is set to `NULL`.

## Description

This function assumes that the message encapsulates an `IP_MsgBuffer`, and resizes the data portion of that `IP_MsgBuffer` to `datalen` bytes through a call to `ME_Realloc`.

## See Also

Messages, `IP_MsgDefaultSize`

Prev | Home | Next
`IP_MsgRawData` | Up | `IP_NserveAdd`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.