GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: fx_file_seek.c Lines: 2 2 100.0 %
Date: 2026-03-06 18:49:02 Branches: 0 0 - %

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_seek                                       PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    William E. Lamie, Microsoft Corporation                             */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function positions the internal file pointers to the specified */
45
/*    byte offset such that the next read or write operation will be      */
46
/*    performed there.  If the byte offset is greater than the size, the  */
47
/*    file pointers will be positioned to the end of the file.            */
48
/*                                                                        */
49
/*  INPUT                                                                 */
50
/*                                                                        */
51
/*    file_ptr                              File control block pointer    */
52
/*    byte_offset                           Byte offset into the file     */
53
/*                                                                        */
54
/*  OUTPUT                                                                */
55
/*                                                                        */
56
/*    return status                                                       */
57
/*                                                                        */
58
/*  CALLS                                                                 */
59
/*                                                                        */
60
/*    _fx_file_extended_seek                Seek to specified position    */
61
/*                                                                        */
62
/*  CALLED BY                                                             */
63
/*                                                                        */
64
/*    Application Code                                                    */
65
/*                                                                        */
66
/**************************************************************************/
67
#ifndef FX_DISABLE_ONE_LINE_FUNCTION
68
65
UINT  _fx_file_seek(FX_FILE *file_ptr, ULONG byte_offset)
69
{
70
71
65
    return(_fx_file_extended_seek(file_ptr, (ULONG64) byte_offset));
72
}
73
#endif /* FX_DISABLE_ONE_LINE_FUNCTION */