111831SVuong.Nguyen@Sun.COM /* 211831SVuong.Nguyen@Sun.COM * CDDL HEADER START 311831SVuong.Nguyen@Sun.COM * 411831SVuong.Nguyen@Sun.COM * The contents of this file are subject to the terms of the 511831SVuong.Nguyen@Sun.COM * Common Development and Distribution License (the "License"). 611831SVuong.Nguyen@Sun.COM * You may not use this file except in compliance with the License. 711831SVuong.Nguyen@Sun.COM * 811831SVuong.Nguyen@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 911831SVuong.Nguyen@Sun.COM * or http://www.opensolaris.org/os/licensing. 1011831SVuong.Nguyen@Sun.COM * See the License for the specific language governing permissions 1111831SVuong.Nguyen@Sun.COM * and limitations under the License. 1211831SVuong.Nguyen@Sun.COM * 1311831SVuong.Nguyen@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 1411831SVuong.Nguyen@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1511831SVuong.Nguyen@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 1611831SVuong.Nguyen@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 1711831SVuong.Nguyen@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 1811831SVuong.Nguyen@Sun.COM * 1911831SVuong.Nguyen@Sun.COM * CDDL HEADER END 2011831SVuong.Nguyen@Sun.COM */ 2111831SVuong.Nguyen@Sun.COM /* 2212516SVuong.Nguyen@Sun.COM * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 2311831SVuong.Nguyen@Sun.COM */ 2411831SVuong.Nguyen@Sun.COM 2511831SVuong.Nguyen@Sun.COM /* 2611831SVuong.Nguyen@Sun.COM * ldom_utils.c 2711831SVuong.Nguyen@Sun.COM * 2811831SVuong.Nguyen@Sun.COM * Common functions within the library 2911831SVuong.Nguyen@Sun.COM * 3011831SVuong.Nguyen@Sun.COM */ 3111831SVuong.Nguyen@Sun.COM 3211831SVuong.Nguyen@Sun.COM #include <stdio.h> 3312516SVuong.Nguyen@Sun.COM #include <sys/types.h> 3412516SVuong.Nguyen@Sun.COM #include <unistd.h> 3512516SVuong.Nguyen@Sun.COM #include <fcntl.h> 3611831SVuong.Nguyen@Sun.COM 3712516SVuong.Nguyen@Sun.COM boolean_t notify_setup(int * notify_pipe)3812516SVuong.Nguyen@Sun.COMnotify_setup(int *notify_pipe) 3912516SVuong.Nguyen@Sun.COM { 4012516SVuong.Nguyen@Sun.COM if (pipe(notify_pipe) < 0) { 4112516SVuong.Nguyen@Sun.COM return (B_FALSE); 4212516SVuong.Nguyen@Sun.COM } else { 43*12519SVuong.Nguyen@Sun.COM (void) fcntl(notify_pipe[1], F_SETFL, O_NONBLOCK); 4411831SVuong.Nguyen@Sun.COM } 4512516SVuong.Nguyen@Sun.COM return (B_TRUE); 4611831SVuong.Nguyen@Sun.COM } 47