1e6590bdcSVuong Nguyen /* 2e6590bdcSVuong Nguyen * CDDL HEADER START 3e6590bdcSVuong Nguyen * 4e6590bdcSVuong Nguyen * The contents of this file are subject to the terms of the 5e6590bdcSVuong Nguyen * Common Development and Distribution License (the "License"). 6e6590bdcSVuong Nguyen * You may not use this file except in compliance with the License. 7e6590bdcSVuong Nguyen * 8e6590bdcSVuong Nguyen * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9e6590bdcSVuong Nguyen * or http://www.opensolaris.org/os/licensing. 10e6590bdcSVuong Nguyen * See the License for the specific language governing permissions 11e6590bdcSVuong Nguyen * and limitations under the License. 12e6590bdcSVuong Nguyen * 13e6590bdcSVuong Nguyen * When distributing Covered Code, include this CDDL HEADER in each 14e6590bdcSVuong Nguyen * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15e6590bdcSVuong Nguyen * If applicable, add the following below this CDDL HEADER, with the 16e6590bdcSVuong Nguyen * fields enclosed by brackets "[]" replaced with your own identifying 17e6590bdcSVuong Nguyen * information: Portions Copyright [yyyy] [name of copyright owner] 18e6590bdcSVuong Nguyen * 19e6590bdcSVuong Nguyen * CDDL HEADER END 20e6590bdcSVuong Nguyen */ 21e6590bdcSVuong Nguyen /* 22f044df33SVuong Nguyen * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 23e6590bdcSVuong Nguyen */ 24e6590bdcSVuong Nguyen 25e6590bdcSVuong Nguyen /* 26e6590bdcSVuong Nguyen * ldom_utils.c 27e6590bdcSVuong Nguyen * 28e6590bdcSVuong Nguyen * Common functions within the library 29e6590bdcSVuong Nguyen * 30e6590bdcSVuong Nguyen */ 31e6590bdcSVuong Nguyen 32e6590bdcSVuong Nguyen #include <stdio.h> 33f044df33SVuong Nguyen #include <sys/types.h> 34f044df33SVuong Nguyen #include <unistd.h> 35f044df33SVuong Nguyen #include <fcntl.h> 36e6590bdcSVuong Nguyen 37f044df33SVuong Nguyen boolean_t 38f044df33SVuong Nguyen notify_setup(int *notify_pipe) 39e6590bdcSVuong Nguyen { 40f044df33SVuong Nguyen if (pipe(notify_pipe) < 0) { 41f044df33SVuong Nguyen return (B_FALSE); 42f044df33SVuong Nguyen } else { 43*f4377aa6SVuong Nguyen (void) fcntl(notify_pipe[1], F_SETFL, O_NONBLOCK); 44e6590bdcSVuong Nguyen } 45f044df33SVuong Nguyen return (B_TRUE); 46e6590bdcSVuong Nguyen } 47