日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

epoll.h 源码记录

發布時間:2023/12/9 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 epoll.h 源码记录 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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/ormodify it under the terms of the GNU Lesser General PublicLicense as published by the Free Software Foundation; eitherversion 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 ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNULesser General Public License for more details.You should have received a copy of the GNU Lesser General PublicLicense 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 #endifenum EPOLL_EVENTS{EPOLLIN = 0x001, #define EPOLLIN EPOLLINEPOLLPRI = 0x002, #define EPOLLPRI EPOLLPRIEPOLLOUT = 0x004, #define EPOLLOUT EPOLLOUTEPOLLRDNORM = 0x040, #define EPOLLRDNORM EPOLLRDNORMEPOLLRDBAND = 0x080, #define EPOLLRDBAND EPOLLRDBANDEPOLLWRNORM = 0x100, #define EPOLLWRNORM EPOLLWRNORMEPOLLWRBAND = 0x200, #define EPOLLWRBAND EPOLLWRBANDEPOLLMSG = 0x400, #define EPOLLMSG EPOLLMSGEPOLLERR = 0x008, #define EPOLLERR EPOLLERREPOLLHUP = 0x010, #define EPOLLHUP EPOLLHUPEPOLLRDHUP = 0x2000, #define EPOLLRDHUP EPOLLRDHUPEPOLLWAKEUP = 1u << 29, #define EPOLLWAKEUP EPOLLWAKEUPEPOLLONESHOT = 1u << 30, #define EPOLLONESHOT EPOLLONESHOTEPOLLET = 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 filedescriptors to be associated with the new instance. The fdreturned 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 SIZEparameter 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 thespecific error code ) The "op" parameter is one of the EPOLL_CTL_*constants defined above. The "fd" parameter is the target of theoperation. The "event" parameter describes which events the calleris 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 oftriggered events returned in "events" buffer. Or -1 in case oferror with the "errno" variable set to the specific error code. The"events" parameter is a buffer that will contain triggeredevents. The "maxevents" is the maximum number of events to bereturned ( usually size of "events" ). The "timeout" parameterspecifies 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 temporarilyand 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 源码记录的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。