From 628943bcfde03547b9f83d04578bd1e8aa5d23fc Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 5 Jul 2014 18:09:19 +0200 Subject: Add eventfd_read() and eventfd_write() Signed-off-by: Khem Raj --- libc/sysdeps/linux/common/eventfd_read.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 libc/sysdeps/linux/common/eventfd_read.c (limited to 'libc/sysdeps/linux/common/eventfd_read.c') diff --git a/libc/sysdeps/linux/common/eventfd_read.c b/libc/sysdeps/linux/common/eventfd_read.c new file mode 100644 index 000000000..75f2aaa11 --- /dev/null +++ b/libc/sysdeps/linux/common/eventfd_read.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2007-2014 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 + . */ + +#include +#include +#include + + +int +eventfd_read (int fd, eventfd_t *value) +{ + return read (fd, value, sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0; +} -- cgit v1.2.3