1a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand/* 2a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * Copyright (C) 2013 The Android Open Source Project 3a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * All rights reserved. 4a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * 5a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * Redistribution and use in source and binary forms, with or without 6a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * modification, are permitted provided that the following conditions 7a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * are met: 8a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * * Redistributions of source code must retain the above copyright 9a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * notice, this list of conditions and the following disclaimer. 10a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * * Redistributions in binary form must reproduce the above copyright 11a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * notice, this list of conditions and the following disclaimer in 12a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * the documentation and/or other materials provided with the 13a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * distribution. 14a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * 15a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 22a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 25a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand * SUCH DAMAGE. 27a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand */ 28a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand 29a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand#include <sys/signalfd.h> 30a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand 311f5af926fa626734981d6b4dcc0ab54e520032a9Elliott Hughes#include "private/kernel_sigset_t.h" 32a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand 337222b1b594a8fab4b9e744d764b70e4c17767794Elliott Hughesextern "C" int __signalfd4(int fd, kernel_sigset_t* mask, size_t sizemask, int flags); 34a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand 35c5d028fc913de84a781bd61084bf7ae2182fd48eElliott Hughesint signalfd(int fd, const sigset_t* mask, int flags) { 36c5d028fc913de84a781bd61084bf7ae2182fd48eElliott Hughes kernel_sigset_t in_set(mask); 377222b1b594a8fab4b9e744d764b70e4c17767794Elliott Hughes return __signalfd4(fd, &in_set, sizeof(in_set), flags); 38a4b2dc016fa62bd172a73c3f8971c805700ffb0fRom Lemarchand} 39