Merge tag 'perf-tools-fixes-for-v6.9-2024-04-19' of git://git.kernel.org/pub/scm...
[linux-2.6-block.git] / include / linux / shm.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
1da177e4
LT
2#ifndef _LINUX_SHM_H_
3#define _LINUX_SHM_H_
4
bc46ef3c 5#include <linux/types.h>
1da177e4 6#include <asm/page.h>
1da177e4 7#include <asm/shmparam.h>
060028ba 8
8ecd2953 9struct file;
bc46ef3c 10struct task_struct;
8ecd2953 11
1da177e4 12#ifdef CONFIG_SYSVIPC
ab602f79
JM
13struct sysv_shm {
14 struct list_head shm_clist;
15};
16
079a96ae
WD
17long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr,
18 unsigned long shmlba);
2954e440 19bool is_file_shm_hugepages(struct file *file);
ab602f79
JM
20void exit_shm(struct task_struct *task);
21#define shm_init_task(task) INIT_LIST_HEAD(&(task)->sysvshm.shm_clist)
1da177e4 22#else
ab602f79
JM
23struct sysv_shm {
24 /* empty */
25};
26
1da177e4 27static inline long do_shmat(int shmid, char __user *shmaddr,
079a96ae
WD
28 int shmflg, unsigned long *addr,
29 unsigned long shmlba)
1da177e4
LT
30{
31 return -ENOSYS;
32}
2954e440 33static inline bool is_file_shm_hugepages(struct file *file)
516dffdc 34{
2954e440 35 return false;
516dffdc 36}
b34a6b1d
VK
37static inline void exit_shm(struct task_struct *task)
38{
39}
ab602f79
JM
40static inline void shm_init_task(struct task_struct *task)
41{
42}
1da177e4
LT
43#endif
44
1da177e4 45#endif /* _LINUX_SHM_H_ */