From 9fc6da20daeac3f06116630764c36fc4943b1f3a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 20 Feb 2014 00:30:18 -0800 Subject: Add eventfd_read() and eventfd_write() Signed-off-by: Khem Raj Signed-off-by: Bernhard Reutner-Fischer --- 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