epoll.h源码:

/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>.  */
#ifndef _SYS_EPOLL_H
#define _SYS_EPOLL_H    1
#include <stdint.h>
#include <sys/types.h>
/* Get __sigset_t.  */
#include <bits/sigset.h>
#ifndef __sigset_t_defined
# define __sigset_t_defined
typedef __sigset_t sigset_t;
#endif
/* Get the platform-dependent flags.  */
#include <bits/epoll.h>
#ifndef __EPOLL_PACKED
# define __EPOLL_PACKED
#endif
enum EPOLL_EVENTS
{
EPOLLIN = 0x001,
#define EPOLLIN EPOLLIN
EPOLLPRI = 0x002,
#define EPOLLPRI EPOLLPRI
EPOLLOUT = 0x004,
#define EPOLLOUT EPOLLOUT
EPOLLRDNORM = 0x040,
#define EPOLLRDNORM EPOLLRDNORM
EPOLLRDBAND = 0x080,
#define EPOLLRDBAND EPOLLRDBAND
EPOLLWRNORM = 0x100,
#define EPOLLWRNORM EPOLLWRNORM
EPOLLWRBAND = 0x200,
#define EPOLLWRBAND EPOLLWRBAND
EPOLLMSG = 0x400,
#define EPOLLMSG EPOLLMSG
EPOLLERR = 0x008,
#define EPOLLERR EPOLLERR
EPOLLHUP = 0x010,
#define EPOLLHUP EPOLLHUP
EPOLLRDHUP = 0x2000,
#define EPOLLRDHUP EPOLLRDHUP
EPOLLWAKEUP = 1u << 29,
#define EPOLLWAKEUP EPOLLWAKEUP
EPOLLONESHOT = 1u << 30,
#define EPOLLONESHOT EPOLLONESHOT
EPOLLET = 1u << 31
#define EPOLLET EPOLLET
};
/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl().  */
#define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface.  */
#define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface.  */
#define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure.  */
typedef union epoll_data
{
void *ptr;
int fd;
uint32_t u32;
uint64_t u64;
} epoll_data_t;
struct epoll_event
{
uint32_t events;    /* Epoll events */
epoll_data_t data;  /* User data variable */
} __EPOLL_PACKED;
__BEGIN_DECLS
/* Creates an epoll instance.  Returns an fd for the new instance.
The "size" parameter is a hint specifying the number of file
descriptors to be associated with the new instance.  The fd
returned by epoll_create() should be closed with close().  */
extern int epoll_create (int __size) __THROW;
/* Same as epoll_create but with an FLAGS parameter.  The unused SIZE
parameter has been dropped.  */
extern int epoll_create1 (int __flags) __THROW;
/* Manipulate an epoll instance "epfd". Returns 0 in case of success,
-1 in case of error ( the "errno" variable will contain the
specific error code ) The "op" parameter is one of the EPOLL_CTL_*
constants defined above. The "fd" parameter is the target of the
operation. The "event" parameter describes which events the caller
is interested in and any associated user data.  */
extern int epoll_ctl (int __epfd, int __op, int __fd,
struct epoll_event *__event) __THROW;
/* Wait for events on an epoll instance "epfd". Returns the number of
triggered events returned in "events" buffer. Or -1 in case of
error with the "errno" variable set to the specific error code. The
"events" parameter is a buffer that will contain triggered
events. The "maxevents" is the maximum number of events to be
returned ( usually size of "events" ). The "timeout" parameter
specifies the maximum wait time in milliseconds (-1 == infinite).
This function is a cancellation point and therefore not marked with
__THROW.  */
extern int epoll_wait (int __epfd, struct epoll_event *__events,
int __maxevents, int __timeout);
/* Same as epoll_wait, but the thread's signal mask is temporarily
and atomically replaced with the one provided as parameter.
This function is a cancellation point and therefore not marked with
__THROW.  */
extern int epoll_pwait (int __epfd, struct epoll_event *__events,
int __maxevents, int __timeout,
const __sigset_t *__ss);
__END_DECLS
#endif /* sys/epoll.h */

