include/linux/eventpoll.h
Source file repositories/reference/linux-study-clean/include/linux/eventpoll.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/eventpoll.h- Extension
.h- Size
- 3070 bytes
- Lines
- 109
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
uapi/linux/eventpoll.huapi/linux/kcmp.h
Detected Declarations
struct filestruct epoll_keyfunction eventpoll_releasefunction ep_op_has_eventfunction eventpoll_releasefunction epoll_put_uevent
Annotated Snippet
struct epoll_key {
struct file *file;
int fd;
} __packed;
int do_epoll_ctl_file(struct file *f, int op, struct epoll_key *tf,
struct epoll_event *epds, bool nonblock);
int do_epoll_ctl(int epfd, int op, int fd, struct epoll_event *epds,
bool nonblock);
bool is_file_epoll(struct file *f);
/* Tells if the epoll_ctl(2) operation needs an event copy from userspace */
static inline int ep_op_has_event(int op)
{
return op != EPOLL_CTL_DEL;
}
#else
static inline void eventpoll_release(struct file *file) {}
#endif
#if defined(CONFIG_ARM) && defined(CONFIG_OABI_COMPAT)
/* ARM OABI has an incompatible struct layout and needs a special handler */
extern struct epoll_event __user *
epoll_put_uevent(__poll_t revents, __u64 data,
struct epoll_event __user *uevent);
#else
static inline struct epoll_event __user *
epoll_put_uevent(__poll_t revents, __u64 data,
struct epoll_event __user *uevent)
{
scoped_user_write_access_size(uevent, sizeof(*uevent), efault) {
unsafe_put_user(revents, &uevent->events, efault);
unsafe_put_user(data, &uevent->data, efault);
}
return uevent+1;
efault:
return NULL;
}
#endif
#endif /* #ifndef _LINUX_EVENTPOLL_H */
Annotation
- Immediate include surface: `uapi/linux/eventpoll.h`, `uapi/linux/kcmp.h`.
- Detected declarations: `struct file`, `struct epoll_key`, `function eventpoll_release`, `function ep_op_has_event`, `function eventpoll_release`, `function epoll_put_uevent`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.