1 /*****************************************************************************
2 
3 Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License, version 2.0,
7 as published by the Free Software Foundation.
8 
9 This program is also distributed with certain software (including
10 but not limited to OpenSSL) that is licensed under separate terms,
11 as designated in a particular file or component or in included license
12 documentation.  The authors of MySQL hereby grant you an additional
13 permission to link the program and your derivative works with the
14 separately licensed software that they have included with MySQL.
15 
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 GNU General Public License, version 2.0, for more details.
20 
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
24 
25 *****************************************************************************/
26 
27 /**************************************************//**
28 @file include/os0proc.h
29 The interface to the operating system
30 process control primitives
31 
32 Created 9/30/1995 Heikki Tuuri
33 *******************************************************/
34 
35 #ifndef os0proc_h
36 #define os0proc_h
37 
38 #include "univ.i"
39 
40 #ifdef UNIV_LINUX
41 #include <sys/ipc.h>
42 #include <sys/shm.h>
43 #endif
44 
45 typedef void*			os_process_t;
46 typedef unsigned long int	os_process_id_t;
47 
48 extern ibool os_use_large_pages;
49 /* Large page size. This may be a boot-time option on some platforms */
50 extern ulint os_large_page_size;
51 
52 /****************************************************************//**
53 Converts the current process id to a number. It is not guaranteed that the
54 number is unique. In Linux returns the 'process number' of the current
55 thread. That number is the same as one sees in 'top', for example. In Linux
56 the thread id is not the same as one sees in 'top'.
57 @return	process id as a number */
58 UNIV_INTERN
59 ulint
60 os_proc_get_number(void);
61 /*====================*/
62 /****************************************************************//**
63 Allocates large pages memory.
64 @return	allocated memory */
65 UNIV_INTERN
66 void*
67 os_mem_alloc_large(
68 /*===============*/
69 	ulint*	n);			/*!< in/out: number of bytes */
70 /****************************************************************//**
71 Frees large pages memory. */
72 UNIV_INTERN
73 void
74 os_mem_free_large(
75 /*==============*/
76 	void	*ptr,			/*!< in: pointer returned by
77 					os_mem_alloc_large() */
78 	ulint	size);			/*!< in: size returned by
79 					os_mem_alloc_large() */
80 
81 #ifndef UNIV_NONINL
82 #include "os0proc.ic"
83 #endif
84 
85 #endif
86