~ubuntu-branches/ubuntu/vivid/musl/vivid

« back to all changes in this revision

Viewing changes to src/linux/eventfd.c

  • Committer: Package Import Robot
  • Author(s): Kevin Bortis
  • Date: 2014-05-26 22:45:52 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20140526224552-qrtsct934q29xo0x
Tags: 1.1.4-1
* Import upstream version 1.1.4. (Closes: #754758)
* Fixes possible stack-based buffer overflow CVE-2014-3484 (Closes: #750815) 
* Includes fix for build regression on armhf and armel

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <sys/eventfd.h>
2
2
#include <unistd.h>
 
3
#include <errno.h>
3
4
#include "syscall.h"
4
5
 
5
6
int eventfd(unsigned int count, int flags)
6
7
{
7
 
        return syscall(flags ? SYS_eventfd2 : SYS_eventfd, count, flags);
 
8
        int r = __syscall(SYS_eventfd2, count, flags);
 
9
#ifdef SYS_eventfd
 
10
        if (r==-ENOSYS && !flags) r = __syscall(SYS_eventfd, count);
 
11
#endif
 
12
        return __syscall_ret(r);
8
13
}
9
14
 
10
15
int eventfd_read(int fd, eventfd_t *value)