epoll.h 源码记录相关推荐

  1. 机械祭天法力无边:C++primer之书店程序包含Sales_item.h源码

    好吧,作为一个老菜鸟,还有第一章几道题实在写不下去了,直接写书店程序,这个书店程序只能满足2 2  2 3 3 这种连续的情况,无法满足2 3 2 3这种情况. 首先上Sales_item.h头文件源 ...

  2. 鸿蒙开发板HI3861 利用蜂鸣器播放音乐 open Harmony1.0.0(附cmsis_os2.h源码)

    本文利用鸿蒙开发板HI3861在鸿蒙1.0.0源码下利用蜂鸣器播放音乐. pwm_buz.c #include <stdio.h> #include "ohos_init.h&q ...

  3. Gem5模拟器,popnet模拟器源码记录(十五)

    在使用王小航老师课题组开源的Gem5代码进行大规模的Chiplet并行仿真时,有个关键问题是:为什么原来的gem5不可以进行大规模仿真?为什么精度不够?也是论文提出的背景: (20条消息) 傻白探索C ...

  4. p2p sdk接收文件服务端epoll模型源码

    #  KKP2P SDK介绍 kkp2p sdk是库快科技(kkuai.com)研发的支持p2p通信的中间件,是一套与业务无关的通用的p2p sdk库, 可以免费下载试用版本使用. 一句话概括其特点: ...

  5. 【GAT】图注意力网络 - 简单的源码记录

    由于和GCN代码比较相似,所以部分内容从GCN那篇博客中截取. 1 - cora数据集 GNN常用数据集之Cora数据集 2 - 源码含义记录 首先我们来整体看一下代码的组成 截图中的这一大坨为命令行 ...

  6. Cocos2dx源码记录(1) CCGLProgram

    前言: 这个系列是我自己在看cocos2dx源码时记录的一些比较重要的数据结构跟方法中间可能穿插些opengl的知识. 每个介绍的类之间没有固定引用顺序,仅作为个人的记录,可能会有点乱(其实主要是为了 ...

  7. 学习vue-router源码记录-1

    因为本人开发中使用的是VUE技术栈,最近也是开始源码的学习,以此记录个人理解,若行文有误,请多多指教. 1.new Router和install 在vue中我们使用vue-router时需要先进行ne ...

  8. Linux内核剖析-----IO复用函数epoll内核源码剖析

    本文参考董浩博客 http://donghao.org/uii/   epoll内核实现 (1)内核为epoll做准备工作 这个模块在内核初始化时(操作系统启动)注册了一个新的文件系统,叫" ...

  9. Ubuntu16.04编译android6.0.1源码记录

    目录 目录 一.安装环境 二.下载源码 1.下载repo 2.初始化repo 3.同步源代码 关于驱动 三.编译源码 四.导入源码到AS 五.刷入真机 六.修改源码 总结: 3.同步源代码 关于驱动 ...

最新文章

  1. 主机信息收集工具DMitry
  2. 往文件中写数据--增量
  3. ORACLE使用批量插入100万测试数据
  4. Linux服务器的优化
  5. 阿里巴巴举办全球数学竞赛 助力基础科学杰出人才培养
  6. 客户端考试之渐进增强与优雅降级
  7. css3实现进度条的模拟
  8. blogspot博客搬家
  9. 怎么在Vue中使用和安装axios
  10. 情人节快乐(转)十五首最美爱情古诗词,伴你过一个温馨浪漫的情人节
  11. 大数据可视化是什么意思?
  12. UTC时间与北京时间和纽约的时间
  13. idea报Establishing SSL connection without server‘s identity verification is not recommended.
  14. 爆笑宜昌方言版《大学自习室》说唱
  15. zabbix短信网关使用了中国网建SMS短信通
  16. 西安鹏程张建宁老师主讲网络安全
  17. 强化学习代码 (肖志清)部分
  18. 交通流优化的一种强化学习方法
  19. 动易如何预防ASP木马防止网页被黑
  20. 解决usb otg线系统重启的问题

热门文章

  1. 分享一个CSS3和jQuery实现的模糊显示效果 - 帮助你的访问用户更好的阅读内容
  2. python多项式回归_在python中实现多项式回归
  3. 5848. 树上的操作
  4. leetcode 328. 奇偶链表(双指针)
  5. 课程编码查询_付出还是不付出:生活中最好的事情(例如编码课程)是否免费?...
  6. 自我价值感缺失的表现_不同类型的缺失价值观和应对方法
  7. Mountain Number FZU-2109数位dp
  8. Java中ArrayList的使用
  9. python爬虫从入门到精通
  10. 博客园自动显示随笔标签