1387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes/* 2387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * Copyright (C) 2010 The Android Open Source Project 3387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * All rights reserved. 4387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * 5387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * Redistribution and use in source and binary forms, with or without 6387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * modification, are permitted provided that the following conditions 7387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * are met: 8387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * * Redistributions of source code must retain the above copyright 9387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * notice, this list of conditions and the following disclaimer. 10387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * * Redistributions in binary form must reproduce the above copyright 11387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * notice, this list of conditions and the following disclaimer in 12387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * the documentation and/or other materials provided with the 13387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * distribution. 14387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * 15387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 22387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 25387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes * SUCH DAMAGE. 27387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes */ 28387d4b7de9af2afd0c37a895ff9d012eb1f66156Elliott Hughes 29defd162212de3789d2268a1f3339c2a6097fa825David 'Digit' Turner#include <sys/eventfd.h> 30defd162212de3789d2268a1f3339c2a6097fa825David 'Digit' Turner#include <unistd.h> 31defd162212de3789d2268a1f3339c2a6097fa825David 'Digit' Turner 329b84824dfd597d8137137fa33295faa26cc70ae0Kito Chengint eventfd_write(int fd, eventfd_t value) { 339b84824dfd597d8137137fa33295faa26cc70ae0Kito Cheng return (write(fd, &value, sizeof(value)) == sizeof(value)) ? 0 : -1; 34defd162212de3789d2268a1f3339c2a6097fa825David 'Digit' Turner} 35