Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
3be57dc4
Commit
3be57dc4
authored
Jan 09, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fd_util: support eventfd()
parent
a93caf3c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
configure.ac
configure.ac
+1
-1
fd_util.c
src/fd_util.c
+14
-0
fd_util.h
src/fd_util.h
+11
-0
No files found.
configure.ac
View file @
3be57dc4
...
@@ -133,7 +133,7 @@ AC_SEARCH_LIBS([syslog], [bsd socket inet],
...
@@ -133,7 +133,7 @@ AC_SEARCH_LIBS([syslog], [bsd socket inet],
AC_SEARCH_LIBS([socket], [socket])
AC_SEARCH_LIBS([socket], [socket])
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_CHECK_FUNCS(pipe2 accept4)
AC_CHECK_FUNCS(pipe2 accept4
eventfd
)
AC_SEARCH_LIBS([exp], [m],,
AC_SEARCH_LIBS([exp], [m],,
[AC_MSG_ERROR([exp() not found])])
[AC_MSG_ERROR([exp() not found])])
...
...
src/fd_util.c
View file @
3be57dc4
...
@@ -49,6 +49,10 @@
...
@@ -49,6 +49,10 @@
#include <sys/inotify.h>
#include <sys/inotify.h>
#endif
#endif
#ifdef HAVE_EVENTFD
#include <sys/eventfd.h>
#endif
#ifndef WIN32
#ifndef WIN32
static
int
static
int
...
@@ -328,6 +332,16 @@ inotify_init_cloexec(void)
...
@@ -328,6 +332,16 @@ inotify_init_cloexec(void)
#endif
#endif
#ifdef HAVE_EVENTFD
int
eventfd_cloexec_nonblock
(
unsigned
initval
,
int
flags
)
{
return
eventfd
(
initval
,
flags
|
EFD_CLOEXEC
|
EFD_NONBLOCK
);
}
#endif
int
int
close_socket
(
int
fd
)
close_socket
(
int
fd
)
{
{
...
...
src/fd_util.h
View file @
3be57dc4
...
@@ -144,6 +144,17 @@ inotify_init_cloexec(void);
...
@@ -144,6 +144,17 @@ inotify_init_cloexec(void);
#endif
#endif
#ifdef HAVE_EVENTFD
/**
* Wrapper for eventfd() which sets the flags CLOEXEC and NONBLOCK
* flag (atomically if supported by the OS).
*/
int
eventfd_cloexec_nonblock
(
unsigned
initval
,
int
flags
);
#endif
/**
/**
* Portable wrapper for close(); use closesocket() on WIN32/WinSock.
* Portable wrapper for close(); use closesocket() on WIN32/WinSock.
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment