Files
filex/common/src/fxe_file_read.c
T
Frédéric Desbiens 61b0b06c3e Updated copyright headers and removed revision history
* Updated version number constants

* Updated copyright headers and removed revision history
2026-03-05 08:39:33 +01:00

91 lines
4.4 KiB
C

/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2026-present Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** FileX Component */
/** */
/** File */
/** */
/**************************************************************************/
/**************************************************************************/
#define FX_SOURCE_CODE
/* Include necessary system files. */
#include "fx_api.h"
#include "fx_file.h"
FX_CALLER_CHECKING_EXTERNS
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _fxe_file_read PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function checks for errors in the read file call. */
/* */
/* INPUT */
/* */
/* file_ptr File control block pointer */
/* buffer_ptr Buffer pointer */
/* request_size Number of bytes requested */
/* actual_size Pointer to variable for the */
/* number of bytes read */
/* */
/* OUTPUT */
/* */
/* return status */
/* */
/* CALLS */
/* */
/* _fx_file_read Actual file read service */
/* */
/* CALLED BY */
/* */
/* Application Code */
/* */
/**************************************************************************/
UINT _fxe_file_read(FX_FILE *file_ptr, VOID *buffer_ptr, ULONG request_size, ULONG *actual_size)
{
UINT status;
/* Check for a null file or buffer pointer. */
if ((file_ptr == FX_NULL) || (buffer_ptr == FX_NULL) || (actual_size == FX_NULL))
{
return(FX_PTR_ERROR);
}
/* Check for a valid caller. */
FX_CALLER_CHECKING_CODE
/* Call actual file read service. */
status = _fx_file_read(file_ptr, buffer_ptr, request_size, actual_size);
/* Return status to the caller. */
return(status);
}