Sun Java System Messaging Server 6 2005Q4 MTA Developer's Reference

mtaBlockSize()

Obtain the size in bytes of an MTA block size unit.

Syntax

size_t mtaBlockSize(void);

Arguments

None

Description

The MTA measures message sizes in units of blocks. Units of blocks are used, for instance, when logging message sizes, and for the MTA_FRAGMENT_BLOCKS item code in the mtaEnqueueStart() routine. By default, a block is 1024 bytes. However, sites can change this setting with the BLOCK_SIZE option in the option.dat file.

Programs using the SDK can translate units of bytes to blocks by dividing the number of bytes by the value returned by mtaBlockSize(), that is:

bytes_per_block = mtaBlockSize();
block_limit = byte_limit / bytes_per_block;

Return Values

In the event of a failure, the routine returns the value zero and sets mta_errno with an error status code. This routine only fails when initialization of the MTA SDK fails. The following table lists the error status codes set in mta_errno when there is an error returned by mtaBlockSize().

Error Status Codes  

Description  

MTA_FOPEN

Unable to initialize the MTA SDK. Unable to read one or more configuration files. Issue the following command for further information: 

imsimta test -rewrite

MTA_NO

Unable to initialize the MTA SDK. Issue the following command for further information: 

imsimta test -rewrite

Example

The following code fragment displays the MTA block size setting:


printf ("BLOCK_SIZE = %u\n", mtaBlockSize());