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.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 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. */
48 /* */
49 /* INPUT */
50 /* */
51 /* file_ptr File control block pointer */
52 /* size New size of the file in bytes */
53 /* */
54 /* OUTPUT */
55 /* */
56 /* return status */
57 /* */
58 /* CALLS */
59 /* */
60 /* _fx_file_extended_truncate Truncate the file size */
61 /* */
62 /* CALLED BY */
63 /* */
64 /* Application Code */
65 /* */
66 /**************************************************************************/
67 #ifndef FX_DISABLE_ONE_LINE_FUNCTION
68 30 UINT _fx_file_truncate(FX_FILE *file_ptr, ULONG size)
69 {
70
71 30 return(_fx_file_extended_truncate(file_ptr, (ULONG64)size));
72 }
73 #endif /* FX_DISABLE_ONE_LINE_FUNCTION */
74