#include <sys/syscall.h>
#include <stdio.h>
#include <sys/epoll.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main()
{
    int res=epoll_create(300);
    int file=open("test.tag", O_CREAT|O_RDWR, 0664);
    struct epoll_event event;
    event.events=EPOLLIN|EPOLLERR|EPOLLHUP;
    event.data.fd=file;
    
    if( res<0 ) {
        perror("Sorry");
        exit(1);
    }

    printf("res=%d, file=%d\n", res, file );
    if( epoll_ctl(res, EPOLL_CTL_ADD, file, &event)!=0 ) {
        perror("add");
        exit(1);
    }

    if( epoll_ctl( res, EPOLL_CTL_DEL, file, &event)!=0 ) {
        perror("del");
        exit(1);
    }

    return 0;
}

