summaryrefslogtreecommitdiff
path: root/test/regression/interoperability_test/test_frame/tls_test_instance_destroy.c
blob: 807d5b8dd2d337c27b8707d4a4bec19e35234737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation                                */
/* Copyright (c) 2026 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                                            */
/***************************************************************************/

#include "tls_test_frame.h"

/* Destroy test instance. */
INT tls_test_instance_destroy( TLS_TEST_INSTANCE* instance_ptr)
{
    return_value_if_fail( NULL != instance_ptr, TLS_TEST_INVALID_POINTER);

    /* Release the shared memory occupied by the test intance. */
    INT status = munmap( instance_ptr, instance_ptr -> tls_test_shared_buffer_size + sizeof(TLS_TEST_INSTANCE));
    return_value_if_fail( TLS_TEST_SUCCESS == status, TLS_TEST_SYSTEM_CALL_FAILED);
    return TLS_TEST_SUCCESS;
}