GCC Code Coverage Report


Directory: common/src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 2 / 0 / 2
Functions: 100.0% 1 / 0 / 1
Branches: -% 0 / 0 / 0

fx_file_truncate_release.c
Line Branch Exec Source
1 /***************************************************************************
2 * Copyright (c) 2024 Microsoft Corporation
3 * Copyright (c) 2026-present Eclipse ThreadX contributors
4 *
5 * This program and the accompanying materials are made available under the
6 * terms of the MIT License which is available at
7 * https://opensource.org/licenses/MIT.
8 *
9 * SPDX-License-Identifier: MIT
10 **************************************************************************/
11
12
13 /**************************************************************************/
14 /**************************************************************************/
15 /** */
16 /** FileX Component */
17 /** */
18 /** File */
19 /** */
20 /**************************************************************************/
21 /**************************************************************************/
22
23 #define FX_SOURCE_CODE
24
25
26 /* Include necessary system files. */
27
28 #include "fx_api.h"
29 #include "fx_file.h"
30
31
32 /**************************************************************************/
33 /* */
34 /* FUNCTION RELEASE */
35 /* */
36 /* _fx_file_truncate_release PORTABLE C */
37 /* 6.1 */
38 /* AUTHOR */
39 /* */
40 /* William E. Lamie, Microsoft Corporation */
41 /* */
42 /* DESCRIPTION */
43 /* */
44 /* This function sets the file to the specified size, if smaller than */
45 /* the current file size. If the new file size is less than the */
46 /* current file read/write position, the internal file pointers will */
47 /* also be modified. Any unused clusters are released back to the */
48 /* media. */
49 /* */
50 /* INPUT */
51 /* */
52 /* file_ptr File control block pointer */
53 /* size New size of the file in bytes */
54 /* */
55 /* OUTPUT */
56 /* */
57 /* return status */
58 /* */
59 /* CALLS */
60 /* */
61 /* _fx_file_extended_truncate_release Truncate the file size and */
62 /* released unused clusters */
63 /* */
64 /* CALLED BY */
65 /* */
66 /* Application Code */
67 /* */
68 /**************************************************************************/
69 #ifndef FX_DISABLE_ONE_LINE_FUNCTION
70 3400641 UINT _fx_file_truncate_release(FX_FILE *file_ptr, ULONG size)
71 {
72
73 3400641 return(_fx_file_extended_truncate_release(file_ptr, (ULONG64)size));
74 }
75 #endif /* FX_DISABLE_ONE_LINE_FUNCTION */
76
77