[rfc] epoll final ( hopefully ) interface ...

From: Davide Libenzi (davidel@xmailserver.org)
Date: Wed Nov 20 2002 - 00:46:18 EST


This is how it looks my current interface file for epoll. Jamie suggestion
to remove the "fd" member from the "struct epoll_event" structure was a
good one and actually saved 25% of space, that matters with high event
transfer rates.

#ifndef _SYS_EPOLL_H
#define _SYS_EPOLL_H 1

#include <features.h>
#include <sys/types.h>
#include <sys/poll.h>

#define EPOLLIN POLLIN
#define EPOLLPRI POLLPRI
#define EPOLLOUT POLLOUT

#ifdef __USE_XOPEN
# define EPOLLRDNORM POLLRDNORM
# define EPOLLRDBAND POLLRDBAND
# define EPOLLWRNORM POLLWRNORM
# define EPOLLWRBAND POLLWRBAND
#endif

#ifdef __USE_GNU
# define EPOLLMSG POLLMSG
#endif

#define EPOLLERR POLLERR
#define EPOLLHUP POLLHUP

/* Valid opcodes to issue to epoll_ctl() */
#define EPOLL_CTL_ADD 1
#define EPOLL_CTL_DEL 2
#define EPOLL_CTL_MOD 3

struct epoll_event {
        unsigned short events;
        unsigned short revents;
        __uint64_t obj;
};

__BEGIN_DECLS

int epoll_create(int size);
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) __THROW;
int epoll_wait(int epfd, struct epoll_event *events, int maxevents,
               int timeout) __THROW;

__END_DECLS

#endif /* #ifndef _SYS_EPOLL_H */

I also include the man pages that I edited to reflect the new interface.
Almost certainly they'll contain errors and reference to the old interface
API. I'd very much appreciate if someone that suck less then me in either
English and man page creation, will try to make them in better shape. Pls,
in the rare event that more than one would like to take the job, try to
keep you in sync avoiding work duplication. The major work IMHO should be
done on epoll.2

- Davide









-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Nov 23 2002 - 22:00:30 EST