aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/util.h')
-rw-r--r--ipc/util.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/ipc/util.h b/ipc/util.h
index 0181553d31d8..c8fd6b9d77b5 100644
--- a/ipc/util.h
+++ b/ipc/util.h
@@ -3,6 +3,8 @@
3 * Copyright (C) 1999 Christoph Rohland 3 * Copyright (C) 1999 Christoph Rohland
4 * 4 *
5 * ipc helper functions (c) 1999 Manfred Spraul <manfred@colorfullife.com> 5 * ipc helper functions (c) 1999 Manfred Spraul <manfred@colorfullife.com>
6 * namespaces support. 2006 OpenVZ, SWsoft Inc.
7 * Pavel Emelianov <xemul@openvz.org>
6 */ 8 */
7 9
8#ifndef _IPC_UTIL_H 10#ifndef _IPC_UTIL_H
@@ -15,6 +17,14 @@ void sem_init (void);
15void msg_init (void); 17void msg_init (void);
16void shm_init (void); 18void shm_init (void);
17 19
20int sem_init_ns(struct ipc_namespace *ns);
21int msg_init_ns(struct ipc_namespace *ns);
22int shm_init_ns(struct ipc_namespace *ns);
23
24void sem_exit_ns(struct ipc_namespace *ns);
25void msg_exit_ns(struct ipc_namespace *ns);
26void shm_exit_ns(struct ipc_namespace *ns);
27
18struct ipc_id_ary { 28struct ipc_id_ary {
19 int size; 29 int size;
20 struct kern_ipc_perm *p[0]; 30 struct kern_ipc_perm *p[0];
@@ -31,15 +41,23 @@ struct ipc_ids {
31}; 41};
32 42
33struct seq_file; 43struct seq_file;
34void __init ipc_init_ids(struct ipc_ids* ids, int size); 44#ifdef CONFIG_IPC_NS
45#define __ipc_init
46#else
47#define __ipc_init __init
48#endif
49void __ipc_init ipc_init_ids(struct ipc_ids *ids, int size);
35#ifdef CONFIG_PROC_FS 50#ifdef CONFIG_PROC_FS
36void __init ipc_init_proc_interface(const char *path, const char *header, 51void __init ipc_init_proc_interface(const char *path, const char *header,
37 struct ipc_ids *ids, 52 int ids, int (*show)(struct seq_file *, void *));
38 int (*show)(struct seq_file *, void *));
39#else 53#else
40#define ipc_init_proc_interface(path, header, ids, show) do {} while (0) 54#define ipc_init_proc_interface(path, header, ids, show) do {} while (0)
41#endif 55#endif
42 56
57#define IPC_SEM_IDS 0
58#define IPC_MSG_IDS 1
59#define IPC_SHM_IDS 2
60
43/* must be called with ids->mutex acquired.*/ 61/* must be called with ids->mutex acquired.*/
44int ipc_findkey(struct ipc_ids* ids, key_t key); 62int ipc_findkey(struct ipc_ids* ids, key_t key);
45int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size); 63int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size);