# MB_GetSegmentLength

## C Specification

      #include <nitro/mb.h>

      u32 MB_GetSegmentLength( FSFile *file );

## Description

This function returns the memory size necessary to register the specified program file to the multi-boot process. For more information, see the `MB_ReadSegment` function.

Internally, this function calls the `FS_ReadFile` function.

## Arguments

`file` | The `FSFile` structure that holds the program file handle. The seek position of this file must point to the top of the program binary. Also, the seek position holds the initial position when returned from this function. When NULL is specified for this pointer, the parent application itself is taken as the download program file and the size is calculated.

## Return Values

This function returns a byte size greater than 0 when the program completes successfully. Otherwise, it returns 0.

## See Also

`MB_SEGMENT_BUFFER_MIN, MB_ReadSegment, MB_RegisterFile`

## Revision History

11/11/2004 Changed description to include the clone boot release and new read delay method.
09/10/2004 Added description of the operation when specifying NULL for the file pointer.
08/09/2004 Initial version.