1/*****************************************************************************
2
3Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
4Copyright (c) 2017, MariaDB Corporation.
5
6This program is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free Software
8Foundation; version 2 of the License.
9
10This program is distributed in the hope that it will be useful, but WITHOUT
11ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License along with
15this program; if not, write to the Free Software Foundation, Inc.,
1651 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
17
18*****************************************************************************/
19
20/**************************************************//**
21@file include/os0proc.h
22The interface to the operating system
23process control primitives
24
25Created 9/30/1995 Heikki Tuuri
26*******************************************************/
27
28#ifndef os0proc_h
29#define os0proc_h
30
31#include "univ.i"
32
33#ifdef UNIV_LINUX
34#include <sys/ipc.h>
35#include <sys/shm.h>
36#endif
37
38typedef void* os_process_t;
39typedef unsigned long int os_process_id_t;
40
41/** The total amount of memory currently allocated from the operating
42system with os_mem_alloc_large(). */
43extern ulint os_total_large_mem_allocated;
44
45/** Whether to use large pages in the buffer pool */
46extern my_bool os_use_large_pages;
47
48/** Large page size. This may be a boot-time option on some platforms */
49extern uint os_large_page_size;
50
51/** Converts the current process id to a number.
52@return process id as a number */
53ulint
54os_proc_get_number(void);
55
56/** Allocates large pages memory.
57@param[in,out] n Number of bytes to allocate
58@return allocated memory */
59void*
60os_mem_alloc_large(
61 ulint* n);
62
63/** Frees large pages memory.
64@param[in] ptr pointer returned by os_mem_alloc_large()
65@param[in] size size returned by os_mem_alloc_large() */
66void
67os_mem_free_large(
68 void *ptr,
69 ulint size);
70
71#endif
72