Skip to content

Commit

Permalink
Split architecture-specific parts of sys/epoll.h into bits/epoll.h.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Myers committed Feb 21, 2012
1 parent 0e49975 commit 599af3c
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 297 deletions.
16 changes: 16 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2012-02-20 Joseph Myers <joseph@codesourcery.com>

* sysdeps/unix/sysv/linux/bits/epoll.h: New file.
* sysdeps/unix/sysv/linux/sparc/bits/epoll.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/epoll.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sys/epoll.h: Remove
* sysdeps/unix/sysv/linux/x86_64/sys/epoll.h: Likewise.
* sysdeps/unix/sysv/linux/sys/epoll.h: Get flags from
<bits/epoll.h>.
(EPOLL_CLOEXEC, EPOLL_NONBLOCK): Don't define here.
(__EPOLL_PACKED): Define to empty if not defined by
<bits/epoll.h>.
(struct epoll_event): Use __EPOLL_PACKED to make possibly packed.
* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
bits/epoll.h.

2012-02-20 Joseph Myers <joseph@codesourcery.com>

* sysdeps/unix/sysv/linux/bits/timerfd.h: New file.
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/unix/sysv/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
sys/ultrasound.h sys/raw.h sys/personality.h sys/epoll.h \
bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \
sys/timerfd.h sys/fanotify.h bits/eventfd.h bits/inotify.h \
bits/signalfd.h bits/timerfd.h
bits/signalfd.h bits/timerfd.h bits/epoll.h

install-others += $(inst_includedir)/bits/syscall.h

Expand Down
29 changes: 29 additions & 0 deletions sysdeps/unix/sysv/linux/bits/epoll.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* Copyright (C) 2002-2012 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
# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
#endif

/* Flags to be passed to epoll_create1. */
enum
{
EPOLL_CLOEXEC = 02000000,
#define EPOLL_CLOEXEC EPOLL_CLOEXEC
EPOLL_NONBLOCK = 00004000
#define EPOLL_NONBLOCK EPOLL_NONBLOCK
};
29 changes: 29 additions & 0 deletions sysdeps/unix/sysv/linux/sparc/bits/epoll.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* Copyright (C) 2002-2012 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
# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
#endif

/* Flags to be passed to epoll_create1. */
enum
{
EPOLL_CLOEXEC = 0x400000,
#define EPOLL_CLOEXEC EPOLL_CLOEXEC
EPOLL_NONBLOCK = 0x004000
#define EPOLL_NONBLOCK EPOLL_NONBLOCK
};
143 changes: 0 additions & 143 deletions sysdeps/unix/sysv/linux/sparc/sys/epoll.h

This file was deleted.

17 changes: 7 additions & 10 deletions sysdeps/unix/sysv/linux/sys/epoll.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2002-2009, 2011 Free Software Foundation, Inc.
/* Copyright (C) 2002-2012 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
Expand Down Expand Up @@ -29,15 +29,12 @@
typedef __sigset_t sigset_t;
#endif

/* Get the platform-dependent flags. */
#include <bits/epoll.h>

/* Flags to be passed to epoll_create1. */
enum
{
EPOLL_CLOEXEC = 02000000,
#define EPOLL_CLOEXEC EPOLL_CLOEXEC
EPOLL_NONBLOCK = 04000
#define EPOLL_NONBLOCK EPOLL_NONBLOCK
};
#ifndef __EPOLL_PACKED
# define __EPOLL_PACKED
#endif


enum EPOLL_EVENTS
Expand Down Expand Up @@ -89,7 +86,7 @@ struct epoll_event
{
uint32_t events; /* Epoll events */
epoll_data_t data; /* User data variable */
};
} __EPOLL_PACKED;


__BEGIN_DECLS
Expand Down
31 changes: 31 additions & 0 deletions sysdeps/unix/sysv/linux/x86_64/bits/epoll.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* Copyright (C) 2002-2012 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
# error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
#endif

/* Flags to be passed to epoll_create1. */
enum
{
EPOLL_CLOEXEC = 02000000,
#define EPOLL_CLOEXEC EPOLL_CLOEXEC
EPOLL_NONBLOCK = 00004000
#define EPOLL_NONBLOCK EPOLL_NONBLOCK
};

#define __EPOLL_PACKED __attribute__ ((__packed__))
Loading

0 comments on commit 599af3c

Please sign in to comment.