1767006bb066ef500b90b432fba79d63d0d09b36Bryan Cantrill * This file and its contents are supplied under the terms of the
1767006bb066ef500b90b432fba79d63d0d09b36Bryan Cantrill * Common Development and Distribution License ("CDDL"), version 1.0.
1767006bb066ef500b90b432fba79d63d0d09b36Bryan Cantrill * You may only use this file in accordance with the terms of version
1767006bb066ef500b90b432fba79d63d0d09b36Bryan Cantrill * 1.0 of the CDDL.
1767006bb066ef500b90b432fba79d63d0d09b36Bryan Cantrill * A full copy of the text of the CDDL should have accompanied this
1767006bb066ef500b90b432fba79d63d0d09b36Bryan Cantrill * source. A copy of the CDDL is also available via the Internet at
1767006bb066ef500b90b432fba79d63d0d09b36Bryan Cantrill * Copyright (c) 2015, Joyent, Inc. All rights reserved.
1767006bb066ef500b90b432fba79d63d0d09b36Bryan Cantrill if (flags & ~(EFD_NONBLOCK | EFD_CLOEXEC | EFD_SEMAPHORE)) {
1767006bb066ef500b90b432fba79d63d0d09b36Bryan Cantrill if (write(fd, &val, sizeof (val)) < sizeof (val)) {
1767006bb066ef500b90b432fba79d63d0d09b36Bryan Cantrill return (read(fd, valp, sizeof (*valp)) < sizeof (*valp) ? -1 : 0);
1767006bb066ef500b90b432fba79d63d0d09b36Bryan Cantrill return (write(fd, &val, sizeof (val)) < sizeof (val) ? -1 : 0);