#include
#include
#include
Int main (void)
{
Int epfd, NFDS;
Epfd=epoll_create (1);
Ev. Data. Fd=STDIN_FILENO;
Ev. Events=EPOLLIN | EPOLLET;
Epoll_ctl (epfd, EPOLL_CTL_ADD, STDIN_FILENO, & amp; Ev);
For (;; )
{
NFDS=epoll_wait (epfd, events, 5, 1);
for(int i=0; i{
If (events [I]. Data. Fd==STDIN_FILENO)
Printf (" welcome to epoll 's word! \n");
}
}
}
Then I use the cat - v,
Int main (void) $
{$
Int epfd, NFDS; $
^ Istruct epoll_event ev, events [5]. $
M -! M -! M -! M -! Epfd=epoll_create (1); $
M -! M -! M -! M -! Ev. Data. Fd=STDIN_FILENO; $
M -! M -! M -! M -! Ev. Events=EPOLLIN | EPOLLET; $
M -! M -! M -! M -! Epoll_ctl (epfd, EPOLL_CTL_ADD, STDIN_FILENO, & amp; Ev); $
M -! M -! M -! M -! For (;; ) $
M -! M -! M -! M -! {$
M -! M -! M -! M -! M -! M -! M -! M -! NFDS=epoll_wait (epfd, events, 5, 1); $
M -! M -! M -! M -! M -! M -! M -! M -! for(int i=0; i
M -! M -! M -! M -! M -! M -! M -! M -! M -! M -! M -! M -! If (events [I]. Data. Fd==STDIN_FILENO) $
M -! M -! M -! M -! M -! M -! M -! M -! M -! M -! M -! M -! M -! M -! M -! M -! Printf (" welcome to epoll 's word! \n"); $
$
M -! M -! M -! M -! M -! M -! M -! M -! } $
M -! M -! M -! M -! } $
} $
Ask what is this situation should not be ^ M
CodePudding user response:
^ M is a newline, what's the problem?CodePudding user response: