1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22 /* 23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _ALLOCATE_H 28 #define _ALLOCATE_H 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 /* Option Flags */ 35 #define LISTATTRS 0x00000001 /* -a */ 36 #define CLASS 0x00000002 /* -c */ 37 #define LISTDEFS 0x00000004 /* -d */ 38 #define TYPE 0x00000008 /* -g */ 39 #define LISTALL 0x00000010 /* -l */ 40 #define LISTFREE 0x00000020 /* -n */ 41 #define SILENT 0x00000040 /* -s */ 42 #define LISTALLOC 0x00000080 /* -u */ 43 #define WINDOWING 0x00000100 /* -w */ 44 #define ZONENAME 0x00000200 /* -z */ 45 #define BOOT 0x00000400 /* -B */ 46 #define FORCE 0x00000800 /* -F */ 47 #define FORCE_ALL 0x00001000 /* -I */ 48 #define USERID 0x00002000 /* -U for list_devices */ 49 #define USERNAME 0x00004000 /* -U for allocate */ 50 51 /* Device clean program exit codes */ 52 53 #define DEVCLEAN_OK 0 54 #define DEVCLEAN_ERROR 1 55 #define DEVCLEAN_SYSERR 2 56 #define DEVCLEAN_BADMOUNT 3 57 #define DEVCLEAN_MOUNTOK 4 58 59 /* Error/Exit codes */ 60 #define ALLOCUERR 1 61 #define CHOWNERR 2 62 /* Skip 3 to avoid conflict with DEVCLEAN_BADMOUNT */ 63 #define CNTDEXECERR 4 64 #define CNTFRCERR 5 65 #define DACACCERR 6 66 #define DAOFFERR 7 67 #define DAUTHERR 8 68 #define DEFATTRSERR 9 69 #define DEVLKERR 10 70 #define DEVLONGERR 11 71 #define DEVNALLOCERR 12 72 #define DEVNAMEERR 13 73 #define DEVSTATEERR 14 74 #define DEVZONEERR 15 75 #define DSPMISSERR 16 76 #define GLOBALERR 17 77 #define LABELRNGERR 18 78 #define LOGINDEVPERMERR 19 79 #define NODAERR 20 80 #define NODMAPERR 21 81 #define PREALLOCERR 22 82 #define SETACLERR 23 83 #define UAUTHERR 24 84 #define ZONEERR 25 85 #define CLEANERR 26 86 87 #define ALLOC_ERRID (uid_t)2 /* bin */ 88 #define ALLOC_ERR_MODE 0100 89 90 /* Functions */ 91 extern int allocate(int optflg, uid_t uid, char *device, char *zonename); 92 extern int deallocate(int optflg, uid_t uid, char *device, char *zonename); 93 extern int list_devices(int optflg, uid_t uid, char *device, char *zonename); 94 95 #ifdef __cplusplus 96 } 97 #endif 98 99 #endif /* _ALLOCATE_H */ 100