1 /* 2 * This file and its contents are supplied under the terms of the 3 * Common Development and Distribution License ("CDDL"), version 1.0. 4 * You may only use this file in accordance with the terms of version 5 * 1.0 of the CDDL. 6 * 7 * A full copy of the text of the CDDL should have accompanied this 8 * source. A copy of the CDDL is also available via the Internet at 9 * http://www.illumos.org/license/CDDL. 10 */ 11 12 /* 13 * Copyright 2024 Oxide Computer Company 14 */ 15 16 #ifndef _PR_TARGET_H 17 #define _PR_TARGET_H 18 19 /* 20 * Common defintiions for the pr_target.h test. 21 */ 22 23 #include <sys/file.h> 24 #include <fcntl.h> 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 /* 31 * Our expectation is that the file descriptors will end up with the following 32 * values. 33 */ 34 #define PRT_NULL_FD 3 35 #define PRT_NULL_OFLAG O_RDWR 36 #define PRT_NULL_GETFD 0 37 38 #define PRT_CLOSE_FD 4 39 40 #define PRT_ZERO_FD 5 41 #define PRT_ZERO_OFLAG O_WRONLY 42 #define PRT_ZERO_GETFD 0 43 44 #define PRT_DUP_FD 6 45 #define PRT_DUP_OFLAG PRT_NULL_OFLAG 46 #define PRT_DUP_GETFD PRT_NULL_GETFD 47 48 #define PRT_CLOFORK_FD 7 49 #define PRT_CLOFORK_OFLAG PRT_NULL_OFLAG 50 #define PRT_CLOFORK_GETFD FD_CLOFORK 51 52 #define PRT_DUP3_FD 8 53 #define PRT_DUP3_OFLAG PRT_ZERO_OFLAG 54 #define PRT_DUP3_GETFD (FD_CLOFORK | FD_CLOEXEC) 55 56 #ifdef __cplusplus 57 } 58 #endif 59 60 #endif /* _PR_TARGET_H */ 61