| author | |
| committer | |
| log | 575a98a0813181c268e86d590b6267583736bafd |
| tree | cb67ff796c30cbb6632c2defc0a0be1aea706974 |
| parent | 9cb2919d500520d280e09d0990809d538aa32b56 |
| parent | f6845bbbc6bca3b351955ba312755355474a7d82 |
| signature |
macos: update to latest libc headers macOS SDK 13.335 files changed, 6864 insertions(+), 2118 deletions(-)
lib/libc/include/aarch64-macos.13-none/mach/arm/thread_status.h+5| ... | @@ -76,6 +76,11 @@ | ... | @@ -76,6 +76,11 @@ |
| 76 | #define ARM_STATE_FLAVOR_IS_OTHER_VALID(_flavor_) 0 | 76 | #define ARM_STATE_FLAVOR_IS_OTHER_VALID(_flavor_) 0 |
| 77 | #endif | 77 | #endif |
| 78 | 78 | ||
| 79 | #define FLAVOR_MODIFIES_CORE_CPU_REGISTERS(x) \ | ||
| 80 | ((x == ARM_THREAD_STATE) || \ | ||
| 81 | (x == ARM_THREAD_STATE32) || \ | ||
| 82 | (x == ARM_THREAD_STATE64)) | ||
| 83 | |||
| 79 | #define VALID_THREAD_STATE_FLAVOR(x) \ | 84 | #define VALID_THREAD_STATE_FLAVOR(x) \ |
| 80 | 	((x == ARM_THREAD_STATE) || \ | 85 | 	((x == ARM_THREAD_STATE) || \ |
| 81 | 	 (x == ARM_VFP_STATE) || \ | 86 | 	 (x == ARM_VFP_STATE) || \ |
lib/libc/include/any-macos-any/libkern/OSKextLib.h deleted-571| ... | @@ -1,571 +0,0 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _LIBKERN_OSKEXTLIB_H | ||
| 30 | #define _LIBKERN_OSKEXTLIB_H | ||
| 31 | |||
| 32 | #include <sys/cdefs.h> | ||
| 33 | __BEGIN_DECLS | ||
| 34 | |||
| 35 | #include <stdint.h> | ||
| 36 | #include <mach/kmod.h> | ||
| 37 | #include <mach/vm_types.h> | ||
| 38 | #include <uuid/uuid.h> | ||
| 39 | |||
| 40 | #include <libkern/OSReturn.h> | ||
| 41 | |||
| 42 | /*! | ||
| 43 | * @header | ||
| 44 | * | ||
| 45 | * Declares functions, basic return values, and other constants | ||
| 46 | * related to kernel extensions (kexts). | ||
| 47 | */ | ||
| 48 | |||
| 49 | #if PRAGMA_MARK | ||
| 50 | #pragma mark - | ||
| 51 | /********************************************************************/ | ||
| 52 | #pragma mark OSReturn Values for Kernel Extensions | ||
| 53 | /********************************************************************/ | ||
| 54 | #endif | ||
| 55 | /*! | ||
| 56 | * @group OSReturn Values for Kernel Extensions | ||
| 57 | * Many kext-related functions return these values, | ||
| 58 | * as well as those defined under | ||
| 59 | * <code>@link //apple_ref/c/tdef/OSReturn OSReturn@/link</code> | ||
| 60 | * and other variants of <code>kern_return_t</code>. | ||
| 61 | */ | ||
| 62 | |||
| 63 | |||
| 64 | #define sub_libkern_kext err_sub(2) | ||
| 65 | #define libkern_kext_err(code) (sys_libkern|sub_libkern_kext|(code)) | ||
| 66 | |||
| 67 | |||
| 68 | /*! | ||
| 69 | * @define kOSKextReturnInternalError | ||
| 70 | * @abstract An internal error in the kext library. | ||
| 71 | * Contrast with <code>@link //apple_ref/c/econst/OSReturnError | ||
| 72 | * OSReturnError@/link</code>. | ||
| 73 | */ | ||
| 74 | #define kOSKextReturnInternalError libkern_kext_err(0x1) | ||
| 75 | |||
| 76 | /*! | ||
| 77 | * @define kOSKextReturnNoMemory | ||
| 78 | * @abstract Memory allocation failed. | ||
| 79 | */ | ||
| 80 | #define kOSKextReturnNoMemory libkern_kext_err(0x2) | ||
| 81 | |||
| 82 | /*! | ||
| 83 | * @define kOSKextReturnNoResources | ||
| 84 | * @abstract Some resource other than memory (such as available load tags) | ||
| 85 | * is exhausted. | ||
| 86 | */ | ||
| 87 | #define kOSKextReturnNoResources libkern_kext_err(0x3) | ||
| 88 | |||
| 89 | /*! | ||
| 90 | * @define kOSKextReturnNotPrivileged | ||
| 91 | * @abstract The caller lacks privileges to perform the requested operation. | ||
| 92 | */ | ||
| 93 | #define kOSKextReturnNotPrivileged libkern_kext_err(0x4) | ||
| 94 | |||
| 95 | /*! | ||
| 96 | * @define kOSKextReturnInvalidArgument | ||
| 97 | * @abstract Invalid argument. | ||
| 98 | */ | ||
| 99 | #define kOSKextReturnInvalidArgument libkern_kext_err(0x5) | ||
| 100 | |||
| 101 | /*! | ||
| 102 | * @define kOSKextReturnNotFound | ||
| 103 | * @abstract Search item not found. | ||
| 104 | */ | ||
| 105 | #define kOSKextReturnNotFound libkern_kext_err(0x6) | ||
| 106 | |||
| 107 | /*! | ||
| 108 | * @define kOSKextReturnBadData | ||
| 109 | * @abstract Malformed data (not used for XML). | ||
| 110 | */ | ||
| 111 | #define kOSKextReturnBadData libkern_kext_err(0x7) | ||
| 112 | |||
| 113 | /*! | ||
| 114 | * @define kOSKextReturnSerialization | ||
| 115 | * @abstract Error converting or (un)serializing URL, string, or XML. | ||
| 116 | */ | ||
| 117 | #define kOSKextReturnSerialization libkern_kext_err(0x8) | ||
| 118 | |||
| 119 | /*! | ||
| 120 | * @define kOSKextReturnUnsupported | ||
| 121 | * @abstract Operation is no longer or not yet supported. | ||
| 122 | */ | ||
| 123 | #define kOSKextReturnUnsupported libkern_kext_err(0x9) | ||
| 124 | |||
| 125 | /*! | ||
| 126 | * @define kOSKextReturnDisabled | ||
| 127 | * @abstract Operation is currently disabled. | ||
| 128 | */ | ||
| 129 | #define kOSKextReturnDisabled libkern_kext_err(0xa) | ||
| 130 | |||
| 131 | /*! | ||
| 132 | * @define kOSKextReturnNotAKext | ||
| 133 | * @abstract Bundle is not a kernel extension. | ||
| 134 | */ | ||
| 135 | #define kOSKextReturnNotAKext libkern_kext_err(0xb) | ||
| 136 | |||
| 137 | /*! | ||
| 138 | * @define kOSKextReturnValidation | ||
| 139 | * @abstract Validation failures encountered; check diagnostics for details. | ||
| 140 | */ | ||
| 141 | #define kOSKextReturnValidation libkern_kext_err(0xc) | ||
| 142 | |||
| 143 | /*! | ||
| 144 | * @define kOSKextReturnAuthentication | ||
| 145 | * @abstract Authetication failures encountered; check diagnostics for details. | ||
| 146 | */ | ||
| 147 | #define kOSKextReturnAuthentication libkern_kext_err(0xd) | ||
| 148 | |||
| 149 | /*! | ||
| 150 | * @define kOSKextReturnDependencies | ||
| 151 | * @abstract Dependency resolution failures encountered; check diagnostics for details. | ||
| 152 | */ | ||
| 153 | #define kOSKextReturnDependencies libkern_kext_err(0xe) | ||
| 154 | |||
| 155 | /*! | ||
| 156 | * @define kOSKextReturnArchNotFound | ||
| 157 | * @abstract Kext does not contain code for the requested architecture. | ||
| 158 | */ | ||
| 159 | #define kOSKextReturnArchNotFound libkern_kext_err(0xf) | ||
| 160 | |||
| 161 | /*! | ||
| 162 | * @define kOSKextReturnCache | ||
| 163 | * @abstract An error occurred processing a system kext cache. | ||
| 164 | */ | ||
| 165 | #define kOSKextReturnCache libkern_kext_err(0x10) | ||
| 166 | |||
| 167 | /*! | ||
| 168 | * @define kOSKextReturnDeferred | ||
| 169 | * @abstract Operation has been posted asynchronously to user space (kernel only). | ||
| 170 | */ | ||
| 171 | #define kOSKextReturnDeferred libkern_kext_err(0x11) | ||
| 172 | |||
| 173 | /*! | ||
| 174 | * @define kOSKextReturnBootLevel | ||
| 175 | * @abstract Kext not loadable or operation not allowed at current boot level. | ||
| 176 | */ | ||
| 177 | #define kOSKextReturnBootLevel libkern_kext_err(0x12) | ||
| 178 | |||
| 179 | /*! | ||
| 180 | * @define kOSKextReturnNotLoadable | ||
| 181 | * @abstract Kext cannot be loaded; check diagnostics for details. | ||
| 182 | */ | ||
| 183 | #define kOSKextReturnNotLoadable libkern_kext_err(0x13) | ||
| 184 | |||
| 185 | /*! | ||
| 186 | * @define kOSKextReturnLoadedVersionDiffers | ||
| 187 | * @abstract A different version (or executable UUID, or executable by checksum) | ||
| 188 | * of the requested kext is already loaded. | ||
| 189 | */ | ||
| 190 | #define kOSKextReturnLoadedVersionDiffers libkern_kext_err(0x14) | ||
| 191 | |||
| 192 | /*! | ||
| 193 | * @define kOSKextReturnDependencyLoadError | ||
| 194 | * @abstract A load error occurred on a dependency of the kext being loaded. | ||
| 195 | */ | ||
| 196 | #define kOSKextReturnDependencyLoadError libkern_kext_err(0x15) | ||
| 197 | |||
| 198 | /*! | ||
| 199 | * @define kOSKextReturnLinkError | ||
| 200 | * @abstract A link failure occured with this kext or a dependency. | ||
| 201 | */ | ||
| 202 | #define kOSKextReturnLinkError libkern_kext_err(0x16) | ||
| 203 | |||
| 204 | /*! | ||
| 205 | * @define kOSKextReturnStartStopError | ||
| 206 | * @abstract The kext start or stop routine returned an error. | ||
| 207 | */ | ||
| 208 | #define kOSKextReturnStartStopError libkern_kext_err(0x17) | ||
| 209 | |||
| 210 | /*! | ||
| 211 | * @define kOSKextReturnInUse | ||
| 212 | * @abstract The kext is currently in use or has outstanding references, | ||
| 213 | * and cannot be unloaded. | ||
| 214 | */ | ||
| 215 | #define kOSKextReturnInUse libkern_kext_err(0x18) | ||
| 216 | |||
| 217 | /*! | ||
| 218 | * @define kOSKextReturnTimeout | ||
| 219 | * @abstract A kext request has timed out. | ||
| 220 | */ | ||
| 221 | #define kOSKextReturnTimeout libkern_kext_err(0x19) | ||
| 222 | |||
| 223 | /*! | ||
| 224 | * @define kOSKextReturnStopping | ||
| 225 | * @abstract The kext is in the process of stopping; requests cannot be made. | ||
| 226 | */ | ||
| 227 | #define kOSKextReturnStopping libkern_kext_err(0x1a) | ||
| 228 | |||
| 229 | /*! | ||
| 230 | * @define kOSKextReturnSystemPolicy | ||
| 231 | * @abstract The kext was prevented from loading due to system policy. | ||
| 232 | */ | ||
| 233 | #define kOSKextReturnSystemPolicy libkern_kext_err(0x1b) | ||
| 234 | |||
| 235 | /*! | ||
| 236 | * @define kOSKextReturnKCLoadFailure | ||
| 237 | * @abstract Loading of the System KC failed | ||
| 238 | */ | ||
| 239 | #define kOSKextReturnKCLoadFailure libkern_kext_err(0x1c) | ||
| 240 | |||
| 241 | /*! | ||
| 242 | * @define kOSKextReturnKCLoadFailureSystemKC | ||
| 243 | * @abstract Loading of the System KC failed | ||
| 244 | * | ||
| 245 | * This a sub-code of kOSKextReturnKCLoadFailure. It can be OR'd together | ||
| 246 | * with: kOSKextReturnKCLoadFailureAuxKC | ||
| 247 | * | ||
| 248 | * If both the System and Aux KCs fail to load, then the error code will be: | ||
| 249 | * libkern_kext_err(0x1f) | ||
| 250 | */ | ||
| 251 | #define kOSKextReturnKCLoadFailureSystemKC libkern_kext_err(0x1d) | ||
| 252 | |||
| 253 | /*! | ||
| 254 | * @define kOSKextReturnKCLoadFailureAuxKC | ||
| 255 | * @abstract Loading of the Aux KC failed | ||
| 256 | * | ||
| 257 | * This a sub-code of kOSKextReturnKCLoadFailure. It can be OR'd together | ||
| 258 | * with: kOSKextReturnKCLoadFailureSystemKC | ||
| 259 | * | ||
| 260 | * If both the System and Aux KCs fail to load, then the error code will be: | ||
| 261 | * libkern_kext_err(0x1f) | ||
| 262 | */ | ||
| 263 | #define kOSKextReturnKCLoadFailureAuxKC libkern_kext_err(0x1e) | ||
| 264 | |||
| 265 | /* next available error is: libkern_kext_err(0x20) */ | ||
| 266 | |||
| 267 | #if PRAGMA_MARK | ||
| 268 | #pragma mark - | ||
| 269 | /********************************************************************/ | ||
| 270 | #pragma mark Kext/OSBundle Property List Keys | ||
| 271 | /********************************************************************/ | ||
| 272 | #endif | ||
| 273 | /*! | ||
| 274 | * @group Kext Property List Keys | ||
| 275 | * These constants cover CFBundle properties defined for kernel extensions. | ||
| 276 | * Because they are used in the kernel, if you want to use one with | ||
| 277 | * CFBundle APIs you'll need to wrap it in a <code>CFSTR()</code> macro. | ||
| 278 | */ | ||
| 279 | |||
| 280 | |||
| 281 | /*! | ||
| 282 | * @define kOSBundleCompatibleVersionKey | ||
| 283 | * @abstract A string giving the backwards-compatible version of a library kext | ||
| 284 | * in extended Mac OS 'vers' format (####.##.##s{1-255} where 's' | ||
| 285 | * is a build stage 'd', 'a', 'b', 'f' or 'fc'). | ||
| 286 | */ | ||
| 287 | #define kOSBundleCompatibleVersionKey "OSBundleCompatibleVersion" | ||
| 288 | |||
| 289 | /*! | ||
| 290 | * @define kOSBundleEnableKextLoggingKey | ||
| 291 | * @abstract Set to true to have the kernel kext logging spec applied | ||
| 292 | * to the kext. | ||
| 293 | * See <code>@link //apple_ref/c/econst/OSKextLogSpec | ||
| 294 | * OSKextLogSpec@/link</code>. | ||
| 295 | */ | ||
| 296 | #define kOSBundleEnableKextLoggingKey "OSBundleEnableKextLogging" | ||
| 297 | |||
| 298 | /*! | ||
| 299 | * @define kOSBundleIsInterfaceKey | ||
| 300 | * @abstract A boolean value indicating whether the kext executable | ||
| 301 | * contains only symbol references. | ||
| 302 | */ | ||
| 303 | #define kOSBundleIsInterfaceKey "OSBundleIsInterface" | ||
| 304 | |||
| 305 | /*! | ||
| 306 | * @define kOSBundleLibrariesKey | ||
| 307 | * @abstract A dictionary listing link dependencies for this kext. | ||
| 308 | * Keys are bundle identifiers, values are version strings. | ||
| 309 | */ | ||
| 310 | #define kOSBundleLibrariesKey "OSBundleLibraries" | ||
| 311 | |||
| 312 | /*! | ||
| 313 | * @define kOSBundleRequiredKey | ||
| 314 | * @abstract A string indicating in which kinds of startup this kext | ||
| 315 | * may need to load during early startup (before | ||
| 316 | * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code>). | ||
| 317 | * @discussion | ||
| 318 | * The value is one of: | ||
| 319 | * <ul> | ||
| 320 | * <li>@link kOSBundleRequiredRoot "OSBundleRequiredRoot"@/link</li> | ||
| 321 | * <li>@link kOSBundleRequiredLocalRoot "OSBundleRequiredLocalRoot"@/link</li> | ||
| 322 | * <li>@link kOSBundleRequiredNetworkRoot "OSBundleRequiredNetworkRoot"@/link</li> | ||
| 323 | * <li>@link kOSBundleRequiredSafeBoot "OSBundleRequiredSafeBoot"@/link</li> | ||
| 324 | * <li>@link kOSBundleRequiredConsole "OSBundleRequiredConsole"@/link</li> | ||
| 325 | * </ul> | ||
| 326 | * | ||
| 327 | * Use this property judiciously. | ||
| 328 | * Every kext that declares a value other than "OSBundleRequiredSafeBoot" | ||
| 329 | * increases startup time, as the booter must read it into memory, | ||
| 330 | * or startup kext caches must include it. | ||
| 331 | */ | ||
| 332 | #define kOSBundleRequiredKey "OSBundleRequired" | ||
| 333 | |||
| 334 | /*! | ||
| 335 | * @define kOSBundleRequireExplicitLoadKey | ||
| 336 | * @abstract A boolean value indicating whether the kext requires an | ||
| 337 | * explicit kextload in order to start/match. | ||
| 338 | */ | ||
| 339 | #define kOSBundleRequireExplicitLoadKey "OSBundleRequireExplicitLoad" | ||
| 340 | |||
| 341 | /*! | ||
| 342 | * @define kOSBundleAllowUserLoadKey | ||
| 343 | * @abstract A boolean value indicating whether | ||
| 344 | * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code> | ||
| 345 | * will honor a non-root process's request to load a kext. | ||
| 346 | * @discussion | ||
| 347 | * See <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithURL | ||
| 348 | * KextManagerLoadKextWithURL@/link</code> | ||
| 349 | * and <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithIdentifier | ||
| 350 | * KextManagerLoadKextWithIdentifier@/link</code>. | ||
| 351 | */ | ||
| 352 | #define kOSBundleAllowUserLoadKey "OSBundleAllowUserLoad" | ||
| 353 | |||
| 354 | /*! | ||
| 355 | * @define kOSBundleAllowUserTerminateKey | ||
| 356 | * @abstract A boolean value indicating whether the kextunload tool | ||
| 357 | * is allowed to issue IOService terminate to classes defined in this kext. | ||
| 358 | * @discussion A boolean value indicating whether the kextunload tool | ||
| 359 | * is allowed to issue IOService terminate to classes defined in this kext. | ||
| 360 | */ | ||
| 361 | #define kOSBundleAllowUserTerminateKey "OSBundleAllowUserTerminate" | ||
| 362 | |||
| 363 | /*! | ||
| 364 | * @define kOSKernelResourceKey | ||
| 365 | * @abstract A boolean value indicating whether the kext represents a built-in | ||
| 366 | * component of the kernel. | ||
| 367 | */ | ||
| 368 | #define kOSKernelResourceKey "OSKernelResource" | ||
| 369 | |||
| 370 | /*! | ||
| 371 | * @define kOSKextVariantOverrideKey | ||
| 372 | * @abstract A dictionary with target names as key and a target-specific variant | ||
| 373 | * name as value. | ||
| 374 | */ | ||
| 375 | #define kOSKextVariantOverrideKey "OSKextVariantOverride" | ||
| 376 | |||
| 377 | /*! | ||
| 378 | * @define kIOKitPersonalitiesKey | ||
| 379 | * @abstract A dictionary of dictionaries used in matching for I/O Kit drivers. | ||
| 380 | */ | ||
| 381 | #define kIOKitPersonalitiesKey "IOKitPersonalities" | ||
| 382 | |||
| 383 | /* | ||
| 384 | * @define kIOPersonalityPublisherKey | ||
| 385 | * @abstract Used in personalities sent to the I/O Kit, | ||
| 386 | * contains the CFBundleIdentifier of the kext | ||
| 387 | * that the personality originated in. | ||
| 388 | */ | ||
| 389 | #define kIOPersonalityPublisherKey "IOPersonalityPublisher" | ||
| 390 | |||
| 391 | #if CONFIG_KEC_FIPS | ||
| 392 | /* | ||
| 393 | * @define kAppleTextHashesKey | ||
| 394 | * @abstract A dictionary conataining hashes for corecrypto kext. | ||
| 395 | */ | ||
| 396 | #define kAppleTextHashesKey "AppleTextHashes" | ||
| 397 | #endif | ||
| 398 | |||
| 399 | /*! | ||
| 400 | * @define kOSMutableSegmentCopy | ||
| 401 | * @abstract A boolean value indicating whether the kext requires a copy of | ||
| 402 | * its mutable segments to be kept in memory, and then reset when the kext | ||
| 403 | * unloads. This should be used with caution as it will increase the | ||
| 404 | * amount of memory used by the kext. | ||
| 405 | */ | ||
| 406 | #define kOSMutableSegmentCopy "OSMutableSegmentCopy" | ||
| 407 | |||
| 408 | |||
| 409 | #if PRAGMA_MARK | ||
| 410 | /********************************************************************/ | ||
| 411 | #pragma mark Kext/OSBundle Property Deprecated Keys | ||
| 412 | /********************************************************************/ | ||
| 413 | #endif | ||
| 414 | /* | ||
| 415 | * @define kOSBundleDebugLevelKey | ||
| 416 | * @abstract | ||
| 417 | * Deprecated (used on some releases of Mac OS X prior to 10.6 Snow Leopard). | ||
| 418 | * Value is an integer from 1-6, corresponding to the verbose levels | ||
| 419 | * of kext tools on those releases. | ||
| 420 | * On 10.6 Snow Leopard, use <code>@link OSKextEnableKextLogging | ||
| 421 | * OSKextEnableKextLogging@/link</code>. | ||
| 422 | */ | ||
| 423 | #define kOSBundleDebugLevelKey "OSBundleDebugLevel" | ||
| 424 | |||
| 425 | /*! | ||
| 426 | * @define kOSBundleSharedExecutableIdentifierKey | ||
| 427 | * @abstract Deprecated (used on some releases of Mac OS X | ||
| 428 | * prior to 10.6 Snow Leopard). | ||
| 429 | * Value is the bundle identifier of the pseudokext | ||
| 430 | * that contains an executable shared by this kext. | ||
| 431 | */ | ||
| 432 | #define kOSBundleSharedExecutableIdentifierKey "OSBundleSharedExecutableIdentifier" | ||
| 433 | |||
| 434 | |||
| 435 | #if PRAGMA_MARK | ||
| 436 | /********************************************************************/ | ||
| 437 | #pragma mark Kext/OSBundle Property List Values | ||
| 438 | /********************************************************************/ | ||
| 439 | #endif | ||
| 440 | |||
| 441 | /*! | ||
| 442 | * @group Kext Property List Values | ||
| 443 | * These constants encompass established values | ||
| 444 | * for kernel extension bundle properties. | ||
| 445 | */ | ||
| 446 | |||
| 447 | /*! | ||
| 448 | * @define kOSKextKernelIdentifier | ||
| 449 | * @abstract | ||
| 450 | * This is the CFBundleIdentifier user for the kernel itself. | ||
| 451 | */ | ||
| 452 | #define kOSKextKernelIdentifier "__kernel__" | ||
| 453 | |||
| 454 | /*! | ||
| 455 | * @define kOSKextBundlePackageTypeKext | ||
| 456 | * @abstract | ||
| 457 | * The bundle type value for Kernel Extensions. | ||
| 458 | */ | ||
| 459 | #define kOSKextBundlePackageTypeKext "KEXT" | ||
| 460 | |||
| 461 | /*! | ||
| 462 | * @define kOSKextBundlePackageTypeDriverKit | ||
| 463 | * @abstract | ||
| 464 | * The bundle type value for Driver Extensions. | ||
| 465 | */ | ||
| 466 | #define kOSKextBundlePackageTypeDriverKit "DEXT" | ||
| 467 | |||
| 468 | /*! | ||
| 469 | * @define kOSBundleRequiredRoot | ||
| 470 | * @abstract | ||
| 471 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 472 | * value indicates that the kext may be needed to mount the root filesystem | ||
| 473 | * whether starting from a local or a network volume. | ||
| 474 | */ | ||
| 475 | #define kOSBundleRequiredRoot "Root" | ||
| 476 | |||
| 477 | /*! | ||
| 478 | * @define kOSBundleRequiredLocalRoot | ||
| 479 | * @abstract | ||
| 480 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 481 | * value indicates that the kext may be needed to mount the root filesystem | ||
| 482 | * when starting from a local disk. | ||
| 483 | */ | ||
| 484 | #define kOSBundleRequiredLocalRoot "Local-Root" | ||
| 485 | |||
| 486 | /*! | ||
| 487 | * @define kOSBundleRequiredNetworkRoot | ||
| 488 | * @abstract | ||
| 489 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 490 | * value indicates that the kext may be needed to mount the root filesystem | ||
| 491 | * when starting over a network connection. | ||
| 492 | */ | ||
| 493 | #define kOSBundleRequiredNetworkRoot "Network-Root" | ||
| 494 | |||
| 495 | /*! | ||
| 496 | * @define kOSBundleRequiredSafeBoot | ||
| 497 | * @abstract | ||
| 498 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 499 | * value indicates that the kext can be loaded during a safe startup. | ||
| 500 | * This value does not normally cause the kext to be read by the booter | ||
| 501 | * or included in startup kext caches. | ||
| 502 | */ | ||
| 503 | #define kOSBundleRequiredSafeBoot "Safe Boot" | ||
| 504 | |||
| 505 | /*! | ||
| 506 | * @define kOSBundleRequiredConsole | ||
| 507 | * @abstract | ||
| 508 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 509 | * value indicates that the kext may be needed for console access | ||
| 510 | * (specifically in a single-user startup when | ||
| 511 | * <code>@link //apple_ref/doc/man/8/kextd kextd(8)@/link</code>. | ||
| 512 | * does not run) | ||
| 513 | * and should be loaded during early startup. | ||
| 514 | */ | ||
| 515 | #define kOSBundleRequiredConsole "Console" | ||
| 516 | |||
| 517 | /*! | ||
| 518 | * @define kOSBundleRequiredDriverKit | ||
| 519 | * @abstract | ||
| 520 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 521 | * value indicates that the driver extension's (DriverKit driver's) | ||
| 522 | * personalities must be present in the kernel at early boot (specifically | ||
| 523 | * before <code>@link //apple_ref/doc/man/8/kextd kextd(8)@/link</code> starts) | ||
| 524 | * in order to compete with kexts built into the prelinkedkernel. Note that | ||
| 525 | * kextd is still required to launch the user space driver binary. The IOKit | ||
| 526 | * matching will happen during early boot, and the actual driver launch | ||
| 527 | * will happen after kextd starts. | ||
| 528 | */ | ||
| 529 | #define kOSBundleRequiredDriverKit "DriverKit" | ||
| 530 | |||
| 531 | #if PRAGMA_MARK | ||
| 532 | #pragma mark - | ||
| 533 | /********************************************************************/ | ||
| 534 | #pragma mark Kext Information | ||
| 535 | /********************************************************************/ | ||
| 536 | #endif | ||
| 537 | /*! | ||
| 538 | * @group Kext Information | ||
| 539 | * Types, constants, and macros providing a kext with information | ||
| 540 | * about itself. | ||
| 541 | */ | ||
| 542 | |||
| 543 | /*! | ||
| 544 | * @typedef OSKextLoadTag | ||
| 545 | * | ||
| 546 | * @abstract | ||
| 547 | * A unique identifier assigned to a loaded instanace of a kext. | ||
| 548 | * | ||
| 549 | * @discussion | ||
| 550 | * If a kext is unloaded and later reloaded, the new instance | ||
| 551 | * has a different load tag. | ||
| 552 | * | ||
| 553 | * A kext can get its own load tag in the <code>kmod_info_t</code> | ||
| 554 | * structure passed into its module start routine, as the | ||
| 555 | * <code>id</code> field (cast to this type). | ||
| 556 | */ | ||
| 557 | typedef uint32_t OSKextLoadTag; | ||
| 558 | |||
| 559 | /*! | ||
| 560 | * @define kOSKextInvalidLoadTag | ||
| 561 | * | ||
| 562 | * @abstract | ||
| 563 | * A load tag value that will never be used for a loaded kext; | ||
| 564 | * indicates kext not found. | ||
| 565 | */ | ||
| 566 | #define kOSKextInvalidLoadTag ((OSKextLoadTag)(-1)) | ||
| 567 | |||
| 568 | |||
| 569 | __END_DECLS | ||
| 570 | |||
| 571 | #endif /* _LIBKERN_OSKEXTLIB_H */ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos-any/sys/attr.h deleted-592| ... | @@ -1,592 +0,0 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2018 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * attr.h - attribute data structures and interfaces | ||
| 31 | * | ||
| 32 | * Copyright (c) 1998, Apple Computer, Inc. All Rights Reserved. | ||
| 33 | */ | ||
| 34 | |||
| 35 | #ifndef _SYS_ATTR_H_ | ||
| 36 | #define _SYS_ATTR_H_ | ||
| 37 | |||
| 38 | #include <sys/appleapiopts.h> | ||
| 39 | |||
| 40 | #ifdef __APPLE_API_UNSTABLE | ||
| 41 | #include <sys/types.h> | ||
| 42 | #include <sys/ucred.h> | ||
| 43 | #include <sys/time.h> | ||
| 44 | #include <sys/cdefs.h> | ||
| 45 | |||
| 46 | #define FSOPT_NOFOLLOW 0x00000001 | ||
| 47 | #define FSOPT_NOINMEMUPDATE 0x00000002 | ||
| 48 | #define FSOPT_REPORT_FULLSIZE 0x00000004 | ||
| 49 | /* The following option only valid when requesting ATTR_CMN_RETURNED_ATTRS */ | ||
| 50 | #define FSOPT_PACK_INVAL_ATTRS 0x00000008 | ||
| 51 | |||
| 52 | |||
| 53 | #define FSOPT_ATTR_CMN_EXTENDED 0x00000020 | ||
| 54 | #define FSOPT_RETURN_REALDEV 0x00000200 | ||
| 55 | #define FSOPT_NOFOLLOW_ANY 0x00000800 | ||
| 56 | |||
| 57 | /* we currently aren't anywhere near this amount for a valid | ||
| 58 | * fssearchblock.sizeofsearchparams1 or fssearchblock.sizeofsearchparams2 | ||
| 59 | * but we put a sanity check in to avoid abuse of the value passed in from | ||
| 60 | * user land. | ||
| 61 | */ | ||
| 62 | #define SEARCHFS_MAX_SEARCHPARMS 4096 | ||
| 63 | |||
| 64 | typedef u_int32_t text_encoding_t; | ||
| 65 | |||
| 66 | typedef u_int32_t fsobj_type_t; | ||
| 67 | |||
| 68 | typedef u_int32_t fsobj_tag_t; | ||
| 69 | |||
| 70 | typedef u_int32_t fsfile_type_t; | ||
| 71 | |||
| 72 | typedef u_int32_t fsvolid_t; | ||
| 73 | |||
| 74 | #include <sys/_types/_fsobj_id_t.h> /* file object id type */ | ||
| 75 | |||
| 76 | typedef u_int32_t attrgroup_t; | ||
| 77 | |||
| 78 | struct attrlist { | ||
| 79 | 	u_short bitmapcount; /* number of attr. bit sets in list (should be 5) */ | ||
| 80 | 	u_int16_t reserved; /* (to maintain 4-byte alignment) */ | ||
| 81 | 	attrgroup_t commonattr; /* common attribute group */ | ||
| 82 | 	attrgroup_t volattr; /* Volume attribute group */ | ||
| 83 | 	attrgroup_t dirattr; /* directory attribute group */ | ||
| 84 | 	attrgroup_t fileattr; /* file attribute group */ | ||
| 85 | 	attrgroup_t forkattr; /* fork attribute group */ | ||
| 86 | }; | ||
| 87 | |||
| 88 | #define ATTR_BIT_MAP_COUNT 5 | ||
| 89 | |||
| 90 | typedef struct attribute_set { | ||
| 91 | 	attrgroup_t commonattr; /* common attribute group */ | ||
| 92 | 	attrgroup_t volattr; /* Volume attribute group */ | ||
| 93 | 	attrgroup_t dirattr; /* directory attribute group */ | ||
| 94 | 	attrgroup_t fileattr; /* file attribute group */ | ||
| 95 | 	attrgroup_t forkattr; /* fork attribute group */ | ||
| 96 | } attribute_set_t; | ||
| 97 | |||
| 98 | #define ATTRIBUTE_SET_INIT(a) do {(a)->commonattr = (a)->volattr = (a)->dirattr = (a)->fileattr = (a)->forkattr = 0; } while(0) | ||
| 99 | |||
| 100 | |||
| 101 | typedef struct attrreference { | ||
| 102 | 	int32_t attr_dataoffset; | ||
| 103 | 	u_int32_t attr_length; | ||
| 104 | } attrreference_t; | ||
| 105 | |||
| 106 | /* XXX PPD This is derived from HFSVolumePriv.h and should perhaps be referenced from there? */ | ||
| 107 | |||
| 108 | struct diskextent { | ||
| 109 | 	u_int32_t startblock; /* first block allocated */ | ||
| 110 | 	u_int32_t blockcount; /* number of blocks allocated */ | ||
| 111 | }; | ||
| 112 | |||
| 113 | typedef struct diskextent extentrecord[8]; | ||
| 114 | |||
| 115 | typedef u_int32_t vol_capabilities_set_t[4]; | ||
| 116 | |||
| 117 | #define VOL_CAPABILITIES_FORMAT 0 | ||
| 118 | #define VOL_CAPABILITIES_INTERFACES 1 | ||
| 119 | #define VOL_CAPABILITIES_RESERVED1 2 | ||
| 120 | #define VOL_CAPABILITIES_RESERVED2 3 | ||
| 121 | |||
| 122 | typedef struct vol_capabilities_attr { | ||
| 123 | 	vol_capabilities_set_t capabilities; | ||
| 124 | 	vol_capabilities_set_t valid; | ||
| 125 | } vol_capabilities_attr_t; | ||
| 126 | |||
| 127 | /* | ||
| 128 | * XXX this value needs to be raised - 3893388 | ||
| 129 | */ | ||
| 130 | #define ATTR_MAX_BUFFER 8192 | ||
| 131 | |||
| 132 | /* | ||
| 133 | * VOL_CAP_FMT_PERSISTENTOBJECTIDS: When set, the volume has object IDs | ||
| 134 | * that are persistent (retain their values even when the volume is | ||
| 135 | * unmounted and remounted), and a file or directory can be looked up | ||
| 136 | * by ID. Volumes that support VolFS and can support Carbon File ID | ||
| 137 | * references should set this bit. | ||
| 138 | * | ||
| 139 | * VOL_CAP_FMT_SYMBOLICLINKS: When set, the volume supports symbolic | ||
| 140 | * links. The symlink(), readlink(), and lstat() calls all use this | ||
| 141 | * symbolic link. | ||
| 142 | * | ||
| 143 | * VOL_CAP_FMT_HARDLINKS: When set, the volume supports hard links. | ||
| 144 | * The link() call creates hard links. | ||
| 145 | * | ||
| 146 | * VOL_CAP_FMT_JOURNAL: When set, the volume is capable of supporting | ||
| 147 | * a journal used to speed recovery in case of unplanned shutdown | ||
| 148 | * (such as a power outage or crash). This bit does not necessarily | ||
| 149 | * mean the volume is actively using a journal for recovery. | ||
| 150 | * | ||
| 151 | * VOL_CAP_FMT_JOURNAL_ACTIVE: When set, the volume is currently using | ||
| 152 | * a journal for use in speeding recovery after an unplanned shutdown. | ||
| 153 | * This bit can be set only if VOL_CAP_FMT_JOURNAL is also set. | ||
| 154 | * | ||
| 155 | * VOL_CAP_FMT_NO_ROOT_TIMES: When set, the volume format does not | ||
| 156 | * store reliable times for the root directory, so you should not | ||
| 157 | * depend on them to detect changes, etc. | ||
| 158 | * | ||
| 159 | * VOL_CAP_FMT_SPARSE_FILES: When set, the volume supports sparse files. | ||
| 160 | * That is, files which can have "holes" that have never been written | ||
| 161 | * to, and are not allocated on disk. Sparse files may have an | ||
| 162 | * allocated size that is less than the file's logical length. | ||
| 163 | * | ||
| 164 | * VOL_CAP_FMT_ZERO_RUNS: For security reasons, parts of a file (runs) | ||
| 165 | * that have never been written to must appear to contain zeroes. When | ||
| 166 | * this bit is set, the volume keeps track of allocated but unwritten | ||
| 167 | * runs of a file so that it can substitute zeroes without actually | ||
| 168 | * writing zeroes to the media. This provides performance similar to | ||
| 169 | * sparse files, but not the space savings. | ||
| 170 | * | ||
| 171 | * VOL_CAP_FMT_CASE_SENSITIVE: When set, file and directory names are | ||
| 172 | * case sensitive (upper and lower case are different). When clear, | ||
| 173 | * an upper case character is equivalent to a lower case character, | ||
| 174 | * and you can't have two names that differ solely in the case of | ||
| 175 | * the characters. | ||
| 176 | * | ||
| 177 | * VOL_CAP_FMT_CASE_PRESERVING: When set, file and directory names | ||
| 178 | * preserve the difference between upper and lower case. If clear, | ||
| 179 | * the volume may change the case of some characters (typically | ||
| 180 | * making them all upper or all lower case). A volume that sets | ||
| 181 | * VOL_CAP_FMT_CASE_SENSITIVE should also set VOL_CAP_FMT_CASE_PRESERVING. | ||
| 182 | * | ||
| 183 | * VOL_CAP_FMT_FAST_STATFS: This bit is used as a hint to upper layers | ||
| 184 | * (especially Carbon) that statfs() is fast enough that its results | ||
| 185 | * need not be cached by those upper layers. A volume that caches | ||
| 186 | * the statfs information in its in-memory structures should set this bit. | ||
| 187 | * A volume that must always read from disk or always perform a network | ||
| 188 | * transaction should not set this bit. | ||
| 189 | * | ||
| 190 | * VOL_CAP_FMT_2TB_FILESIZE: If this bit is set the volume format supports | ||
| 191 | * file sizes larger than 4GB, and potentially up to 2TB; it does not | ||
| 192 | * indicate whether the filesystem supports files larger than that. | ||
| 193 | * | ||
| 194 | * VOL_CAP_FMT_OPENDENYMODES: When set, the volume supports open deny | ||
| 195 | * modes (e.g. "open for read write, deny write"; effectively, mandatory | ||
| 196 | * file locking based on open modes). | ||
| 197 | * | ||
| 198 | * VOL_CAP_FMT_HIDDEN_FILES: When set, the volume supports the UF_HIDDEN | ||
| 199 | * file flag, and the UF_HIDDEN flag is mapped to that volume's native | ||
| 200 | * "hidden" or "invisible" bit (which may be the invisible bit from the | ||
| 201 | * Finder Info extended attribute). | ||
| 202 | * | ||
| 203 | * VOL_CAP_FMT_PATH_FROM_ID: When set, the volume supports the ability | ||
| 204 | * to derive a pathname to the root of the file system given only the | ||
| 205 | * id of an object. This also implies that object ids on this file | ||
| 206 | * system are persistent and not recycled. This is a very specialized | ||
| 207 | * capability and it is assumed that most file systems will not support | ||
| 208 | * it. Its use is for legacy non-posix APIs like ResolveFileIDRef. | ||
| 209 | * | ||
| 210 | * VOL_CAP_FMT_NO_VOLUME_SIZES: When set, the volume does not support | ||
| 211 | * returning values for total data blocks, available blocks, or free blocks | ||
| 212 | * (as in f_blocks, f_bavail, or f_bfree in "struct statfs"). Historically, | ||
| 213 | * those values were set to 0xFFFFFFFF for volumes that did not support them. | ||
| 214 | * | ||
| 215 | * VOL_CAP_FMT_DECMPFS_COMPRESSION: When set, the volume supports transparent | ||
| 216 | * decompression of compressed files using decmpfs. | ||
| 217 | * | ||
| 218 | * VOL_CAP_FMT_64BIT_OBJECT_IDS: When set, the volume uses object IDs that | ||
| 219 | * are 64-bit. This means that ATTR_CMN_FILEID and ATTR_CMN_PARENTID are the | ||
| 220 | * only legitimate attributes for obtaining object IDs from this volume and the | ||
| 221 | * 32-bit fid_objno fields of the fsobj_id_t returned by ATTR_CMN_OBJID, | ||
| 222 | * ATTR_CMN_OBJPERMID, and ATTR_CMN_PAROBJID are undefined. | ||
| 223 | * | ||
| 224 | * VOL_CAP_FMT_DIR_HARDLINKS: When set, the volume supports directory | ||
| 225 | * hard links. | ||
| 226 | * | ||
| 227 | * VOL_CAP_FMT_DOCUMENT_ID: When set, the volume supports document IDs | ||
| 228 | * (an ID which persists across object ID changes) for document revisions. | ||
| 229 | * | ||
| 230 | * VOL_CAP_FMT_WRITE_GENERATION_COUNT: When set, the volume supports write | ||
| 231 | * generation counts (a count of how many times an object has been modified) | ||
| 232 | * | ||
| 233 | * VOL_CAP_FMT_NO_IMMUTABLE_FILES: When set, the volume does not support | ||
| 234 | * setting the UF_IMMUTABLE flag. | ||
| 235 | * | ||
| 236 | * VOL_CAP_FMT_NO_PERMISSIONS: When set, the volume does not support setting | ||
| 237 | * permissions. | ||
| 238 | * | ||
| 239 | * VOL_CAP_FMT_SHARED_SPACE: When set, the volume supports sharing space with | ||
| 240 | * other filesystems i.e. multiple logical filesystems can exist in the same | ||
| 241 | * "partition". An implication of this is that the filesystem which sets | ||
| 242 | * this capability treats waitfor arguments to VFS_SYNC as bit flags. | ||
| 243 | * | ||
| 244 | * VOL_CAP_FMT_VOL_GROUPS: When set, this volume is part of a volume-group | ||
| 245 | * that implies multiple volumes must be mounted in order to boot and root the | ||
| 246 | * operating system. Typically, this means a read-only system volume and a | ||
| 247 | * writable data volume. | ||
| 248 | * | ||
| 249 | * VOL_CAP_FMT_SEALED: When set, this volume is cryptographically sealed. | ||
| 250 | * Any modifications to volume data or metadata will be detected and may | ||
| 251 | * render the volume unusable. | ||
| 252 | */ | ||
| 253 | #define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001 | ||
| 254 | #define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002 | ||
| 255 | #define VOL_CAP_FMT_HARDLINKS 0x00000004 | ||
| 256 | #define VOL_CAP_FMT_JOURNAL 0x00000008 | ||
| 257 | #define VOL_CAP_FMT_JOURNAL_ACTIVE 0x00000010 | ||
| 258 | #define VOL_CAP_FMT_NO_ROOT_TIMES 0x00000020 | ||
| 259 | #define VOL_CAP_FMT_SPARSE_FILES 0x00000040 | ||
| 260 | #define VOL_CAP_FMT_ZERO_RUNS 0x00000080 | ||
| 261 | #define VOL_CAP_FMT_CASE_SENSITIVE 0x00000100 | ||
| 262 | #define VOL_CAP_FMT_CASE_PRESERVING 0x00000200 | ||
| 263 | #define VOL_CAP_FMT_FAST_STATFS 0x00000400 | ||
| 264 | #define VOL_CAP_FMT_2TB_FILESIZE 0x00000800 | ||
| 265 | #define VOL_CAP_FMT_OPENDENYMODES 0x00001000 | ||
| 266 | #define VOL_CAP_FMT_HIDDEN_FILES 0x00002000 | ||
| 267 | #define VOL_CAP_FMT_PATH_FROM_ID 0x00004000 | ||
| 268 | #define VOL_CAP_FMT_NO_VOLUME_SIZES 0x00008000 | ||
| 269 | #define VOL_CAP_FMT_DECMPFS_COMPRESSION 0x00010000 | ||
| 270 | #define VOL_CAP_FMT_64BIT_OBJECT_IDS 0x00020000 | ||
| 271 | #define VOL_CAP_FMT_DIR_HARDLINKS 0x00040000 | ||
| 272 | #define VOL_CAP_FMT_DOCUMENT_ID 0x00080000 | ||
| 273 | #define VOL_CAP_FMT_WRITE_GENERATION_COUNT 0x00100000 | ||
| 274 | #define VOL_CAP_FMT_NO_IMMUTABLE_FILES 0x00200000 | ||
| 275 | #define VOL_CAP_FMT_NO_PERMISSIONS 0x00400000 | ||
| 276 | #define VOL_CAP_FMT_SHARED_SPACE 0x00800000 | ||
| 277 | #define VOL_CAP_FMT_VOL_GROUPS 0x01000000 | ||
| 278 | #define VOL_CAP_FMT_SEALED 0x02000000 | ||
| 279 | |||
| 280 | /* | ||
| 281 | * VOL_CAP_INT_SEARCHFS: When set, the volume implements the | ||
| 282 | * searchfs() system call (the vnop_searchfs vnode operation). | ||
| 283 | * | ||
| 284 | * VOL_CAP_INT_ATTRLIST: When set, the volume implements the | ||
| 285 | * getattrlist() and setattrlist() system calls (vnop_getattrlist | ||
| 286 | * and vnop_setattrlist vnode operations) for the volume, files, | ||
| 287 | * and directories. The volume may or may not implement the | ||
| 288 | * readdirattr() system call. XXX Is there any minimum set | ||
| 289 | * of attributes that should be supported? To determine the | ||
| 290 | * set of supported attributes, get the ATTR_VOL_ATTRIBUTES | ||
| 291 | * attribute of the volume. | ||
| 292 | * | ||
| 293 | * VOL_CAP_INT_NFSEXPORT: When set, the volume implements exporting | ||
| 294 | * of NFS volumes. | ||
| 295 | * | ||
| 296 | * VOL_CAP_INT_READDIRATTR: When set, the volume implements the | ||
| 297 | * readdirattr() system call (vnop_readdirattr vnode operation). | ||
| 298 | * | ||
| 299 | * VOL_CAP_INT_EXCHANGEDATA: When set, the volume implements the | ||
| 300 | * exchangedata() system call (VNOP_EXCHANGE vnode operation). | ||
| 301 | * | ||
| 302 | * VOL_CAP_INT_COPYFILE: When set, the volume implements the | ||
| 303 | * VOP_COPYFILE vnode operation. (XXX There should be a copyfile() | ||
| 304 | * system call in <unistd.h>.) | ||
| 305 | * | ||
| 306 | * VOL_CAP_INT_ALLOCATE: When set, the volume implements the | ||
| 307 | * VNOP_ALLOCATE vnode operation, which means it implements the | ||
| 308 | * F_PREALLOCATE selector of fcntl(2). | ||
| 309 | * | ||
| 310 | * VOL_CAP_INT_VOL_RENAME: When set, the volume implements the | ||
| 311 | * ATTR_VOL_NAME attribute for both getattrlist() and setattrlist(). | ||
| 312 | * The volume can be renamed by setting ATTR_VOL_NAME with setattrlist(). | ||
| 313 | * | ||
| 314 | * VOL_CAP_INT_ADVLOCK: When set, the volume implements POSIX style | ||
| 315 | * byte range locks via vnop_advlock (accessible from fcntl(2)). | ||
| 316 | * | ||
| 317 | * VOL_CAP_INT_FLOCK: When set, the volume implements whole-file flock(2) | ||
| 318 | * style locks via vnop_advlock. This includes the O_EXLOCK and O_SHLOCK | ||
| 319 | * flags of the open(2) call. | ||
| 320 | * | ||
| 321 | * VOL_CAP_INT_EXTENDED_SECURITY: When set, the volume implements | ||
| 322 | * extended security (ACLs). | ||
| 323 | * | ||
| 324 | * VOL_CAP_INT_USERACCESS: When set, the volume supports the | ||
| 325 | * ATTR_CMN_USERACCESS attribute (used to get the user's access | ||
| 326 | * mode to the file). | ||
| 327 | * | ||
| 328 | * VOL_CAP_INT_MANLOCK: When set, the volume supports AFP-style | ||
| 329 | * mandatory byte range locks via an ioctl(). | ||
| 330 | * | ||
| 331 | * VOL_CAP_INT_EXTENDED_ATTR: When set, the volume implements | ||
| 332 | * native extended attribues. | ||
| 333 | * | ||
| 334 | * VOL_CAP_INT_NAMEDSTREAMS: When set, the volume supports | ||
| 335 | * native named streams. | ||
| 336 | * | ||
| 337 | * VOL_CAP_INT_CLONE: When set, the volume supports clones. | ||
| 338 | * | ||
| 339 | * VOL_CAP_INT_SNAPSHOT: When set, the volume supports snapshots. | ||
| 340 | * | ||
| 341 | * VOL_CAP_INT_RENAME_SWAP: When set, the volume supports swapping | ||
| 342 | * file system objects. | ||
| 343 | * | ||
| 344 | * VOL_CAP_INT_RENAME_EXCL: When set, the volume supports an | ||
| 345 | * exclusive rename operation. | ||
| 346 | * | ||
| 347 | * VOL_CAP_INT_RENAME_OPENFAIL: When set, the volume may fail rename | ||
| 348 | * operations on files that are open. | ||
| 349 | */ | ||
| 350 | #define VOL_CAP_INT_SEARCHFS 0x00000001 | ||
| 351 | #define VOL_CAP_INT_ATTRLIST 0x00000002 | ||
| 352 | #define VOL_CAP_INT_NFSEXPORT 0x00000004 | ||
| 353 | #define VOL_CAP_INT_READDIRATTR 0x00000008 | ||
| 354 | #define VOL_CAP_INT_EXCHANGEDATA 0x00000010 | ||
| 355 | #define VOL_CAP_INT_COPYFILE 0x00000020 | ||
| 356 | #define VOL_CAP_INT_ALLOCATE 0x00000040 | ||
| 357 | #define VOL_CAP_INT_VOL_RENAME 0x00000080 | ||
| 358 | #define VOL_CAP_INT_ADVLOCK 0x00000100 | ||
| 359 | #define VOL_CAP_INT_FLOCK 0x00000200 | ||
| 360 | #define VOL_CAP_INT_EXTENDED_SECURITY 0x00000400 | ||
| 361 | #define VOL_CAP_INT_USERACCESS 0x00000800 | ||
| 362 | #define VOL_CAP_INT_MANLOCK 0x00001000 | ||
| 363 | #define VOL_CAP_INT_NAMEDSTREAMS 0x00002000 | ||
| 364 | #define VOL_CAP_INT_EXTENDED_ATTR 0x00004000 | ||
| 365 | #define VOL_CAP_INT_CLONE 0x00010000 | ||
| 366 | #define VOL_CAP_INT_SNAPSHOT 0x00020000 | ||
| 367 | #define VOL_CAP_INT_RENAME_SWAP 0x00040000 | ||
| 368 | #define VOL_CAP_INT_RENAME_EXCL 0x00080000 | ||
| 369 | #define VOL_CAP_INT_RENAME_OPENFAIL 0x00100000 | ||
| 370 | |||
| 371 | typedef struct vol_attributes_attr { | ||
| 372 | 	attribute_set_t validattr; | ||
| 373 | 	attribute_set_t nativeattr; | ||
| 374 | } vol_attributes_attr_t; | ||
| 375 | |||
| 376 | #define ATTR_CMN_NAME 0x00000001 | ||
| 377 | #define ATTR_CMN_DEVID 0x00000002 | ||
| 378 | #define ATTR_CMN_FSID 0x00000004 | ||
| 379 | #define ATTR_CMN_OBJTYPE 0x00000008 | ||
| 380 | #define ATTR_CMN_OBJTAG 0x00000010 | ||
| 381 | #define ATTR_CMN_OBJID 0x00000020 | ||
| 382 | #define ATTR_CMN_OBJPERMANENTID 0x00000040 | ||
| 383 | #define ATTR_CMN_PAROBJID 0x00000080 | ||
| 384 | #define ATTR_CMN_SCRIPT 0x00000100 | ||
| 385 | #define ATTR_CMN_CRTIME 0x00000200 | ||
| 386 | #define ATTR_CMN_MODTIME 0x00000400 | ||
| 387 | #define ATTR_CMN_CHGTIME 0x00000800 | ||
| 388 | #define ATTR_CMN_ACCTIME 0x00001000 | ||
| 389 | #define ATTR_CMN_BKUPTIME 0x00002000 | ||
| 390 | #define ATTR_CMN_FNDRINFO 0x00004000 | ||
| 391 | #define ATTR_CMN_OWNERID 0x00008000 | ||
| 392 | #define ATTR_CMN_GRPID 0x00010000 | ||
| 393 | #define ATTR_CMN_ACCESSMASK 0x00020000 | ||
| 394 | #define ATTR_CMN_FLAGS 0x00040000 | ||
| 395 | |||
| 396 | /* The following were defined as:				*/ | ||
| 397 | /* #define ATTR_CMN_NAMEDATTRCOUNT		0x00080000	*/ | ||
| 398 | /* #define ATTR_CMN_NAMEDATTRLIST		0x00100000	*/ | ||
| 399 | /* These bits have been salvaged for use as:			*/ | ||
| 400 | /*	#define ATTR_CMN_GEN_COUNT		0x00080000	*/ | ||
| 401 | /*	#define ATTR_CMN_DOCUMENT_ID		0x00100000	*/ | ||
| 402 | /* They can only be used with the FSOPT_ATTR_CMN_EXTENDED	*/ | ||
| 403 | /* option flag. */ | ||
| 404 | |||
| 405 | #define ATTR_CMN_GEN_COUNT 0x00080000 | ||
| 406 | #define ATTR_CMN_DOCUMENT_ID 0x00100000 | ||
| 407 | |||
| 408 | #define ATTR_CMN_USERACCESS 0x00200000 | ||
| 409 | #define ATTR_CMN_EXTENDED_SECURITY 0x00400000 | ||
| 410 | #define ATTR_CMN_UUID 0x00800000 | ||
| 411 | #define ATTR_CMN_GRPUUID 0x01000000 | ||
| 412 | #define ATTR_CMN_FILEID 0x02000000 | ||
| 413 | #define ATTR_CMN_PARENTID 0x04000000 | ||
| 414 | #define ATTR_CMN_FULLPATH 0x08000000 | ||
| 415 | #define ATTR_CMN_ADDEDTIME 0x10000000 | ||
| 416 | #define ATTR_CMN_ERROR 0x20000000 | ||
| 417 | #define ATTR_CMN_DATA_PROTECT_FLAGS 0x40000000 | ||
| 418 | |||
| 419 | /* | ||
| 420 | * ATTR_CMN_RETURNED_ATTRS is only valid with getattrlist(2) and | ||
| 421 | * getattrlistbulk(2). It is always the first attribute in the return buffer. | ||
| 422 | */ | ||
| 423 | #define ATTR_CMN_RETURNED_ATTRS 0x80000000 | ||
| 424 | |||
| 425 | #define ATTR_CMN_VALIDMASK 0xFFFFFFFF | ||
| 426 | /* | ||
| 427 | * The settable ATTR_CMN_* attributes include the following: | ||
| 428 | * ATTR_CMN_SCRIPT | ||
| 429 | * ATTR_CMN_CRTIME | ||
| 430 | * ATTR_CMN_MODTIME | ||
| 431 | * ATTR_CMN_CHGTIME | ||
| 432 | * | ||
| 433 | * ATTR_CMN_ACCTIME | ||
| 434 | * ATTR_CMN_BKUPTIME | ||
| 435 | * ATTR_CMN_FNDRINFO | ||
| 436 | * ATTR_CMN_OWNERID | ||
| 437 | * | ||
| 438 | * ATTR_CMN_GRPID | ||
| 439 | * ATTR_CMN_ACCESSMASK | ||
| 440 | * ATTR_CMN_FLAGS | ||
| 441 | * | ||
| 442 | * ATTR_CMN_EXTENDED_SECURITY | ||
| 443 | * ATTR_CMN_UUID | ||
| 444 | * | ||
| 445 | * ATTR_CMN_GRPUUID | ||
| 446 | * | ||
| 447 | * ATTR_CMN_DATA_PROTECT_FLAGS | ||
| 448 | */ | ||
| 449 | #define ATTR_CMN_SETMASK 0x51C7FF00 | ||
| 450 | #define ATTR_CMN_VOLSETMASK 0x00006700 | ||
| 451 | |||
| 452 | #define ATTR_VOL_FSTYPE 0x00000001 | ||
| 453 | #define ATTR_VOL_SIGNATURE 0x00000002 | ||
| 454 | #define ATTR_VOL_SIZE 0x00000004 | ||
| 455 | #define ATTR_VOL_SPACEFREE 0x00000008 | ||
| 456 | #define ATTR_VOL_SPACEAVAIL 0x00000010 | ||
| 457 | #define ATTR_VOL_MINALLOCATION 0x00000020 | ||
| 458 | #define ATTR_VOL_ALLOCATIONCLUMP 0x00000040 | ||
| 459 | #define ATTR_VOL_IOBLOCKSIZE 0x00000080 | ||
| 460 | #define ATTR_VOL_OBJCOUNT 0x00000100 | ||
| 461 | #define ATTR_VOL_FILECOUNT 0x00000200 | ||
| 462 | #define ATTR_VOL_DIRCOUNT 0x00000400 | ||
| 463 | #define ATTR_VOL_MAXOBJCOUNT 0x00000800 | ||
| 464 | #define ATTR_VOL_MOUNTPOINT 0x00001000 | ||
| 465 | #define ATTR_VOL_NAME 0x00002000 | ||
| 466 | #define ATTR_VOL_MOUNTFLAGS 0x00004000 | ||
| 467 | #define ATTR_VOL_MOUNTEDDEVICE 0x00008000 | ||
| 468 | #define ATTR_VOL_ENCODINGSUSED 0x00010000 | ||
| 469 | #define ATTR_VOL_CAPABILITIES 0x00020000 | ||
| 470 | #define ATTR_VOL_UUID 0x00040000 | ||
| 471 | #define ATTR_VOL_SPACEUSED 0x00800000 | ||
| 472 | #define ATTR_VOL_QUOTA_SIZE 0x10000000 | ||
| 473 | #define ATTR_VOL_RESERVED_SIZE 0x20000000 | ||
| 474 | #define ATTR_VOL_ATTRIBUTES 0x40000000 | ||
| 475 | #define ATTR_VOL_INFO 0x80000000 | ||
| 476 | |||
| 477 | #define ATTR_VOL_VALIDMASK 0xF087FFFF | ||
| 478 | |||
| 479 | /* | ||
| 480 | * The list of settable ATTR_VOL_* attributes include the following: | ||
| 481 | * ATTR_VOL_NAME | ||
| 482 | * ATTR_VOL_INFO | ||
| 483 | */ | ||
| 484 | #define ATTR_VOL_SETMASK 0x80002000 | ||
| 485 | |||
| 486 | |||
| 487 | /* File/directory attributes: */ | ||
| 488 | #define ATTR_DIR_LINKCOUNT 0x00000001 | ||
| 489 | #define ATTR_DIR_ENTRYCOUNT 0x00000002 | ||
| 490 | #define ATTR_DIR_MOUNTSTATUS 0x00000004 | ||
| 491 | #define ATTR_DIR_ALLOCSIZE 0x00000008 | ||
| 492 | #define ATTR_DIR_IOBLOCKSIZE 0x00000010 | ||
| 493 | #define ATTR_DIR_DATALENGTH 0x00000020 | ||
| 494 | |||
| 495 | /* ATTR_DIR_MOUNTSTATUS Flags: */ | ||
| 496 | #define DIR_MNTSTATUS_MNTPOINT 0x00000001 | ||
| 497 | #define DIR_MNTSTATUS_TRIGGER 0x00000002 | ||
| 498 | |||
| 499 | #define ATTR_DIR_VALIDMASK 0x0000003f | ||
| 500 | #define ATTR_DIR_SETMASK 0x00000000 | ||
| 501 | |||
| 502 | #define ATTR_FILE_LINKCOUNT 0x00000001 | ||
| 503 | #define ATTR_FILE_TOTALSIZE 0x00000002 | ||
| 504 | #define ATTR_FILE_ALLOCSIZE 0x00000004 | ||
| 505 | #define ATTR_FILE_IOBLOCKSIZE 0x00000008 | ||
| 506 | #define ATTR_FILE_DEVTYPE 0x00000020 | ||
| 507 | #define ATTR_FILE_FORKCOUNT 0x00000080 | ||
| 508 | #define ATTR_FILE_FORKLIST 0x00000100 | ||
| 509 | #define ATTR_FILE_DATALENGTH 0x00000200 | ||
| 510 | #define ATTR_FILE_DATAALLOCSIZE 0x00000400 | ||
| 511 | #define ATTR_FILE_RSRCLENGTH 0x00001000 | ||
| 512 | #define ATTR_FILE_RSRCALLOCSIZE 0x00002000 | ||
| 513 | |||
| 514 | #define ATTR_FILE_VALIDMASK 0x000037FF | ||
| 515 | /* | ||
| 516 | * Settable ATTR_FILE_* attributes include: | ||
| 517 | * ATTR_FILE_DEVTYPE | ||
| 518 | */ | ||
| 519 | #define ATTR_FILE_SETMASK 0x00000020 | ||
| 520 | |||
| 521 | /* CMNEXT attributes extend the common attributes, but in the forkattr field */ | ||
| 522 | #define ATTR_CMNEXT_RELPATH 0x00000004 | ||
| 523 | #define ATTR_CMNEXT_PRIVATESIZE 0x00000008 | ||
| 524 | #define ATTR_CMNEXT_LINKID 0x00000010 | ||
| 525 | #define ATTR_CMNEXT_NOFIRMLINKPATH 0x00000020 | ||
| 526 | #define ATTR_CMNEXT_REALDEVID 0x00000040 | ||
| 527 | #define ATTR_CMNEXT_REALFSID 0x00000080 | ||
| 528 | #define ATTR_CMNEXT_CLONEID 0x00000100 | ||
| 529 | #define ATTR_CMNEXT_EXT_FLAGS 0x00000200 | ||
| 530 | #define ATTR_CMNEXT_RECURSIVE_GENCOUNT 0x00000400 | ||
| 531 | |||
| 532 | #define ATTR_CMNEXT_VALIDMASK 0x000007fc | ||
| 533 | #define ATTR_CMNEXT_SETMASK 0x00000000 | ||
| 534 | |||
| 535 | /* Deprecated fork attributes */ | ||
| 536 | #define ATTR_FORK_TOTALSIZE 0x00000001 | ||
| 537 | #define ATTR_FORK_ALLOCSIZE 0x00000002 | ||
| 538 | #define ATTR_FORK_RESERVED 0xffffffff | ||
| 539 | |||
| 540 | #define ATTR_FORK_VALIDMASK 0x00000003 | ||
| 541 | #define ATTR_FORK_SETMASK 0x00000000 | ||
| 542 | |||
| 543 | /* Obsolete, implemented, not supported */ | ||
| 544 | #define ATTR_CMN_NAMEDATTRCOUNT 0x00080000 | ||
| 545 | #define ATTR_CMN_NAMEDATTRLIST 0x00100000 | ||
| 546 | #define ATTR_FILE_CLUMPSIZE 0x00000010 /* obsolete */ | ||
| 547 | #define ATTR_FILE_FILETYPE 0x00000040 /* always zero */ | ||
| 548 | #define ATTR_FILE_DATAEXTENTS 0x00000800 /* obsolete, HFS-specific */ | ||
| 549 | #define ATTR_FILE_RSRCEXTENTS 0x00004000 /* obsolete, HFS-specific */ | ||
| 550 | |||
| 551 | /* Required attributes for getattrlistbulk(2) */ | ||
| 552 | #define ATTR_BULK_REQUIRED (ATTR_CMN_NAME | ATTR_CMN_RETURNED_ATTRS) | ||
| 553 | |||
| 554 | /* | ||
| 555 | * Searchfs | ||
| 556 | */ | ||
| 557 | #define SRCHFS_START 0x00000001 | ||
| 558 | #define SRCHFS_MATCHPARTIALNAMES 0x00000002 | ||
| 559 | #define SRCHFS_MATCHDIRS 0x00000004 | ||
| 560 | #define SRCHFS_MATCHFILES 0x00000008 | ||
| 561 | #define SRCHFS_SKIPLINKS 0x00000010 | ||
| 562 | #define SRCHFS_SKIPINVISIBLE 0x00000020 | ||
| 563 | #define SRCHFS_SKIPPACKAGES 0x00000040 | ||
| 564 | #define SRCHFS_SKIPINAPPROPRIATE 0x00000080 | ||
| 565 | |||
| 566 | #define SRCHFS_NEGATEPARAMS 0x80000000 | ||
| 567 | #define SRCHFS_VALIDOPTIONSMASK 0x800000FF | ||
| 568 | |||
| 569 | struct fssearchblock { | ||
| 570 | 	struct attrlist *returnattrs; | ||
| 571 | 	void *returnbuffer; | ||
| 572 | 	size_t returnbuffersize; | ||
| 573 | 	u_long maxmatches; | ||
| 574 | 	struct timeval timelimit; | ||
| 575 | 	void *searchparams1; | ||
| 576 | 	size_t sizeofsearchparams1; | ||
| 577 | 	void *searchparams2; | ||
| 578 | 	size_t sizeofsearchparams2; | ||
| 579 | 	struct attrlist searchattrs; | ||
| 580 | }; | ||
| 581 | |||
| 582 | |||
| 583 | struct searchstate { | ||
| 584 | 	uint32_t ss_union_flags; // for SRCHFS_START | ||
| 585 | 	uint32_t ss_union_layer; // 0 = top | ||
| 586 | 	u_char ss_fsstate[548]; // fs private | ||
| 587 | } __attribute__((packed)); | ||
| 588 | |||
| 589 | #define FST_EOF (-1) /* end-of-file offset */ | ||
| 590 | |||
| 591 | #endif /* __APPLE_API_UNSTABLE */ | ||
| 592 | #endif /* !_SYS_ATTR_H_ */ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos-any/unistd.h deleted-791| ... | @@ -1,791 +0,0 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, 2002-2006, 2008-2010, 2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /*- | ||
| 24 | * Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved | ||
| 25 | * Copyright (c) 1991, 1993, 1994 | ||
| 26 | *	The Regents of the University of California. All rights reserved. | ||
| 27 | * | ||
| 28 | * Redistribution and use in source and binary forms, with or without | ||
| 29 | * modification, are permitted provided that the following conditions | ||
| 30 | * are met: | ||
| 31 | * 1. Redistributions of source code must retain the above copyright | ||
| 32 | * notice, this list of conditions and the following disclaimer. | ||
| 33 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 34 | * notice, this list of conditions and the following disclaimer in the | ||
| 35 | * documentation and/or other materials provided with the distribution. | ||
| 36 | * 3. All advertising materials mentioning features or use of this software | ||
| 37 | * must display the following acknowledgement: | ||
| 38 | *	This product includes software developed by the University of | ||
| 39 | *	California, Berkeley and its contributors. | ||
| 40 | * 4. Neither the name of the University nor the names of its contributors | ||
| 41 | * may be used to endorse or promote products derived from this software | ||
| 42 | * without specific prior written permission. | ||
| 43 | * | ||
| 44 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 45 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 46 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 47 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 48 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 49 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 50 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 51 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 52 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 53 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 54 | * SUCH DAMAGE. | ||
| 55 | * | ||
| 56 | *	@(#)unistd.h	8.12 (Berkeley) 4/27/95 | ||
| 57 | * | ||
| 58 | * Copyright (c) 1998 Apple Compter, Inc. | ||
| 59 | * All Rights Reserved | ||
| 60 | */ | ||
| 61 | |||
| 62 | /* History: | ||
| 63 | 7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr | ||
| 64 | 3/26/98 CHW at Apple added real interface to searchfs call | ||
| 65 | 	3/5/98 CHW at Apple added hfs semantic system calls headers | ||
| 66 | */ | ||
| 67 | |||
| 68 | #ifndef _UNISTD_H_ | ||
| 69 | #define	_UNISTD_H_ | ||
| 70 | |||
| 71 | #include <_types.h> | ||
| 72 | #include <sys/unistd.h> | ||
| 73 | #include <Availability.h> | ||
| 74 | #include <sys/_types/_gid_t.h> | ||
| 75 | #include <sys/_types/_intptr_t.h> | ||
| 76 | #include <sys/_types/_off_t.h> | ||
| 77 | #include <sys/_types/_pid_t.h> | ||
| 78 | /* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: | ||
| 79 | * _GCC_SIZE_T */ | ||
| 80 | #include <sys/_types/_size_t.h> | ||
| 81 | #include <sys/_types/_ssize_t.h> | ||
| 82 | #include <sys/_types/_uid_t.h> | ||
| 83 | #include <sys/_types/_useconds_t.h> | ||
| 84 | #include <sys/_types/_null.h> | ||
| 85 | |||
| 86 | #define	 STDIN_FILENO	0	/* standard input file descriptor */ | ||
| 87 | #define	STDOUT_FILENO	1	/* standard output file descriptor */ | ||
| 88 | #define	STDERR_FILENO	2	/* standard error file descriptor */ | ||
| 89 | |||
| 90 | |||
| 91 | /* Version test macros */ | ||
| 92 | /* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */ | ||
| 93 | #define	_XOPEN_VERSION			600		/* [XSI] */ | ||
| 94 | #define	_XOPEN_XCU_VERSION		4		/* Older standard */ | ||
| 95 | |||
| 96 | |||
| 97 | /* Please keep this list in the same order as the applicable standard */ | ||
| 98 | #define	_POSIX_ADVISORY_INFO		(-1)		/* [ADV] */ | ||
| 99 | #define	_POSIX_ASYNCHRONOUS_IO		(-1)		/* [AIO] */ | ||
| 100 | #define	_POSIX_BARRIERS			(-1)		/* [BAR] */ | ||
| 101 | #define	_POSIX_CHOWN_RESTRICTED		200112L | ||
| 102 | #define	_POSIX_CLOCK_SELECTION		(-1)		/* [CS] */ | ||
| 103 | #define	_POSIX_CPUTIME			(-1)		/* [CPT] */ | ||
| 104 | #define	_POSIX_FSYNC			200112L		/* [FSC] */ | ||
| 105 | #define	_POSIX_IPV6			200112L | ||
| 106 | #define	_POSIX_JOB_CONTROL		200112L | ||
| 107 | #define	_POSIX_MAPPED_FILES		200112L		/* [MF] */ | ||
| 108 | #define	_POSIX_MEMLOCK			(-1)		/* [ML] */ | ||
| 109 | #define	_POSIX_MEMLOCK_RANGE		(-1)		/* [MR] */ | ||
| 110 | #define	_POSIX_MEMORY_PROTECTION	200112L		/* [MPR] */ | ||
| 111 | #define	_POSIX_MESSAGE_PASSING		(-1)		/* [MSG] */ | ||
| 112 | #define	_POSIX_MONOTONIC_CLOCK		(-1)		/* [MON] */ | ||
| 113 | #define	_POSIX_NO_TRUNC			200112L | ||
| 114 | #define	_POSIX_PRIORITIZED_IO		(-1)		/* [PIO] */ | ||
| 115 | #define	_POSIX_PRIORITY_SCHEDULING	(-1)		/* [PS] */ | ||
| 116 | #define	_POSIX_RAW_SOCKETS		(-1)		/* [RS] */ | ||
| 117 | #define	_POSIX_READER_WRITER_LOCKS	200112L		/* [THR] */ | ||
| 118 | #define	_POSIX_REALTIME_SIGNALS		(-1)		/* [RTS] */ | ||
| 119 | #define	_POSIX_REGEXP			200112L | ||
| 120 | #define	_POSIX_SAVED_IDS		200112L		/* XXX required */ | ||
| 121 | #define	_POSIX_SEMAPHORES		(-1)		/* [SEM] */ | ||
| 122 | #define	_POSIX_SHARED_MEMORY_OBJECTS	(-1)		/* [SHM] */ | ||
| 123 | #define	_POSIX_SHELL			200112L | ||
| 124 | #define	_POSIX_SPAWN			(-1)		/* [SPN] */ | ||
| 125 | #define	_POSIX_SPIN_LOCKS		(-1)		/* [SPI] */ | ||
| 126 | #define	_POSIX_SPORADIC_SERVER		(-1)		/* [SS] */ | ||
| 127 | #define	_POSIX_SYNCHRONIZED_IO		(-1)		/* [SIO] */ | ||
| 128 | #define	_POSIX_THREAD_ATTR_STACKADDR	200112L		/* [TSA] */ | ||
| 129 | #define	_POSIX_THREAD_ATTR_STACKSIZE	200112L		/* [TSS] */ | ||
| 130 | #define	_POSIX_THREAD_CPUTIME		(-1)		/* [TCT] */ | ||
| 131 | #define	_POSIX_THREAD_PRIO_INHERIT	(-1)		/* [TPI] */ | ||
| 132 | #define	_POSIX_THREAD_PRIO_PROTECT	(-1)		/* [TPP] */ | ||
| 133 | #define	_POSIX_THREAD_PRIORITY_SCHEDULING	(-1)	/* [TPS] */ | ||
| 134 | #define	_POSIX_THREAD_PROCESS_SHARED	200112L		/* [TSH] */ | ||
| 135 | #define	_POSIX_THREAD_SAFE_FUNCTIONS	200112L		/* [TSF] */ | ||
| 136 | #define	_POSIX_THREAD_SPORADIC_SERVER	(-1)		/* [TSP] */ | ||
| 137 | #define	_POSIX_THREADS			200112L		/* [THR] */ | ||
| 138 | #define	_POSIX_TIMEOUTS			(-1)		/* [TMO] */ | ||
| 139 | #define	_POSIX_TIMERS			(-1)		/* [TMR] */ | ||
| 140 | #define	_POSIX_TRACE			(-1)		/* [TRC] */ | ||
| 141 | #define	_POSIX_TRACE_EVENT_FILTER	(-1)		/* [TEF] */ | ||
| 142 | #define	_POSIX_TRACE_INHERIT		(-1)		/* [TRI] */ | ||
| 143 | #define	_POSIX_TRACE_LOG		(-1)		/* [TRL] */ | ||
| 144 | #define	_POSIX_TYPED_MEMORY_OBJECTS	(-1)		/* [TYM] */ | ||
| 145 | #ifndef _POSIX_VDISABLE | ||
| 146 | #define	_POSIX_VDISABLE			0xff		/* same as sys/termios.h */ | ||
| 147 | #endif /* _POSIX_VDISABLE */ | ||
| 148 | |||
| 149 | #if __DARWIN_C_LEVEL >= 199209L | ||
| 150 | #define	_POSIX2_C_BIND			200112L | ||
| 151 | #define	_POSIX2_C_DEV			200112L		/* c99 command */ | ||
| 152 | #define	_POSIX2_CHAR_TERM		200112L | ||
| 153 | #define	_POSIX2_FORT_DEV		(-1)		/* fort77 command */ | ||
| 154 | #define	_POSIX2_FORT_RUN		200112L | ||
| 155 | #define	_POSIX2_LOCALEDEF		200112L		/* localedef command */ | ||
| 156 | #define	_POSIX2_PBS			(-1) | ||
| 157 | #define	_POSIX2_PBS_ACCOUNTING		(-1) | ||
| 158 | #define	_POSIX2_PBS_CHECKPOINT		(-1) | ||
| 159 | #define	_POSIX2_PBS_LOCATE		(-1) | ||
| 160 | #define	_POSIX2_PBS_MESSAGE		(-1) | ||
| 161 | #define	_POSIX2_PBS_TRACK		(-1) | ||
| 162 | #define	_POSIX2_SW_DEV			200112L | ||
| 163 | #define	_POSIX2_UPE			200112L	/* XXXX no fc, newgrp, tabs */ | ||
| 164 | #endif /* __DARWIN_C_LEVEL */ | ||
| 165 | |||
| 166 | #define	__ILP32_OFF32 (-1) | ||
| 167 | #define	__ILP32_OFFBIG (-1) | ||
| 168 | |||
| 169 | #define	__LP64_OFF64 (1) | ||
| 170 | #define	__LPBIG_OFFBIG (1) | ||
| 171 | |||
| 172 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 173 | #define	_POSIX_V6_ILP32_OFF32		__ILP32_OFF32 | ||
| 174 | #define	_POSIX_V6_ILP32_OFFBIG		__ILP32_OFFBIG | ||
| 175 | #define	_POSIX_V6_LP64_OFF64		__LP64_OFF64 | ||
| 176 | #define	_POSIX_V6_LPBIG_OFFBIG		__LPBIG_OFFBIG | ||
| 177 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 178 | |||
| 179 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 180 | #define	_POSIX_V7_ILP32_OFF32		__ILP32_OFF32 | ||
| 181 | #define	_POSIX_V7_ILP32_OFFBIG		__ILP32_OFFBIG | ||
| 182 | #define	_POSIX_V7_LP64_OFF64		__LP64_OFF64 | ||
| 183 | #define	_POSIX_V7_LPBIG_OFFBIG		__LPBIG_OFFBIG | ||
| 184 | #endif /* __DARWIN_C_LEVEL >= 200809L */ | ||
| 185 | |||
| 186 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 187 | #define	_V6_ILP32_OFF32 __ILP32_OFF32 | ||
| 188 | #define	_V6_ILP32_OFFBIG __ILP32_OFFBIG | ||
| 189 | #define	_V6_LP64_OFF64 __LP64_OFF64 | ||
| 190 | #define	_V6_LPBIG_OFFBIG __LPBIG_OFFBIG | ||
| 191 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 192 | |||
| 193 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 194 | /* Removed in Issue 7 */ | ||
| 195 | #define	_XBS5_ILP32_OFF32		 __ILP32_OFF32 | ||
| 196 | #define	_XBS5_ILP32_OFFBIG		 __ILP32_OFFBIG | ||
| 197 | #define	_XBS5_LP64_OFF64		 __LP64_OFF64 | ||
| 198 | #define	_XBS5_LPBIG_OFFBIG		 __LPBIG_OFFBIG | ||
| 199 | #endif /* __DARWIN_C_LEVEL < 200809L */ | ||
| 200 | |||
| 201 | #if __DARWIN_C_LEVEL >= 199506L /* This really should be XSI */ | ||
| 202 | #define	_XOPEN_CRYPT			(1) | ||
| 203 | #define	_XOPEN_ENH_I18N			(1)		/* XXX required */ | ||
| 204 | #define	_XOPEN_LEGACY			(-1)	/* no ftime gcvt, wcswcs */ | ||
| 205 | #define	_XOPEN_REALTIME			(-1)	/* no q'ed signals, mq_* */ | ||
| 206 | #define	_XOPEN_REALTIME_THREADS		(-1)	/* no posix_spawn, et. al. */ | ||
| 207 | #define	_XOPEN_SHM			(1) | ||
| 208 | #define	_XOPEN_STREAMS			(-1) /* Issue 6 */ | ||
| 209 | #define	_XOPEN_UNIX			(1) | ||
| 210 | #endif /* XSI */ | ||
| 211 | |||
| 212 | /* configurable system variables */ | ||
| 213 | #define	_SC_ARG_MAX			 1 | ||
| 214 | #define	_SC_CHILD_MAX			 2 | ||
| 215 | #define	_SC_CLK_TCK			 3 | ||
| 216 | #define	_SC_NGROUPS_MAX			 4 | ||
| 217 | #define	_SC_OPEN_MAX			 5 | ||
| 218 | #define	_SC_JOB_CONTROL			 6 | ||
| 219 | #define	_SC_SAVED_IDS			 7 | ||
| 220 | #define	_SC_VERSION			 8 | ||
| 221 | #define	_SC_BC_BASE_MAX			 9 | ||
| 222 | #define	_SC_BC_DIM_MAX			10 | ||
| 223 | #define	_SC_BC_SCALE_MAX		11 | ||
| 224 | #define	_SC_BC_STRING_MAX		12 | ||
| 225 | #define	_SC_COLL_WEIGHTS_MAX		13 | ||
| 226 | #define	_SC_EXPR_NEST_MAX		14 | ||
| 227 | #define	_SC_LINE_MAX			15 | ||
| 228 | #define	_SC_RE_DUP_MAX			16 | ||
| 229 | #define	_SC_2_VERSION			17 | ||
| 230 | #define	_SC_2_C_BIND			18 | ||
| 231 | #define	_SC_2_C_DEV			19 | ||
| 232 | #define	_SC_2_CHAR_TERM			20 | ||
| 233 | #define	_SC_2_FORT_DEV			21 | ||
| 234 | #define	_SC_2_FORT_RUN			22 | ||
| 235 | #define	_SC_2_LOCALEDEF			23 | ||
| 236 | #define	_SC_2_SW_DEV			24 | ||
| 237 | #define	_SC_2_UPE			25 | ||
| 238 | #define	_SC_STREAM_MAX			26 | ||
| 239 | #define	_SC_TZNAME_MAX			27 | ||
| 240 | |||
| 241 | #if __DARWIN_C_LEVEL >= 199309L | ||
| 242 | #define	_SC_ASYNCHRONOUS_IO		28 | ||
| 243 | #define	_SC_PAGESIZE			29 | ||
| 244 | #define	_SC_MEMLOCK			30 | ||
| 245 | #define	_SC_MEMLOCK_RANGE		31 | ||
| 246 | #define	_SC_MEMORY_PROTECTION		32 | ||
| 247 | #define	_SC_MESSAGE_PASSING		33 | ||
| 248 | #define	_SC_PRIORITIZED_IO		34 | ||
| 249 | #define	_SC_PRIORITY_SCHEDULING		35 | ||
| 250 | #define	_SC_REALTIME_SIGNALS		36 | ||
| 251 | #define	_SC_SEMAPHORES			37 | ||
| 252 | #define	_SC_FSYNC			38 | ||
| 253 | #define	_SC_SHARED_MEMORY_OBJECTS 	39 | ||
| 254 | #define	_SC_SYNCHRONIZED_IO		40 | ||
| 255 | #define	_SC_TIMERS			41 | ||
| 256 | #define	_SC_AIO_LISTIO_MAX		42 | ||
| 257 | #define	_SC_AIO_MAX			43 | ||
| 258 | #define	_SC_AIO_PRIO_DELTA_MAX		44 | ||
| 259 | #define	_SC_DELAYTIMER_MAX		45 | ||
| 260 | #define	_SC_MQ_OPEN_MAX			46 | ||
| 261 | #define	_SC_MAPPED_FILES		47	/* swap _SC_PAGESIZE vs. BSD */ | ||
| 262 | #define	_SC_RTSIG_MAX			48 | ||
| 263 | #define	_SC_SEM_NSEMS_MAX		49 | ||
| 264 | #define	_SC_SEM_VALUE_MAX		50 | ||
| 265 | #define	_SC_SIGQUEUE_MAX		51 | ||
| 266 | #define	_SC_TIMER_MAX			52 | ||
| 267 | #endif /* __DARWIN_C_LEVEL >= 199309L */ | ||
| 268 | |||
| 269 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 270 | #define	_SC_NPROCESSORS_CONF		57 | ||
| 271 | #define	_SC_NPROCESSORS_ONLN		58 | ||
| 272 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 273 | |||
| 274 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 275 | #define	_SC_2_PBS			59 | ||
| 276 | #define	_SC_2_PBS_ACCOUNTING		60 | ||
| 277 | #define	_SC_2_PBS_CHECKPOINT		61 | ||
| 278 | #define	_SC_2_PBS_LOCATE		62 | ||
| 279 | #define	_SC_2_PBS_MESSAGE		63 | ||
| 280 | #define	_SC_2_PBS_TRACK			64 | ||
| 281 | #define	_SC_ADVISORY_INFO		65 | ||
| 282 | #define	_SC_BARRIERS			66 | ||
| 283 | #define	_SC_CLOCK_SELECTION		67 | ||
| 284 | #define	_SC_CPUTIME			68 | ||
| 285 | #define	_SC_FILE_LOCKING		69 | ||
| 286 | #define	_SC_GETGR_R_SIZE_MAX		70 | ||
| 287 | #define	_SC_GETPW_R_SIZE_MAX		71 | ||
| 288 | #define	_SC_HOST_NAME_MAX		72 | ||
| 289 | #define	_SC_LOGIN_NAME_MAX		73 | ||
| 290 | #define	_SC_MONOTONIC_CLOCK		74 | ||
| 291 | #define	_SC_MQ_PRIO_MAX			75 | ||
| 292 | #define	_SC_READER_WRITER_LOCKS		76 | ||
| 293 | #define	_SC_REGEXP			77 | ||
| 294 | #define	_SC_SHELL			78 | ||
| 295 | #define	_SC_SPAWN			79 | ||
| 296 | #define	_SC_SPIN_LOCKS			80 | ||
| 297 | #define	_SC_SPORADIC_SERVER		81 | ||
| 298 | #define	_SC_THREAD_ATTR_STACKADDR	82 | ||
| 299 | #define	_SC_THREAD_ATTR_STACKSIZE	83 | ||
| 300 | #define	_SC_THREAD_CPUTIME		84 | ||
| 301 | #define	_SC_THREAD_DESTRUCTOR_ITERATIONS 85 | ||
| 302 | #define	_SC_THREAD_KEYS_MAX		86 | ||
| 303 | #define	_SC_THREAD_PRIO_INHERIT		87 | ||
| 304 | #define	_SC_THREAD_PRIO_PROTECT		88 | ||
| 305 | #define	_SC_THREAD_PRIORITY_SCHEDULING	89 | ||
| 306 | #define	_SC_THREAD_PROCESS_SHARED	90 | ||
| 307 | #define	_SC_THREAD_SAFE_FUNCTIONS	91 | ||
| 308 | #define	_SC_THREAD_SPORADIC_SERVER	92 | ||
| 309 | #define	_SC_THREAD_STACK_MIN		93 | ||
| 310 | #define	_SC_THREAD_THREADS_MAX		94 | ||
| 311 | #define	_SC_TIMEOUTS			95 | ||
| 312 | #define	_SC_THREADS			96 | ||
| 313 | #define	_SC_TRACE			97 | ||
| 314 | #define	_SC_TRACE_EVENT_FILTER		98 | ||
| 315 | #define	_SC_TRACE_INHERIT		99 | ||
| 316 | #define	_SC_TRACE_LOG			100 | ||
| 317 | #define	_SC_TTY_NAME_MAX		101 | ||
| 318 | #define	_SC_TYPED_MEMORY_OBJECTS	102 | ||
| 319 | #define	_SC_V6_ILP32_OFF32		103 | ||
| 320 | #define	_SC_V6_ILP32_OFFBIG		104 | ||
| 321 | #define	_SC_V6_LP64_OFF64		105 | ||
| 322 | #define	_SC_V6_LPBIG_OFFBIG		106 | ||
| 323 | #define	_SC_IPV6			118 | ||
| 324 | #define	_SC_RAW_SOCKETS			119 | ||
| 325 | #define	_SC_SYMLOOP_MAX			120 | ||
| 326 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 327 | |||
| 328 | #if __DARWIN_C_LEVEL >= 199506L /* Really XSI */ | ||
| 329 | #define	_SC_ATEXIT_MAX			107 | ||
| 330 | #define	_SC_IOV_MAX			56 | ||
| 331 | #define	_SC_PAGE_SIZE			_SC_PAGESIZE | ||
| 332 | #define	_SC_XOPEN_CRYPT			108 | ||
| 333 | #define	_SC_XOPEN_ENH_I18N		109 | ||
| 334 | #define	_SC_XOPEN_LEGACY		110 /* Issue 6 */ | ||
| 335 | #define	_SC_XOPEN_REALTIME		111 /* Issue 6 */ | ||
| 336 | #define	_SC_XOPEN_REALTIME_THREADS	112 /* Issue 6 */ | ||
| 337 | #define	_SC_XOPEN_SHM			113 | ||
| 338 | #define	_SC_XOPEN_STREAMS		114 /* Issue 6 */ | ||
| 339 | #define	_SC_XOPEN_UNIX			115 | ||
| 340 | #define	_SC_XOPEN_VERSION		116 | ||
| 341 | #define	_SC_XOPEN_XCU_VERSION		121 | ||
| 342 | #endif /* XSI */ | ||
| 343 | |||
| 344 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 345 | /* Removed in Issue 7 */ | ||
| 346 | #define	_SC_XBS5_ILP32_OFF32		122 | ||
| 347 | #define	_SC_XBS5_ILP32_OFFBIG		123 | ||
| 348 | #define	_SC_XBS5_LP64_OFF64		124 | ||
| 349 | #define	_SC_XBS5_LPBIG_OFFBIG		125 | ||
| 350 | #endif /* __DARWIN_C_LEVEL <= 200809L */ | ||
| 351 | |||
| 352 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 353 | #define	_SC_SS_REPL_MAX			126 | ||
| 354 | #define	_SC_TRACE_EVENT_NAME_MAX	127 | ||
| 355 | #define	_SC_TRACE_NAME_MAX		128 | ||
| 356 | #define	_SC_TRACE_SYS_MAX		129 | ||
| 357 | #define	_SC_TRACE_USER_EVENT_MAX	130 | ||
| 358 | #endif | ||
| 359 | |||
| 360 | #if __DARWIN_C_LEVEL < 200112L || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 361 | /* Removed in Issue 6 */ | ||
| 362 | #define	_SC_PASS_MAX			131 | ||
| 363 | #endif | ||
| 364 | |||
| 365 | /* 132-199 available for future use */ | ||
| 366 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 367 | #define	_SC_PHYS_PAGES			200 | ||
| 368 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 369 | |||
| 370 | #if __DARWIN_C_LEVEL >= 199209L | ||
| 371 | #ifndef _CS_PATH /* Defined in <sys/unistd.h> */ | ||
| 372 | #define	_CS_PATH				1 | ||
| 373 | #endif | ||
| 374 | #endif | ||
| 375 | |||
| 376 | #if __DARWIN_C_LEVEL >= 200112 | ||
| 377 | #define	_CS_POSIX_V6_ILP32_OFF32_CFLAGS		2 | ||
| 378 | #define	_CS_POSIX_V6_ILP32_OFF32_LDFLAGS	3 | ||
| 379 | #define	_CS_POSIX_V6_ILP32_OFF32_LIBS		4 | ||
| 380 | #define	_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS	5 | ||
| 381 | #define	_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS	6 | ||
| 382 | #define	_CS_POSIX_V6_ILP32_OFFBIG_LIBS		7 | ||
| 383 | #define	_CS_POSIX_V6_LP64_OFF64_CFLAGS		8 | ||
| 384 | #define	_CS_POSIX_V6_LP64_OFF64_LDFLAGS		9 | ||
| 385 | #define	_CS_POSIX_V6_LP64_OFF64_LIBS		10 | ||
| 386 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS	11 | ||
| 387 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS	12 | ||
| 388 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_LIBS		13 | ||
| 389 | #define	_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS	14 | ||
| 390 | #endif | ||
| 391 | |||
| 392 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 393 | /* Removed in Issue 7 */ | ||
| 394 | #define	_CS_XBS5_ILP32_OFF32_CFLAGS		20 | ||
| 395 | #define	_CS_XBS5_ILP32_OFF32_LDFLAGS		21 | ||
| 396 | #define	_CS_XBS5_ILP32_OFF32_LIBS		22 | ||
| 397 | #define	_CS_XBS5_ILP32_OFF32_LINTFLAGS		23 | ||
| 398 | #define	_CS_XBS5_ILP32_OFFBIG_CFLAGS		24 | ||
| 399 | #define	_CS_XBS5_ILP32_OFFBIG_LDFLAGS		25 | ||
| 400 | #define	_CS_XBS5_ILP32_OFFBIG_LIBS		26 | ||
| 401 | #define	_CS_XBS5_ILP32_OFFBIG_LINTFLAGS		27 | ||
| 402 | #define	_CS_XBS5_LP64_OFF64_CFLAGS		28 | ||
| 403 | #define	_CS_XBS5_LP64_OFF64_LDFLAGS		29 | ||
| 404 | #define	_CS_XBS5_LP64_OFF64_LIBS		30 | ||
| 405 | #define	_CS_XBS5_LP64_OFF64_LINTFLAGS		31 | ||
| 406 | #define	_CS_XBS5_LPBIG_OFFBIG_CFLAGS		32 | ||
| 407 | #define	_CS_XBS5_LPBIG_OFFBIG_LDFLAGS		33 | ||
| 408 | #define	_CS_XBS5_LPBIG_OFFBIG_LIBS		34 | ||
| 409 | #define	_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS		35 | ||
| 410 | #endif | ||
| 411 | |||
| 412 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 413 | #define	_CS_DARWIN_USER_DIR			65536 | ||
| 414 | #define	_CS_DARWIN_USER_TEMP_DIR		65537 | ||
| 415 | #define	_CS_DARWIN_USER_CACHE_DIR		65538 | ||
| 416 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 417 | |||
| 418 | |||
| 419 | #ifdef _DARWIN_UNLIMITED_GETGROUPS | ||
| 420 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2 | ||
| 421 | #error "_DARWIN_UNLIMITED_GETGROUPS specified, but -miphoneos-version-min version does not support it." | ||
| 422 | #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6 | ||
| 423 | #error "_DARWIN_UNLIMITED_GETGROUPS specified, but -mmacosx-version-min version does not support it." | ||
| 424 | #endif | ||
| 425 | #endif | ||
| 426 | |||
| 427 | /* POSIX.1-1990 */ | ||
| 428 | |||
| 429 | __BEGIN_DECLS | ||
| 430 | void	 _exit(int) __dead2; | ||
| 431 | int	 access(const char *, int); | ||
| 432 | unsigned int | ||
| 433 | 	 alarm(unsigned int); | ||
| 434 | int	 chdir(const char *); | ||
| 435 | int	 chown(const char *, uid_t, gid_t); | ||
| 436 | |||
| 437 | int	 close(int) __DARWIN_ALIAS_C(close); | ||
| 438 | |||
| 439 | int	 dup(int); | ||
| 440 | int	 dup2(int, int); | ||
| 441 | int	 execl(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 442 | int	 execle(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 443 | int	 execlp(const char * __file, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 444 | int	 execv(const char * __path, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 445 | int	 execve(const char * __file, char * const * __argv, char * const * __envp) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 446 | int	 execvp(const char * __file, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 447 | pid_t	 fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 448 | long	 fpathconf(int, int); | ||
| 449 | char	*getcwd(char *, size_t); | ||
| 450 | gid_t	 getegid(void); | ||
| 451 | uid_t	 geteuid(void); | ||
| 452 | gid_t	 getgid(void); | ||
| 453 | #if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE) | ||
| 454 | int	 getgroups(int, gid_t []) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(getgroups)); | ||
| 455 | #else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */ | ||
| 456 | int	 getgroups(int, gid_t []); | ||
| 457 | #endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */ | ||
| 458 | char	*getlogin(void); | ||
| 459 | pid_t	 getpgrp(void); | ||
| 460 | pid_t	 getpid(void); | ||
| 461 | pid_t	 getppid(void); | ||
| 462 | uid_t	 getuid(void); | ||
| 463 | int	 isatty(int); | ||
| 464 | int	 link(const char *, const char *); | ||
| 465 | off_t	 lseek(int, off_t, int); | ||
| 466 | long	 pathconf(const char *, int); | ||
| 467 | |||
| 468 | int	 pause(void) __DARWIN_ALIAS_C(pause); | ||
| 469 | |||
| 470 | int	 pipe(int [2]); | ||
| 471 | |||
| 472 | ssize_t	 read(int, void *, size_t) __DARWIN_ALIAS_C(read); | ||
| 473 | |||
| 474 | int	 rmdir(const char *); | ||
| 475 | int	 setgid(gid_t); | ||
| 476 | int	 setpgid(pid_t, pid_t); | ||
| 477 | pid_t	 setsid(void); | ||
| 478 | int	 setuid(uid_t); | ||
| 479 | |||
| 480 | unsigned int | ||
| 481 | 	 sleep(unsigned int) __DARWIN_ALIAS_C(sleep); | ||
| 482 | |||
| 483 | long	 sysconf(int); | ||
| 484 | pid_t	 tcgetpgrp(int); | ||
| 485 | int	 tcsetpgrp(int, pid_t); | ||
| 486 | char	*ttyname(int); | ||
| 487 | |||
| 488 | #if __DARWIN_UNIX03 | ||
| 489 | int	 ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r); | ||
| 490 | #else /* !__DARWIN_UNIX03 */ | ||
| 491 | char	*ttyname_r(int, char *, size_t); | ||
| 492 | #endif /* __DARWIN_UNIX03 */ | ||
| 493 | |||
| 494 | int	 unlink(const char *); | ||
| 495 | |||
| 496 | ssize_t	 write(int __fd, const void * __buf, size_t __nbyte) __DARWIN_ALIAS_C(write); | ||
| 497 | __END_DECLS | ||
| 498 | |||
| 499 | |||
| 500 | |||
| 501 | /* Additional functionality provided by: | ||
| 502 | * POSIX.2-1992 C Language Binding Option | ||
| 503 | */ | ||
| 504 | |||
| 505 | #if __DARWIN_C_LEVEL >= 199209L | ||
| 506 | __BEGIN_DECLS | ||
| 507 | size_t	 confstr(int, char *, size_t) __DARWIN_ALIAS(confstr); | ||
| 508 | |||
| 509 | int	 getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt); | ||
| 510 | |||
| 511 | extern char *optarg;			/* getopt(3) external variables */ | ||
| 512 | extern int optind, opterr, optopt; | ||
| 513 | __END_DECLS | ||
| 514 | #endif /* __DARWIN_C_LEVEL >= 199209L */ | ||
| 515 | |||
| 516 | |||
| 517 | |||
| 518 | /* Additional functionality provided by: | ||
| 519 | * POSIX.1c-1995, | ||
| 520 | * POSIX.1i-1995, | ||
| 521 | * and the omnibus ISO/IEC 9945-1: 1996 | ||
| 522 | */ | ||
| 523 | |||
| 524 | #if __DARWIN_C_LEVEL >= 199506L | ||
| 525 | #include <_ctermid.h> | ||
| 526 | /* These F_* are really XSI or Issue 6 */ | ||
| 527 | #define F_ULOCK 0 /* unlock locked section */ | ||
| 528 | #define	F_LOCK 1 /* lock a section for exclusive use */ | ||
| 529 | #define	F_TLOCK 2 /* test and lock a section for exclusive use */ | ||
| 530 | #define	F_TEST 3 /* test a section for locks by other procs */ | ||
| 531 | |||
| 532 | __BEGIN_DECLS | ||
| 533 | |||
| 534 | /* Begin XSI */ | ||
| 535 | /* Removed in Issue 6 */ | ||
| 536 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | ||
| 537 | #if !defined(_POSIX_C_SOURCE) | ||
| 538 | __deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 539 | #endif | ||
| 540 | void	*brk(const void *); | ||
| 541 | int	 chroot(const char *) __POSIX_C_DEPRECATED(199506L); | ||
| 542 | #endif | ||
| 543 | |||
| 544 | char	*crypt(const char *, const char *); | ||
| 545 | #if __DARWIN_UNIX03 | ||
| 546 | void	 encrypt(char *, int) __DARWIN_ALIAS(encrypt); | ||
| 547 | #else /* !__DARWIN_UNIX03 */ | ||
| 548 | int	 encrypt(char *, int); | ||
| 549 | #endif /* __DARWIN_UNIX03 */ | ||
| 550 | int	 fchdir(int); | ||
| 551 | long	 gethostid(void); | ||
| 552 | pid_t	 getpgid(pid_t); | ||
| 553 | pid_t	 getsid(pid_t); | ||
| 554 | |||
| 555 | /* Removed in Issue 6 */ | ||
| 556 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | ||
| 557 | int	 getdtablesize(void) __POSIX_C_DEPRECATED(199506L); | ||
| 558 | int	 getpagesize(void) __pure2 __POSIX_C_DEPRECATED(199506L); | ||
| 559 | char	*getpass(const char *) __POSIX_C_DEPRECATED(199506L); | ||
| 560 | #endif | ||
| 561 | |||
| 562 | /* Removed in Issue 7 */ | ||
| 563 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L | ||
| 564 | char	*getwd(char *) __POSIX_C_DEPRECATED(200112L); /* obsoleted by getcwd() */ | ||
| 565 | #endif | ||
| 566 | |||
| 567 | int	 lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown); | ||
| 568 | |||
| 569 | int	 lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf); | ||
| 570 | |||
| 571 | int	 nice(int) __DARWIN_ALIAS(nice); | ||
| 572 | |||
| 573 | ssize_t	 pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pread); | ||
| 574 | |||
| 575 | ssize_t	 pwrite(int __fd, const void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pwrite); | ||
| 576 | |||
| 577 | /* Removed in Issue 6 */ | ||
| 578 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | ||
| 579 | /* Note that Issue 5 changed the argument as intprt_t, | ||
| 580 | * but we keep it as int for binary compatability. */ | ||
| 581 | #if !defined(_POSIX_C_SOURCE) | ||
| 582 | __deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 583 | #endif | ||
| 584 | void	*sbrk(int); | ||
| 585 | #endif | ||
| 586 | |||
| 587 | #if __DARWIN_UNIX03 | ||
| 588 | pid_t	 setpgrp(void) __DARWIN_ALIAS(setpgrp); | ||
| 589 | #else /* !__DARWIN_UNIX03 */ | ||
| 590 | int	 setpgrp(pid_t pid, pid_t pgrp);	/* obsoleted by setpgid() */ | ||
| 591 | #endif /* __DARWIN_UNIX03 */ | ||
| 592 | |||
| 593 | int	 setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid); | ||
| 594 | |||
| 595 | int	 setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid); | ||
| 596 | |||
| 597 | void swab(const void * __restrict, void * __restrict, ssize_t); | ||
| 598 | void	 sync(void); | ||
| 599 | int	 truncate(const char *, off_t); | ||
| 600 | useconds_t	 ualarm(useconds_t, useconds_t); | ||
| 601 | int	 usleep(useconds_t) __DARWIN_ALIAS_C(usleep); | ||
| 602 | |||
| 603 | #if !defined(_POSIX_C_SOURCE) | ||
| 604 | __deprecated_msg("Use posix_spawn or fork") | ||
| 605 | #endif | ||
| 606 | pid_t	 vfork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 607 | /* End XSI */ | ||
| 608 | |||
| 609 | int	 fsync(int) __DARWIN_ALIAS_C(fsync); | ||
| 610 | |||
| 611 | int	 ftruncate(int, off_t); | ||
| 612 | int	 getlogin_r(char *, size_t); | ||
| 613 | __END_DECLS | ||
| 614 | #endif /* __DARWIN_C_LEVEL >= 199506L */ | ||
| 615 | |||
| 616 | |||
| 617 | |||
| 618 | /* Additional functionality provided by: | ||
| 619 | * POSIX.1-2001 | ||
| 620 | * ISO C99 | ||
| 621 | */ | ||
| 622 | |||
| 623 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 624 | __BEGIN_DECLS | ||
| 625 | int	 fchown(int, uid_t, gid_t); | ||
| 626 | int	 gethostname(char *, size_t); | ||
| 627 | ssize_t readlink(const char * __restrict, char * __restrict, size_t); | ||
| 628 | int	 setegid(gid_t); | ||
| 629 | int	 seteuid(uid_t); | ||
| 630 | int	 symlink(const char *, const char *); | ||
| 631 | __END_DECLS | ||
| 632 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 633 | |||
| 634 | |||
| 635 | |||
| 636 | /* Darwin extensions */ | ||
| 637 | |||
| 638 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 639 | #include <sys/select.h> | ||
| 640 | |||
| 641 | #include <sys/_types/_dev_t.h> | ||
| 642 | #include <sys/_types/_mode_t.h> | ||
| 643 | #include <sys/_types/_uuid_t.h> | ||
| 644 | |||
| 645 | __BEGIN_DECLS | ||
| 646 | void	 _Exit(int) __dead2; | ||
| 647 | int	 accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t); | ||
| 648 | int	 acct(const char *); | ||
| 649 | int	 add_profil(char *, size_t, unsigned long, unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 650 | void	 endusershell(void); | ||
| 651 | int	 execvP(const char * __file, const char * __searchpath, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 652 | char	*fflagstostr(unsigned long); | ||
| 653 | int	 getdomainname(char *, int); | ||
| 654 | int	 getgrouplist(const char *, int, int *, int *); | ||
| 655 | #if defined(__has_include) | ||
| 656 | #if __has_include(<gethostuuid_private.h>) | ||
| 657 | #include <gethostuuid_private.h> | ||
| 658 | #else | ||
| 659 | #include <gethostuuid.h> | ||
| 660 | #endif | ||
| 661 | #else | ||
| 662 | #include <gethostuuid.h> | ||
| 663 | #endif | ||
| 664 | mode_t	 getmode(const void *, mode_t); | ||
| 665 | int	 getpeereid(int, uid_t *, gid_t *); | ||
| 666 | int	 getsgroups_np(int *, uuid_t); | ||
| 667 | char	*getusershell(void); | ||
| 668 | int	 getwgroups_np(int *, uuid_t); | ||
| 669 | int	 initgroups(const char *, int); | ||
| 670 | int	 issetugid(void); | ||
| 671 | char	*mkdtemp(char *); | ||
| 672 | int	 mknod(const char *, mode_t, dev_t); | ||
| 673 | int	 mkpath_np(const char *path, mode_t omode) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_0); /* returns errno */ | ||
| 674 | int	 mkpathat_np(int dfd, const char *path, mode_t omode) /* returns errno */ | ||
| 675 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 676 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 677 | int	 mkstemp(char *); | ||
| 678 | int	 mkstemps(char *, int); | ||
| 679 | char	*mktemp(char *); | ||
| 680 | int	 mkostemp(char *path, int oflags) | ||
| 681 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 682 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 683 | int	 mkostemps(char *path, int slen, int oflags) | ||
| 684 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 685 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 686 | /* Non-portable mkstemp that uses open_dprotected_np */ | ||
| 687 | int	 mkstemp_dprotected_np(char *path, int dpclass, int dpflags) | ||
| 688 | 		__OSX_UNAVAILABLE __IOS_AVAILABLE(10.0) | ||
| 689 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 690 | char *mkdtempat_np(int dfd, char *path) | ||
| 691 | 		__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 692 | 		__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 693 | int mkstempsat_np(int dfd, char *path, int slen) | ||
| 694 | 		__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 695 | 		__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 696 | int mkostempsat_np(int dfd, char *path, int slen, int oflags) | ||
| 697 | 		__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 698 | 		__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 699 | int	 nfssvc(int, void *); | ||
| 700 | int	 profil(char *, size_t, unsigned long, unsigned int); | ||
| 701 | |||
| 702 | __deprecated_msg("Use of per-thread security contexts is error-prone and discouraged.") | ||
| 703 | int	 pthread_setugid_np(uid_t, gid_t); | ||
| 704 | int	 pthread_getugid_np( uid_t *, gid_t *); | ||
| 705 | |||
| 706 | int	 reboot(int); | ||
| 707 | int	 revoke(const char *); | ||
| 708 | |||
| 709 | __deprecated int	 rcmd(char **, int, const char *, const char *, const char *, int *); | ||
| 710 | __deprecated int	 rcmd_af(char **, int, const char *, const char *, const char *, int *, | ||
| 711 | 		int); | ||
| 712 | __deprecated int	 rresvport(int *); | ||
| 713 | __deprecated int	 rresvport_af(int *, int); | ||
| 714 | __deprecated int	 iruserok(unsigned long, int, const char *, const char *); | ||
| 715 | __deprecated int	 iruserok_sa(const void *, int, int, const char *, const char *); | ||
| 716 | __deprecated int	 ruserok(const char *, int, const char *, const char *); | ||
| 717 | |||
| 718 | int	 setdomainname(const char *, int); | ||
| 719 | int	 setgroups(int, const gid_t *); | ||
| 720 | void	 sethostid(long); | ||
| 721 | int	 sethostname(const char *, int); | ||
| 722 | #if __DARWIN_UNIX03 | ||
| 723 | void	 setkey(const char *) __DARWIN_ALIAS(setkey); | ||
| 724 | #else /* !__DARWIN_UNIX03 */ | ||
| 725 | int	 setkey(const char *); | ||
| 726 | #endif /* __DARWIN_UNIX03 */ | ||
| 727 | int	 setlogin(const char *); | ||
| 728 | void	*setmode(const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(setmode)); | ||
| 729 | int	 setrgid(gid_t); | ||
| 730 | int	 setruid(uid_t); | ||
| 731 | int	 setsgroups_np(int, const uuid_t); | ||
| 732 | void	 setusershell(void); | ||
| 733 | int	 setwgroups_np(int, const uuid_t); | ||
| 734 | int	 strtofflags(char **, unsigned long *, unsigned long *); | ||
| 735 | int	 swapon(const char *); | ||
| 736 | int	 ttyslot(void); | ||
| 737 | int	 undelete(const char *); | ||
| 738 | int	 unwhiteout(const char *); | ||
| 739 | void	*valloc(size_t);			 | ||
| 740 | |||
| 741 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 742 | __OS_AVAILABILITY_MSG(ios,deprecated=10.0,"syscall(2) is unsupported; " | ||
| 743 | "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().") | ||
| 744 | __OS_AVAILABILITY_MSG(macosx,deprecated=10.12,"syscall(2) is unsupported; " | ||
| 745 | "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().") | ||
| 746 | int	 syscall(int, ...); | ||
| 747 | |||
| 748 | extern char *suboptarg;			/* getsubopt(3) external variable */ | ||
| 749 | int	 getsubopt(char **, char * const *, char **); | ||
| 750 | |||
| 751 | /* HFS & HFS Plus semantics system calls go here */ | ||
| 752 | #ifdef __LP64__ | ||
| 753 | int fgetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 754 | int fsetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 755 | int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist); | ||
| 756 | int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist); | ||
| 757 | int exchangedata(const char*,const char*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 758 | int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 759 | |||
| 760 | #else /* __LP64__ */ | ||
| 761 | int	fgetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 762 | int	fsetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 763 | int	getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist); | ||
| 764 | int	setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist); | ||
| 765 | int exchangedata(const char*,const char*,unsigned long) | ||
| 766 | 		__OSX_DEPRECATED(10.0, 10.13, "use renamex_np with the RENAME_SWAP flag") | ||
| 767 | 		__IOS_DEPRECATED(2.0, 11.0, "use renamex_np with the RENAME_SWAP flag") | ||
| 768 | 		__WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 769 | int	getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 770 | |||
| 771 | #endif /* __LP64__ */ | ||
| 772 | |||
| 773 | struct fssearchblock; | ||
| 774 | struct searchstate; | ||
| 775 | |||
| 776 | int	 searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 777 | int	 fsctl(const char *,unsigned long,void*,unsigned int); | ||
| 778 | int	 ffsctl(int,unsigned long,void*,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 779 | |||
| 780 | #define	SYNC_VOLUME_FULLSYNC	0x01	/* Flush data and metadata to platter, not just to disk cache */ | ||
| 781 | #define SYNC_VOLUME_WAIT	0x02	/* Wait for sync to complete */ | ||
| 782 | |||
| 783 | int	fsync_volume_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 784 | int	sync_volume_np(const char *, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 785 | |||
| 786 | extern int optreset; | ||
| 787 | |||
| 788 | __END_DECLS | ||
| 789 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 790 | |||
| 791 | #endif /* _UNISTD_H_ */ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos-any/xpc/availability.h deleted-130| ... | @@ -1,130 +0,0 @@ | ||
| 1 | #ifndef __XPC_AVAILABILITY_H__ | ||
| 2 | #define __XPC_AVAILABILITY_H__ | ||
| 3 | |||
| 4 | #include <Availability.h> | ||
| 5 | |||
| 6 | // Certain parts of the project use all the project's headers but have to build | ||
| 7 | // against newer OSX SDKs than ebuild uses -- liblaunch_host being the example. | ||
| 8 | // So we need to define these. | ||
| 9 | #ifndef __MAC_10_16 | ||
| 10 | #define __MAC_10_16 101600 | ||
| 11 | #endif // __MAC_10_16 | ||
| 12 | |||
| 13 | #ifndef __MAC_10_15 | ||
| 14 | #define __MAC_10_15 101500 | ||
| 15 | #define __AVAILABILITY_INTERNAL__MAC_10_15 \ | ||
| 16 | __attribute__((availability(macosx, introduced=10.15))) | ||
| 17 | #endif // __MAC_10_15 | ||
| 18 | |||
| 19 | #ifndef __MAC_10_14 | ||
| 20 | #define __MAC_10_14 101400 | ||
| 21 | #define __AVAILABILITY_INTERNAL__MAC_10_14 \ | ||
| 22 | __attribute__((availability(macosx, introduced=10.14))) | ||
| 23 | #endif // __MAC_10_14 | ||
| 24 | |||
| 25 | #ifndef __MAC_10_13 | ||
| 26 | #define __MAC_10_13 101300 | ||
| 27 | #define __AVAILABILITY_INTERNAL__MAC_10_13 \ | ||
| 28 | 	__attribute__((availability(macosx, introduced=10.13))) | ||
| 29 | #endif // __MAC_10_13 | ||
| 30 | |||
| 31 | #ifndef __MAC_10_12 | ||
| 32 | #define __MAC_10_12 101200 | ||
| 33 | #define __AVAILABILITY_INTERNAL__MAC_10_12 \ | ||
| 34 | 	__attribute__((availability(macosx, introduced=10.12))) | ||
| 35 | #endif // __MAC_10_12 | ||
| 36 | |||
| 37 | #ifndef __MAC_10_11 | ||
| 38 | #define __MAC_10_11 101100 | ||
| 39 | #define __AVAILABILITY_INTERNAL__MAC_10_11 \ | ||
| 40 | 	__attribute__((availability(macosx, introduced=10.11))) | ||
| 41 | #endif // __MAC_10_11 | ||
| 42 | |||
| 43 | #ifndef __MAC_12_0 | ||
| 44 | #define __MAC_12_0 120000 | ||
| 45 | #define __AVAILABILITY_INTERNAL__MAC_12_0 \ | ||
| 46 | 	__attribute__((availability(macosx, introduced=12.0))) | ||
| 47 | #endif // __MAC_12_0 | ||
| 48 | |||
| 49 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 | ||
| 50 | #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 | ||
| 51 | #endif // __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 | ||
| 52 | |||
| 53 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 | ||
| 54 | #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 | ||
| 55 | #endif // __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 | ||
| 56 | |||
| 57 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 | ||
| 58 | #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 | ||
| 59 | #endif // __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 | ||
| 60 | |||
| 61 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 | ||
| 62 | #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 | ||
| 63 | #endif // __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 | ||
| 64 | |||
| 65 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 | ||
| 66 | #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 | ||
| 67 | #endif // __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 | ||
| 68 | |||
| 69 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 | ||
| 70 | #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 | ||
| 71 | #endif // __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 | ||
| 72 | |||
| 73 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 | ||
| 74 | #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 | ||
| 75 | #endif // __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 | ||
| 76 | |||
| 77 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 | ||
| 78 | #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 | ||
| 79 | #endif // __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 | ||
| 80 | |||
| 81 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 | ||
| 82 | #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 | ||
| 83 | #endif // __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 | ||
| 84 | |||
| 85 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 | ||
| 86 | #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 | ||
| 87 | #endif // __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 | ||
| 88 | |||
| 89 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 | ||
| 90 | #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 | ||
| 91 | #endif // __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 | ||
| 92 | |||
| 93 | #if __has_include(<simulator_host.h>) | ||
| 94 | #include <simulator_host.h> | ||
| 95 | #else // __has_include(<simulator_host.h>) | ||
| 96 | #ifndef IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED | ||
| 97 | #define IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED 999999 | ||
| 98 | #endif // IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED | ||
| 99 | #endif // __has_include(<simulator_host.h>) | ||
| 100 | |||
| 101 | #ifndef __WATCHOS_UNAVAILABLE | ||
| 102 | #define __WATCHOS_UNAVAILABLE | ||
| 103 | #endif | ||
| 104 | |||
| 105 | #ifndef __TVOS_UNAVAILABLE | ||
| 106 | #define __TVOS_UNAVAILABLE | ||
| 107 | #endif | ||
| 108 | |||
| 109 | // simulator host-side bits build against SDKs not having __*_AVAILABLE() yet | ||
| 110 | #ifndef __OSX_AVAILABLE | ||
| 111 | #define __OSX_AVAILABLE(...) | ||
| 112 | #endif | ||
| 113 | |||
| 114 | #ifndef __IOS_AVAILABLE | ||
| 115 | #define __IOS_AVAILABLE(...) | ||
| 116 | #endif | ||
| 117 | |||
| 118 | #ifndef __TVOS_AVAILABLE | ||
| 119 | #define __TVOS_AVAILABLE(...) | ||
| 120 | #endif | ||
| 121 | |||
| 122 | #ifndef __WATCHOS_AVAILABLE | ||
| 123 | #define __WATCHOS_AVAILABLE(...) | ||
| 124 | #endif | ||
| 125 | |||
| 126 | #ifndef __API_AVAILABLE | ||
| 127 | #define __API_AVAILABLE(...) | ||
| 128 | #endif | ||
| 129 | |||
| 130 | #endif // __XPC_AVAILABILITY_H__ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.12-any/libkern/OSKextLib.h created+571| ... | @@ -0,0 +1,571 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _LIBKERN_OSKEXTLIB_H | ||
| 30 | #define _LIBKERN_OSKEXTLIB_H | ||
| 31 | |||
| 32 | #include <sys/cdefs.h> | ||
| 33 | __BEGIN_DECLS | ||
| 34 | |||
| 35 | #include <stdint.h> | ||
| 36 | #include <mach/kmod.h> | ||
| 37 | #include <mach/vm_types.h> | ||
| 38 | #include <uuid/uuid.h> | ||
| 39 | |||
| 40 | #include <libkern/OSReturn.h> | ||
| 41 | |||
| 42 | /*! | ||
| 43 | * @header | ||
| 44 | * | ||
| 45 | * Declares functions, basic return values, and other constants | ||
| 46 | * related to kernel extensions (kexts). | ||
| 47 | */ | ||
| 48 | |||
| 49 | #if PRAGMA_MARK | ||
| 50 | #pragma mark - | ||
| 51 | /********************************************************************/ | ||
| 52 | #pragma mark OSReturn Values for Kernel Extensions | ||
| 53 | /********************************************************************/ | ||
| 54 | #endif | ||
| 55 | /*! | ||
| 56 | * @group OSReturn Values for Kernel Extensions | ||
| 57 | * Many kext-related functions return these values, | ||
| 58 | * as well as those defined under | ||
| 59 | * <code>@link //apple_ref/c/tdef/OSReturn OSReturn@/link</code> | ||
| 60 | * and other variants of <code>kern_return_t</code>. | ||
| 61 | */ | ||
| 62 | |||
| 63 | |||
| 64 | #define sub_libkern_kext err_sub(2) | ||
| 65 | #define libkern_kext_err(code) (sys_libkern|sub_libkern_kext|(code)) | ||
| 66 | |||
| 67 | |||
| 68 | /*! | ||
| 69 | * @define kOSKextReturnInternalError | ||
| 70 | * @abstract An internal error in the kext library. | ||
| 71 | * Contrast with <code>@link //apple_ref/c/econst/OSReturnError | ||
| 72 | * OSReturnError@/link</code>. | ||
| 73 | */ | ||
| 74 | #define kOSKextReturnInternalError libkern_kext_err(0x1) | ||
| 75 | |||
| 76 | /*! | ||
| 77 | * @define kOSKextReturnNoMemory | ||
| 78 | * @abstract Memory allocation failed. | ||
| 79 | */ | ||
| 80 | #define kOSKextReturnNoMemory libkern_kext_err(0x2) | ||
| 81 | |||
| 82 | /*! | ||
| 83 | * @define kOSKextReturnNoResources | ||
| 84 | * @abstract Some resource other than memory (such as available load tags) | ||
| 85 | * is exhausted. | ||
| 86 | */ | ||
| 87 | #define kOSKextReturnNoResources libkern_kext_err(0x3) | ||
| 88 | |||
| 89 | /*! | ||
| 90 | * @define kOSKextReturnNotPrivileged | ||
| 91 | * @abstract The caller lacks privileges to perform the requested operation. | ||
| 92 | */ | ||
| 93 | #define kOSKextReturnNotPrivileged libkern_kext_err(0x4) | ||
| 94 | |||
| 95 | /*! | ||
| 96 | * @define kOSKextReturnInvalidArgument | ||
| 97 | * @abstract Invalid argument. | ||
| 98 | */ | ||
| 99 | #define kOSKextReturnInvalidArgument libkern_kext_err(0x5) | ||
| 100 | |||
| 101 | /*! | ||
| 102 | * @define kOSKextReturnNotFound | ||
| 103 | * @abstract Search item not found. | ||
| 104 | */ | ||
| 105 | #define kOSKextReturnNotFound libkern_kext_err(0x6) | ||
| 106 | |||
| 107 | /*! | ||
| 108 | * @define kOSKextReturnBadData | ||
| 109 | * @abstract Malformed data (not used for XML). | ||
| 110 | */ | ||
| 111 | #define kOSKextReturnBadData libkern_kext_err(0x7) | ||
| 112 | |||
| 113 | /*! | ||
| 114 | * @define kOSKextReturnSerialization | ||
| 115 | * @abstract Error converting or (un)serializing URL, string, or XML. | ||
| 116 | */ | ||
| 117 | #define kOSKextReturnSerialization libkern_kext_err(0x8) | ||
| 118 | |||
| 119 | /*! | ||
| 120 | * @define kOSKextReturnUnsupported | ||
| 121 | * @abstract Operation is no longer or not yet supported. | ||
| 122 | */ | ||
| 123 | #define kOSKextReturnUnsupported libkern_kext_err(0x9) | ||
| 124 | |||
| 125 | /*! | ||
| 126 | * @define kOSKextReturnDisabled | ||
| 127 | * @abstract Operation is currently disabled. | ||
| 128 | */ | ||
| 129 | #define kOSKextReturnDisabled libkern_kext_err(0xa) | ||
| 130 | |||
| 131 | /*! | ||
| 132 | * @define kOSKextReturnNotAKext | ||
| 133 | * @abstract Bundle is not a kernel extension. | ||
| 134 | */ | ||
| 135 | #define kOSKextReturnNotAKext libkern_kext_err(0xb) | ||
| 136 | |||
| 137 | /*! | ||
| 138 | * @define kOSKextReturnValidation | ||
| 139 | * @abstract Validation failures encountered; check diagnostics for details. | ||
| 140 | */ | ||
| 141 | #define kOSKextReturnValidation libkern_kext_err(0xc) | ||
| 142 | |||
| 143 | /*! | ||
| 144 | * @define kOSKextReturnAuthentication | ||
| 145 | * @abstract Authetication failures encountered; check diagnostics for details. | ||
| 146 | */ | ||
| 147 | #define kOSKextReturnAuthentication libkern_kext_err(0xd) | ||
| 148 | |||
| 149 | /*! | ||
| 150 | * @define kOSKextReturnDependencies | ||
| 151 | * @abstract Dependency resolution failures encountered; check diagnostics for details. | ||
| 152 | */ | ||
| 153 | #define kOSKextReturnDependencies libkern_kext_err(0xe) | ||
| 154 | |||
| 155 | /*! | ||
| 156 | * @define kOSKextReturnArchNotFound | ||
| 157 | * @abstract Kext does not contain code for the requested architecture. | ||
| 158 | */ | ||
| 159 | #define kOSKextReturnArchNotFound libkern_kext_err(0xf) | ||
| 160 | |||
| 161 | /*! | ||
| 162 | * @define kOSKextReturnCache | ||
| 163 | * @abstract An error occurred processing a system kext cache. | ||
| 164 | */ | ||
| 165 | #define kOSKextReturnCache libkern_kext_err(0x10) | ||
| 166 | |||
| 167 | /*! | ||
| 168 | * @define kOSKextReturnDeferred | ||
| 169 | * @abstract Operation has been posted asynchronously to user space (kernel only). | ||
| 170 | */ | ||
| 171 | #define kOSKextReturnDeferred libkern_kext_err(0x11) | ||
| 172 | |||
| 173 | /*! | ||
| 174 | * @define kOSKextReturnBootLevel | ||
| 175 | * @abstract Kext not loadable or operation not allowed at current boot level. | ||
| 176 | */ | ||
| 177 | #define kOSKextReturnBootLevel libkern_kext_err(0x12) | ||
| 178 | |||
| 179 | /*! | ||
| 180 | * @define kOSKextReturnNotLoadable | ||
| 181 | * @abstract Kext cannot be loaded; check diagnostics for details. | ||
| 182 | */ | ||
| 183 | #define kOSKextReturnNotLoadable libkern_kext_err(0x13) | ||
| 184 | |||
| 185 | /*! | ||
| 186 | * @define kOSKextReturnLoadedVersionDiffers | ||
| 187 | * @abstract A different version (or executable UUID, or executable by checksum) | ||
| 188 | * of the requested kext is already loaded. | ||
| 189 | */ | ||
| 190 | #define kOSKextReturnLoadedVersionDiffers libkern_kext_err(0x14) | ||
| 191 | |||
| 192 | /*! | ||
| 193 | * @define kOSKextReturnDependencyLoadError | ||
| 194 | * @abstract A load error occurred on a dependency of the kext being loaded. | ||
| 195 | */ | ||
| 196 | #define kOSKextReturnDependencyLoadError libkern_kext_err(0x15) | ||
| 197 | |||
| 198 | /*! | ||
| 199 | * @define kOSKextReturnLinkError | ||
| 200 | * @abstract A link failure occured with this kext or a dependency. | ||
| 201 | */ | ||
| 202 | #define kOSKextReturnLinkError libkern_kext_err(0x16) | ||
| 203 | |||
| 204 | /*! | ||
| 205 | * @define kOSKextReturnStartStopError | ||
| 206 | * @abstract The kext start or stop routine returned an error. | ||
| 207 | */ | ||
| 208 | #define kOSKextReturnStartStopError libkern_kext_err(0x17) | ||
| 209 | |||
| 210 | /*! | ||
| 211 | * @define kOSKextReturnInUse | ||
| 212 | * @abstract The kext is currently in use or has outstanding references, | ||
| 213 | * and cannot be unloaded. | ||
| 214 | */ | ||
| 215 | #define kOSKextReturnInUse libkern_kext_err(0x18) | ||
| 216 | |||
| 217 | /*! | ||
| 218 | * @define kOSKextReturnTimeout | ||
| 219 | * @abstract A kext request has timed out. | ||
| 220 | */ | ||
| 221 | #define kOSKextReturnTimeout libkern_kext_err(0x19) | ||
| 222 | |||
| 223 | /*! | ||
| 224 | * @define kOSKextReturnStopping | ||
| 225 | * @abstract The kext is in the process of stopping; requests cannot be made. | ||
| 226 | */ | ||
| 227 | #define kOSKextReturnStopping libkern_kext_err(0x1a) | ||
| 228 | |||
| 229 | /*! | ||
| 230 | * @define kOSKextReturnSystemPolicy | ||
| 231 | * @abstract The kext was prevented from loading due to system policy. | ||
| 232 | */ | ||
| 233 | #define kOSKextReturnSystemPolicy libkern_kext_err(0x1b) | ||
| 234 | |||
| 235 | /*! | ||
| 236 | * @define kOSKextReturnKCLoadFailure | ||
| 237 | * @abstract Loading of the System KC failed | ||
| 238 | */ | ||
| 239 | #define kOSKextReturnKCLoadFailure libkern_kext_err(0x1c) | ||
| 240 | |||
| 241 | /*! | ||
| 242 | * @define kOSKextReturnKCLoadFailureSystemKC | ||
| 243 | * @abstract Loading of the System KC failed | ||
| 244 | * | ||
| 245 | * This a sub-code of kOSKextReturnKCLoadFailure. It can be OR'd together | ||
| 246 | * with: kOSKextReturnKCLoadFailureAuxKC | ||
| 247 | * | ||
| 248 | * If both the System and Aux KCs fail to load, then the error code will be: | ||
| 249 | * libkern_kext_err(0x1f) | ||
| 250 | */ | ||
| 251 | #define kOSKextReturnKCLoadFailureSystemKC libkern_kext_err(0x1d) | ||
| 252 | |||
| 253 | /*! | ||
| 254 | * @define kOSKextReturnKCLoadFailureAuxKC | ||
| 255 | * @abstract Loading of the Aux KC failed | ||
| 256 | * | ||
| 257 | * This a sub-code of kOSKextReturnKCLoadFailure. It can be OR'd together | ||
| 258 | * with: kOSKextReturnKCLoadFailureSystemKC | ||
| 259 | * | ||
| 260 | * If both the System and Aux KCs fail to load, then the error code will be: | ||
| 261 | * libkern_kext_err(0x1f) | ||
| 262 | */ | ||
| 263 | #define kOSKextReturnKCLoadFailureAuxKC libkern_kext_err(0x1e) | ||
| 264 | |||
| 265 | /* next available error is: libkern_kext_err(0x20) */ | ||
| 266 | |||
| 267 | #if PRAGMA_MARK | ||
| 268 | #pragma mark - | ||
| 269 | /********************************************************************/ | ||
| 270 | #pragma mark Kext/OSBundle Property List Keys | ||
| 271 | /********************************************************************/ | ||
| 272 | #endif | ||
| 273 | /*! | ||
| 274 | * @group Kext Property List Keys | ||
| 275 | * These constants cover CFBundle properties defined for kernel extensions. | ||
| 276 | * Because they are used in the kernel, if you want to use one with | ||
| 277 | * CFBundle APIs you'll need to wrap it in a <code>CFSTR()</code> macro. | ||
| 278 | */ | ||
| 279 | |||
| 280 | |||
| 281 | /*! | ||
| 282 | * @define kOSBundleCompatibleVersionKey | ||
| 283 | * @abstract A string giving the backwards-compatible version of a library kext | ||
| 284 | * in extended Mac OS 'vers' format (####.##.##s{1-255} where 's' | ||
| 285 | * is a build stage 'd', 'a', 'b', 'f' or 'fc'). | ||
| 286 | */ | ||
| 287 | #define kOSBundleCompatibleVersionKey "OSBundleCompatibleVersion" | ||
| 288 | |||
| 289 | /*! | ||
| 290 | * @define kOSBundleEnableKextLoggingKey | ||
| 291 | * @abstract Set to true to have the kernel kext logging spec applied | ||
| 292 | * to the kext. | ||
| 293 | * See <code>@link //apple_ref/c/econst/OSKextLogSpec | ||
| 294 | * OSKextLogSpec@/link</code>. | ||
| 295 | */ | ||
| 296 | #define kOSBundleEnableKextLoggingKey "OSBundleEnableKextLogging" | ||
| 297 | |||
| 298 | /*! | ||
| 299 | * @define kOSBundleIsInterfaceKey | ||
| 300 | * @abstract A boolean value indicating whether the kext executable | ||
| 301 | * contains only symbol references. | ||
| 302 | */ | ||
| 303 | #define kOSBundleIsInterfaceKey "OSBundleIsInterface" | ||
| 304 | |||
| 305 | /*! | ||
| 306 | * @define kOSBundleLibrariesKey | ||
| 307 | * @abstract A dictionary listing link dependencies for this kext. | ||
| 308 | * Keys are bundle identifiers, values are version strings. | ||
| 309 | */ | ||
| 310 | #define kOSBundleLibrariesKey "OSBundleLibraries" | ||
| 311 | |||
| 312 | /*! | ||
| 313 | * @define kOSBundleRequiredKey | ||
| 314 | * @abstract A string indicating in which kinds of startup this kext | ||
| 315 | * may need to load during early startup (before | ||
| 316 | * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code>). | ||
| 317 | * @discussion | ||
| 318 | * The value is one of: | ||
| 319 | * <ul> | ||
| 320 | * <li>@link kOSBundleRequiredRoot "OSBundleRequiredRoot"@/link</li> | ||
| 321 | * <li>@link kOSBundleRequiredLocalRoot "OSBundleRequiredLocalRoot"@/link</li> | ||
| 322 | * <li>@link kOSBundleRequiredNetworkRoot "OSBundleRequiredNetworkRoot"@/link</li> | ||
| 323 | * <li>@link kOSBundleRequiredSafeBoot "OSBundleRequiredSafeBoot"@/link</li> | ||
| 324 | * <li>@link kOSBundleRequiredConsole "OSBundleRequiredConsole"@/link</li> | ||
| 325 | * </ul> | ||
| 326 | * | ||
| 327 | * Use this property judiciously. | ||
| 328 | * Every kext that declares a value other than "OSBundleRequiredSafeBoot" | ||
| 329 | * increases startup time, as the booter must read it into memory, | ||
| 330 | * or startup kext caches must include it. | ||
| 331 | */ | ||
| 332 | #define kOSBundleRequiredKey "OSBundleRequired" | ||
| 333 | |||
| 334 | /*! | ||
| 335 | * @define kOSBundleRequireExplicitLoadKey | ||
| 336 | * @abstract A boolean value indicating whether the kext requires an | ||
| 337 | * explicit kextload in order to start/match. | ||
| 338 | */ | ||
| 339 | #define kOSBundleRequireExplicitLoadKey "OSBundleRequireExplicitLoad" | ||
| 340 | |||
| 341 | /*! | ||
| 342 | * @define kOSBundleAllowUserLoadKey | ||
| 343 | * @abstract A boolean value indicating whether | ||
| 344 | * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code> | ||
| 345 | * will honor a non-root process's request to load a kext. | ||
| 346 | * @discussion | ||
| 347 | * See <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithURL | ||
| 348 | * KextManagerLoadKextWithURL@/link</code> | ||
| 349 | * and <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithIdentifier | ||
| 350 | * KextManagerLoadKextWithIdentifier@/link</code>. | ||
| 351 | */ | ||
| 352 | #define kOSBundleAllowUserLoadKey "OSBundleAllowUserLoad" | ||
| 353 | |||
| 354 | /*! | ||
| 355 | * @define kOSBundleAllowUserTerminateKey | ||
| 356 | * @abstract A boolean value indicating whether the kextunload tool | ||
| 357 | * is allowed to issue IOService terminate to classes defined in this kext. | ||
| 358 | * @discussion A boolean value indicating whether the kextunload tool | ||
| 359 | * is allowed to issue IOService terminate to classes defined in this kext. | ||
| 360 | */ | ||
| 361 | #define kOSBundleAllowUserTerminateKey "OSBundleAllowUserTerminate" | ||
| 362 | |||
| 363 | /*! | ||
| 364 | * @define kOSKernelResourceKey | ||
| 365 | * @abstract A boolean value indicating whether the kext represents a built-in | ||
| 366 | * component of the kernel. | ||
| 367 | */ | ||
| 368 | #define kOSKernelResourceKey "OSKernelResource" | ||
| 369 | |||
| 370 | /*! | ||
| 371 | * @define kOSKextVariantOverrideKey | ||
| 372 | * @abstract A dictionary with target names as key and a target-specific variant | ||
| 373 | * name as value. | ||
| 374 | */ | ||
| 375 | #define kOSKextVariantOverrideKey "OSKextVariantOverride" | ||
| 376 | |||
| 377 | /*! | ||
| 378 | * @define kIOKitPersonalitiesKey | ||
| 379 | * @abstract A dictionary of dictionaries used in matching for I/O Kit drivers. | ||
| 380 | */ | ||
| 381 | #define kIOKitPersonalitiesKey "IOKitPersonalities" | ||
| 382 | |||
| 383 | /* | ||
| 384 | * @define kIOPersonalityPublisherKey | ||
| 385 | * @abstract Used in personalities sent to the I/O Kit, | ||
| 386 | * contains the CFBundleIdentifier of the kext | ||
| 387 | * that the personality originated in. | ||
| 388 | */ | ||
| 389 | #define kIOPersonalityPublisherKey "IOPersonalityPublisher" | ||
| 390 | |||
| 391 | #if CONFIG_KEC_FIPS | ||
| 392 | /* | ||
| 393 | * @define kAppleTextHashesKey | ||
| 394 | * @abstract A dictionary conataining hashes for corecrypto kext. | ||
| 395 | */ | ||
| 396 | #define kAppleTextHashesKey "AppleTextHashes" | ||
| 397 | #endif | ||
| 398 | |||
| 399 | /*! | ||
| 400 | * @define kOSMutableSegmentCopy | ||
| 401 | * @abstract A boolean value indicating whether the kext requires a copy of | ||
| 402 | * its mutable segments to be kept in memory, and then reset when the kext | ||
| 403 | * unloads. This should be used with caution as it will increase the | ||
| 404 | * amount of memory used by the kext. | ||
| 405 | */ | ||
| 406 | #define kOSMutableSegmentCopy "OSMutableSegmentCopy" | ||
| 407 | |||
| 408 | |||
| 409 | #if PRAGMA_MARK | ||
| 410 | /********************************************************************/ | ||
| 411 | #pragma mark Kext/OSBundle Property Deprecated Keys | ||
| 412 | /********************************************************************/ | ||
| 413 | #endif | ||
| 414 | /* | ||
| 415 | * @define kOSBundleDebugLevelKey | ||
| 416 | * @abstract | ||
| 417 | * Deprecated (used on some releases of Mac OS X prior to 10.6 Snow Leopard). | ||
| 418 | * Value is an integer from 1-6, corresponding to the verbose levels | ||
| 419 | * of kext tools on those releases. | ||
| 420 | * On 10.6 Snow Leopard, use <code>@link OSKextEnableKextLogging | ||
| 421 | * OSKextEnableKextLogging@/link</code>. | ||
| 422 | */ | ||
| 423 | #define kOSBundleDebugLevelKey "OSBundleDebugLevel" | ||
| 424 | |||
| 425 | /*! | ||
| 426 | * @define kOSBundleSharedExecutableIdentifierKey | ||
| 427 | * @abstract Deprecated (used on some releases of Mac OS X | ||
| 428 | * prior to 10.6 Snow Leopard). | ||
| 429 | * Value is the bundle identifier of the pseudokext | ||
| 430 | * that contains an executable shared by this kext. | ||
| 431 | */ | ||
| 432 | #define kOSBundleSharedExecutableIdentifierKey "OSBundleSharedExecutableIdentifier" | ||
| 433 | |||
| 434 | |||
| 435 | #if PRAGMA_MARK | ||
| 436 | /********************************************************************/ | ||
| 437 | #pragma mark Kext/OSBundle Property List Values | ||
| 438 | /********************************************************************/ | ||
| 439 | #endif | ||
| 440 | |||
| 441 | /*! | ||
| 442 | * @group Kext Property List Values | ||
| 443 | * These constants encompass established values | ||
| 444 | * for kernel extension bundle properties. | ||
| 445 | */ | ||
| 446 | |||
| 447 | /*! | ||
| 448 | * @define kOSKextKernelIdentifier | ||
| 449 | * @abstract | ||
| 450 | * This is the CFBundleIdentifier user for the kernel itself. | ||
| 451 | */ | ||
| 452 | #define kOSKextKernelIdentifier "__kernel__" | ||
| 453 | |||
| 454 | /*! | ||
| 455 | * @define kOSKextBundlePackageTypeKext | ||
| 456 | * @abstract | ||
| 457 | * The bundle type value for Kernel Extensions. | ||
| 458 | */ | ||
| 459 | #define kOSKextBundlePackageTypeKext "KEXT" | ||
| 460 | |||
| 461 | /*! | ||
| 462 | * @define kOSKextBundlePackageTypeDriverKit | ||
| 463 | * @abstract | ||
| 464 | * The bundle type value for Driver Extensions. | ||
| 465 | */ | ||
| 466 | #define kOSKextBundlePackageTypeDriverKit "DEXT" | ||
| 467 | |||
| 468 | /*! | ||
| 469 | * @define kOSBundleRequiredRoot | ||
| 470 | * @abstract | ||
| 471 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 472 | * value indicates that the kext may be needed to mount the root filesystem | ||
| 473 | * whether starting from a local or a network volume. | ||
| 474 | */ | ||
| 475 | #define kOSBundleRequiredRoot "Root" | ||
| 476 | |||
| 477 | /*! | ||
| 478 | * @define kOSBundleRequiredLocalRoot | ||
| 479 | * @abstract | ||
| 480 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 481 | * value indicates that the kext may be needed to mount the root filesystem | ||
| 482 | * when starting from a local disk. | ||
| 483 | */ | ||
| 484 | #define kOSBundleRequiredLocalRoot "Local-Root" | ||
| 485 | |||
| 486 | /*! | ||
| 487 | * @define kOSBundleRequiredNetworkRoot | ||
| 488 | * @abstract | ||
| 489 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 490 | * value indicates that the kext may be needed to mount the root filesystem | ||
| 491 | * when starting over a network connection. | ||
| 492 | */ | ||
| 493 | #define kOSBundleRequiredNetworkRoot "Network-Root" | ||
| 494 | |||
| 495 | /*! | ||
| 496 | * @define kOSBundleRequiredSafeBoot | ||
| 497 | * @abstract | ||
| 498 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 499 | * value indicates that the kext can be loaded during a safe startup. | ||
| 500 | * This value does not normally cause the kext to be read by the booter | ||
| 501 | * or included in startup kext caches. | ||
| 502 | */ | ||
| 503 | #define kOSBundleRequiredSafeBoot "Safe Boot" | ||
| 504 | |||
| 505 | /*! | ||
| 506 | * @define kOSBundleRequiredConsole | ||
| 507 | * @abstract | ||
| 508 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 509 | * value indicates that the kext may be needed for console access | ||
| 510 | * (specifically in a single-user startup when | ||
| 511 | * <code>@link //apple_ref/doc/man/8/kextd kextd(8)@/link</code>. | ||
| 512 | * does not run) | ||
| 513 | * and should be loaded during early startup. | ||
| 514 | */ | ||
| 515 | #define kOSBundleRequiredConsole "Console" | ||
| 516 | |||
| 517 | /*! | ||
| 518 | * @define kOSBundleRequiredDriverKit | ||
| 519 | * @abstract | ||
| 520 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 521 | * value indicates that the driver extension's (DriverKit driver's) | ||
| 522 | * personalities must be present in the kernel at early boot (specifically | ||
| 523 | * before <code>@link //apple_ref/doc/man/8/kextd kextd(8)@/link</code> starts) | ||
| 524 | * in order to compete with kexts built into the prelinkedkernel. Note that | ||
| 525 | * kextd is still required to launch the user space driver binary. The IOKit | ||
| 526 | * matching will happen during early boot, and the actual driver launch | ||
| 527 | * will happen after kextd starts. | ||
| 528 | */ | ||
| 529 | #define kOSBundleRequiredDriverKit "DriverKit" | ||
| 530 | |||
| 531 | #if PRAGMA_MARK | ||
| 532 | #pragma mark - | ||
| 533 | /********************************************************************/ | ||
| 534 | #pragma mark Kext Information | ||
| 535 | /********************************************************************/ | ||
| 536 | #endif | ||
| 537 | /*! | ||
| 538 | * @group Kext Information | ||
| 539 | * Types, constants, and macros providing a kext with information | ||
| 540 | * about itself. | ||
| 541 | */ | ||
| 542 | |||
| 543 | /*! | ||
| 544 | * @typedef OSKextLoadTag | ||
| 545 | * | ||
| 546 | * @abstract | ||
| 547 | * A unique identifier assigned to a loaded instanace of a kext. | ||
| 548 | * | ||
| 549 | * @discussion | ||
| 550 | * If a kext is unloaded and later reloaded, the new instance | ||
| 551 | * has a different load tag. | ||
| 552 | * | ||
| 553 | * A kext can get its own load tag in the <code>kmod_info_t</code> | ||
| 554 | * structure passed into its module start routine, as the | ||
| 555 | * <code>id</code> field (cast to this type). | ||
| 556 | */ | ||
| 557 | typedef uint32_t OSKextLoadTag; | ||
| 558 | |||
| 559 | /*! | ||
| 560 | * @define kOSKextInvalidLoadTag | ||
| 561 | * | ||
| 562 | * @abstract | ||
| 563 | * A load tag value that will never be used for a loaded kext; | ||
| 564 | * indicates kext not found. | ||
| 565 | */ | ||
| 566 | #define kOSKextInvalidLoadTag ((OSKextLoadTag)(-1)) | ||
| 567 | |||
| 568 | |||
| 569 | __END_DECLS | ||
| 570 | |||
| 571 | #endif /* _LIBKERN_OSKEXTLIB_H */ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.12-any/sys/attr.h created+592| ... | @@ -0,0 +1,592 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2018 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * attr.h - attribute data structures and interfaces | ||
| 31 | * | ||
| 32 | * Copyright (c) 1998, Apple Computer, Inc. All Rights Reserved. | ||
| 33 | */ | ||
| 34 | |||
| 35 | #ifndef _SYS_ATTR_H_ | ||
| 36 | #define _SYS_ATTR_H_ | ||
| 37 | |||
| 38 | #include <sys/appleapiopts.h> | ||
| 39 | |||
| 40 | #ifdef __APPLE_API_UNSTABLE | ||
| 41 | #include <sys/types.h> | ||
| 42 | #include <sys/ucred.h> | ||
| 43 | #include <sys/time.h> | ||
| 44 | #include <sys/cdefs.h> | ||
| 45 | |||
| 46 | #define FSOPT_NOFOLLOW 0x00000001 | ||
| 47 | #define FSOPT_NOINMEMUPDATE 0x00000002 | ||
| 48 | #define FSOPT_REPORT_FULLSIZE 0x00000004 | ||
| 49 | /* The following option only valid when requesting ATTR_CMN_RETURNED_ATTRS */ | ||
| 50 | #define FSOPT_PACK_INVAL_ATTRS 0x00000008 | ||
| 51 | |||
| 52 | |||
| 53 | #define FSOPT_ATTR_CMN_EXTENDED 0x00000020 | ||
| 54 | #define FSOPT_RETURN_REALDEV 0x00000200 | ||
| 55 | #define FSOPT_NOFOLLOW_ANY 0x00000800 | ||
| 56 | |||
| 57 | /* we currently aren't anywhere near this amount for a valid | ||
| 58 | * fssearchblock.sizeofsearchparams1 or fssearchblock.sizeofsearchparams2 | ||
| 59 | * but we put a sanity check in to avoid abuse of the value passed in from | ||
| 60 | * user land. | ||
| 61 | */ | ||
| 62 | #define SEARCHFS_MAX_SEARCHPARMS 4096 | ||
| 63 | |||
| 64 | typedef u_int32_t text_encoding_t; | ||
| 65 | |||
| 66 | typedef u_int32_t fsobj_type_t; | ||
| 67 | |||
| 68 | typedef u_int32_t fsobj_tag_t; | ||
| 69 | |||
| 70 | typedef u_int32_t fsfile_type_t; | ||
| 71 | |||
| 72 | typedef u_int32_t fsvolid_t; | ||
| 73 | |||
| 74 | #include <sys/_types/_fsobj_id_t.h> /* file object id type */ | ||
| 75 | |||
| 76 | typedef u_int32_t attrgroup_t; | ||
| 77 | |||
| 78 | struct attrlist { | ||
| 79 | 	u_short bitmapcount; /* number of attr. bit sets in list (should be 5) */ | ||
| 80 | 	u_int16_t reserved; /* (to maintain 4-byte alignment) */ | ||
| 81 | 	attrgroup_t commonattr; /* common attribute group */ | ||
| 82 | 	attrgroup_t volattr; /* Volume attribute group */ | ||
| 83 | 	attrgroup_t dirattr; /* directory attribute group */ | ||
| 84 | 	attrgroup_t fileattr; /* file attribute group */ | ||
| 85 | 	attrgroup_t forkattr; /* fork attribute group */ | ||
| 86 | }; | ||
| 87 | |||
| 88 | #define ATTR_BIT_MAP_COUNT 5 | ||
| 89 | |||
| 90 | typedef struct attribute_set { | ||
| 91 | 	attrgroup_t commonattr; /* common attribute group */ | ||
| 92 | 	attrgroup_t volattr; /* Volume attribute group */ | ||
| 93 | 	attrgroup_t dirattr; /* directory attribute group */ | ||
| 94 | 	attrgroup_t fileattr; /* file attribute group */ | ||
| 95 | 	attrgroup_t forkattr; /* fork attribute group */ | ||
| 96 | } attribute_set_t; | ||
| 97 | |||
| 98 | #define ATTRIBUTE_SET_INIT(a) do {(a)->commonattr = (a)->volattr = (a)->dirattr = (a)->fileattr = (a)->forkattr = 0; } while(0) | ||
| 99 | |||
| 100 | |||
| 101 | typedef struct attrreference { | ||
| 102 | 	int32_t attr_dataoffset; | ||
| 103 | 	u_int32_t attr_length; | ||
| 104 | } attrreference_t; | ||
| 105 | |||
| 106 | /* XXX PPD This is derived from HFSVolumePriv.h and should perhaps be referenced from there? */ | ||
| 107 | |||
| 108 | struct diskextent { | ||
| 109 | 	u_int32_t startblock; /* first block allocated */ | ||
| 110 | 	u_int32_t blockcount; /* number of blocks allocated */ | ||
| 111 | }; | ||
| 112 | |||
| 113 | typedef struct diskextent extentrecord[8]; | ||
| 114 | |||
| 115 | typedef u_int32_t vol_capabilities_set_t[4]; | ||
| 116 | |||
| 117 | #define VOL_CAPABILITIES_FORMAT 0 | ||
| 118 | #define VOL_CAPABILITIES_INTERFACES 1 | ||
| 119 | #define VOL_CAPABILITIES_RESERVED1 2 | ||
| 120 | #define VOL_CAPABILITIES_RESERVED2 3 | ||
| 121 | |||
| 122 | typedef struct vol_capabilities_attr { | ||
| 123 | 	vol_capabilities_set_t capabilities; | ||
| 124 | 	vol_capabilities_set_t valid; | ||
| 125 | } vol_capabilities_attr_t; | ||
| 126 | |||
| 127 | /* | ||
| 128 | * XXX this value needs to be raised - 3893388 | ||
| 129 | */ | ||
| 130 | #define ATTR_MAX_BUFFER 8192 | ||
| 131 | |||
| 132 | /* | ||
| 133 | * VOL_CAP_FMT_PERSISTENTOBJECTIDS: When set, the volume has object IDs | ||
| 134 | * that are persistent (retain their values even when the volume is | ||
| 135 | * unmounted and remounted), and a file or directory can be looked up | ||
| 136 | * by ID. Volumes that support VolFS and can support Carbon File ID | ||
| 137 | * references should set this bit. | ||
| 138 | * | ||
| 139 | * VOL_CAP_FMT_SYMBOLICLINKS: When set, the volume supports symbolic | ||
| 140 | * links. The symlink(), readlink(), and lstat() calls all use this | ||
| 141 | * symbolic link. | ||
| 142 | * | ||
| 143 | * VOL_CAP_FMT_HARDLINKS: When set, the volume supports hard links. | ||
| 144 | * The link() call creates hard links. | ||
| 145 | * | ||
| 146 | * VOL_CAP_FMT_JOURNAL: When set, the volume is capable of supporting | ||
| 147 | * a journal used to speed recovery in case of unplanned shutdown | ||
| 148 | * (such as a power outage or crash). This bit does not necessarily | ||
| 149 | * mean the volume is actively using a journal for recovery. | ||
| 150 | * | ||
| 151 | * VOL_CAP_FMT_JOURNAL_ACTIVE: When set, the volume is currently using | ||
| 152 | * a journal for use in speeding recovery after an unplanned shutdown. | ||
| 153 | * This bit can be set only if VOL_CAP_FMT_JOURNAL is also set. | ||
| 154 | * | ||
| 155 | * VOL_CAP_FMT_NO_ROOT_TIMES: When set, the volume format does not | ||
| 156 | * store reliable times for the root directory, so you should not | ||
| 157 | * depend on them to detect changes, etc. | ||
| 158 | * | ||
| 159 | * VOL_CAP_FMT_SPARSE_FILES: When set, the volume supports sparse files. | ||
| 160 | * That is, files which can have "holes" that have never been written | ||
| 161 | * to, and are not allocated on disk. Sparse files may have an | ||
| 162 | * allocated size that is less than the file's logical length. | ||
| 163 | * | ||
| 164 | * VOL_CAP_FMT_ZERO_RUNS: For security reasons, parts of a file (runs) | ||
| 165 | * that have never been written to must appear to contain zeroes. When | ||
| 166 | * this bit is set, the volume keeps track of allocated but unwritten | ||
| 167 | * runs of a file so that it can substitute zeroes without actually | ||
| 168 | * writing zeroes to the media. This provides performance similar to | ||
| 169 | * sparse files, but not the space savings. | ||
| 170 | * | ||
| 171 | * VOL_CAP_FMT_CASE_SENSITIVE: When set, file and directory names are | ||
| 172 | * case sensitive (upper and lower case are different). When clear, | ||
| 173 | * an upper case character is equivalent to a lower case character, | ||
| 174 | * and you can't have two names that differ solely in the case of | ||
| 175 | * the characters. | ||
| 176 | * | ||
| 177 | * VOL_CAP_FMT_CASE_PRESERVING: When set, file and directory names | ||
| 178 | * preserve the difference between upper and lower case. If clear, | ||
| 179 | * the volume may change the case of some characters (typically | ||
| 180 | * making them all upper or all lower case). A volume that sets | ||
| 181 | * VOL_CAP_FMT_CASE_SENSITIVE should also set VOL_CAP_FMT_CASE_PRESERVING. | ||
| 182 | * | ||
| 183 | * VOL_CAP_FMT_FAST_STATFS: This bit is used as a hint to upper layers | ||
| 184 | * (especially Carbon) that statfs() is fast enough that its results | ||
| 185 | * need not be cached by those upper layers. A volume that caches | ||
| 186 | * the statfs information in its in-memory structures should set this bit. | ||
| 187 | * A volume that must always read from disk or always perform a network | ||
| 188 | * transaction should not set this bit. | ||
| 189 | * | ||
| 190 | * VOL_CAP_FMT_2TB_FILESIZE: If this bit is set the volume format supports | ||
| 191 | * file sizes larger than 4GB, and potentially up to 2TB; it does not | ||
| 192 | * indicate whether the filesystem supports files larger than that. | ||
| 193 | * | ||
| 194 | * VOL_CAP_FMT_OPENDENYMODES: When set, the volume supports open deny | ||
| 195 | * modes (e.g. "open for read write, deny write"; effectively, mandatory | ||
| 196 | * file locking based on open modes). | ||
| 197 | * | ||
| 198 | * VOL_CAP_FMT_HIDDEN_FILES: When set, the volume supports the UF_HIDDEN | ||
| 199 | * file flag, and the UF_HIDDEN flag is mapped to that volume's native | ||
| 200 | * "hidden" or "invisible" bit (which may be the invisible bit from the | ||
| 201 | * Finder Info extended attribute). | ||
| 202 | * | ||
| 203 | * VOL_CAP_FMT_PATH_FROM_ID: When set, the volume supports the ability | ||
| 204 | * to derive a pathname to the root of the file system given only the | ||
| 205 | * id of an object. This also implies that object ids on this file | ||
| 206 | * system are persistent and not recycled. This is a very specialized | ||
| 207 | * capability and it is assumed that most file systems will not support | ||
| 208 | * it. Its use is for legacy non-posix APIs like ResolveFileIDRef. | ||
| 209 | * | ||
| 210 | * VOL_CAP_FMT_NO_VOLUME_SIZES: When set, the volume does not support | ||
| 211 | * returning values for total data blocks, available blocks, or free blocks | ||
| 212 | * (as in f_blocks, f_bavail, or f_bfree in "struct statfs"). Historically, | ||
| 213 | * those values were set to 0xFFFFFFFF for volumes that did not support them. | ||
| 214 | * | ||
| 215 | * VOL_CAP_FMT_DECMPFS_COMPRESSION: When set, the volume supports transparent | ||
| 216 | * decompression of compressed files using decmpfs. | ||
| 217 | * | ||
| 218 | * VOL_CAP_FMT_64BIT_OBJECT_IDS: When set, the volume uses object IDs that | ||
| 219 | * are 64-bit. This means that ATTR_CMN_FILEID and ATTR_CMN_PARENTID are the | ||
| 220 | * only legitimate attributes for obtaining object IDs from this volume and the | ||
| 221 | * 32-bit fid_objno fields of the fsobj_id_t returned by ATTR_CMN_OBJID, | ||
| 222 | * ATTR_CMN_OBJPERMID, and ATTR_CMN_PAROBJID are undefined. | ||
| 223 | * | ||
| 224 | * VOL_CAP_FMT_DIR_HARDLINKS: When set, the volume supports directory | ||
| 225 | * hard links. | ||
| 226 | * | ||
| 227 | * VOL_CAP_FMT_DOCUMENT_ID: When set, the volume supports document IDs | ||
| 228 | * (an ID which persists across object ID changes) for document revisions. | ||
| 229 | * | ||
| 230 | * VOL_CAP_FMT_WRITE_GENERATION_COUNT: When set, the volume supports write | ||
| 231 | * generation counts (a count of how many times an object has been modified) | ||
| 232 | * | ||
| 233 | * VOL_CAP_FMT_NO_IMMUTABLE_FILES: When set, the volume does not support | ||
| 234 | * setting the UF_IMMUTABLE flag. | ||
| 235 | * | ||
| 236 | * VOL_CAP_FMT_NO_PERMISSIONS: When set, the volume does not support setting | ||
| 237 | * permissions. | ||
| 238 | * | ||
| 239 | * VOL_CAP_FMT_SHARED_SPACE: When set, the volume supports sharing space with | ||
| 240 | * other filesystems i.e. multiple logical filesystems can exist in the same | ||
| 241 | * "partition". An implication of this is that the filesystem which sets | ||
| 242 | * this capability treats waitfor arguments to VFS_SYNC as bit flags. | ||
| 243 | * | ||
| 244 | * VOL_CAP_FMT_VOL_GROUPS: When set, this volume is part of a volume-group | ||
| 245 | * that implies multiple volumes must be mounted in order to boot and root the | ||
| 246 | * operating system. Typically, this means a read-only system volume and a | ||
| 247 | * writable data volume. | ||
| 248 | * | ||
| 249 | * VOL_CAP_FMT_SEALED: When set, this volume is cryptographically sealed. | ||
| 250 | * Any modifications to volume data or metadata will be detected and may | ||
| 251 | * render the volume unusable. | ||
| 252 | */ | ||
| 253 | #define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001 | ||
| 254 | #define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002 | ||
| 255 | #define VOL_CAP_FMT_HARDLINKS 0x00000004 | ||
| 256 | #define VOL_CAP_FMT_JOURNAL 0x00000008 | ||
| 257 | #define VOL_CAP_FMT_JOURNAL_ACTIVE 0x00000010 | ||
| 258 | #define VOL_CAP_FMT_NO_ROOT_TIMES 0x00000020 | ||
| 259 | #define VOL_CAP_FMT_SPARSE_FILES 0x00000040 | ||
| 260 | #define VOL_CAP_FMT_ZERO_RUNS 0x00000080 | ||
| 261 | #define VOL_CAP_FMT_CASE_SENSITIVE 0x00000100 | ||
| 262 | #define VOL_CAP_FMT_CASE_PRESERVING 0x00000200 | ||
| 263 | #define VOL_CAP_FMT_FAST_STATFS 0x00000400 | ||
| 264 | #define VOL_CAP_FMT_2TB_FILESIZE 0x00000800 | ||
| 265 | #define VOL_CAP_FMT_OPENDENYMODES 0x00001000 | ||
| 266 | #define VOL_CAP_FMT_HIDDEN_FILES 0x00002000 | ||
| 267 | #define VOL_CAP_FMT_PATH_FROM_ID 0x00004000 | ||
| 268 | #define VOL_CAP_FMT_NO_VOLUME_SIZES 0x00008000 | ||
| 269 | #define VOL_CAP_FMT_DECMPFS_COMPRESSION 0x00010000 | ||
| 270 | #define VOL_CAP_FMT_64BIT_OBJECT_IDS 0x00020000 | ||
| 271 | #define VOL_CAP_FMT_DIR_HARDLINKS 0x00040000 | ||
| 272 | #define VOL_CAP_FMT_DOCUMENT_ID 0x00080000 | ||
| 273 | #define VOL_CAP_FMT_WRITE_GENERATION_COUNT 0x00100000 | ||
| 274 | #define VOL_CAP_FMT_NO_IMMUTABLE_FILES 0x00200000 | ||
| 275 | #define VOL_CAP_FMT_NO_PERMISSIONS 0x00400000 | ||
| 276 | #define VOL_CAP_FMT_SHARED_SPACE 0x00800000 | ||
| 277 | #define VOL_CAP_FMT_VOL_GROUPS 0x01000000 | ||
| 278 | #define VOL_CAP_FMT_SEALED 0x02000000 | ||
| 279 | |||
| 280 | /* | ||
| 281 | * VOL_CAP_INT_SEARCHFS: When set, the volume implements the | ||
| 282 | * searchfs() system call (the vnop_searchfs vnode operation). | ||
| 283 | * | ||
| 284 | * VOL_CAP_INT_ATTRLIST: When set, the volume implements the | ||
| 285 | * getattrlist() and setattrlist() system calls (vnop_getattrlist | ||
| 286 | * and vnop_setattrlist vnode operations) for the volume, files, | ||
| 287 | * and directories. The volume may or may not implement the | ||
| 288 | * readdirattr() system call. XXX Is there any minimum set | ||
| 289 | * of attributes that should be supported? To determine the | ||
| 290 | * set of supported attributes, get the ATTR_VOL_ATTRIBUTES | ||
| 291 | * attribute of the volume. | ||
| 292 | * | ||
| 293 | * VOL_CAP_INT_NFSEXPORT: When set, the volume implements exporting | ||
| 294 | * of NFS volumes. | ||
| 295 | * | ||
| 296 | * VOL_CAP_INT_READDIRATTR: When set, the volume implements the | ||
| 297 | * readdirattr() system call (vnop_readdirattr vnode operation). | ||
| 298 | * | ||
| 299 | * VOL_CAP_INT_EXCHANGEDATA: When set, the volume implements the | ||
| 300 | * exchangedata() system call (VNOP_EXCHANGE vnode operation). | ||
| 301 | * | ||
| 302 | * VOL_CAP_INT_COPYFILE: When set, the volume implements the | ||
| 303 | * VOP_COPYFILE vnode operation. (XXX There should be a copyfile() | ||
| 304 | * system call in <unistd.h>.) | ||
| 305 | * | ||
| 306 | * VOL_CAP_INT_ALLOCATE: When set, the volume implements the | ||
| 307 | * VNOP_ALLOCATE vnode operation, which means it implements the | ||
| 308 | * F_PREALLOCATE selector of fcntl(2). | ||
| 309 | * | ||
| 310 | * VOL_CAP_INT_VOL_RENAME: When set, the volume implements the | ||
| 311 | * ATTR_VOL_NAME attribute for both getattrlist() and setattrlist(). | ||
| 312 | * The volume can be renamed by setting ATTR_VOL_NAME with setattrlist(). | ||
| 313 | * | ||
| 314 | * VOL_CAP_INT_ADVLOCK: When set, the volume implements POSIX style | ||
| 315 | * byte range locks via vnop_advlock (accessible from fcntl(2)). | ||
| 316 | * | ||
| 317 | * VOL_CAP_INT_FLOCK: When set, the volume implements whole-file flock(2) | ||
| 318 | * style locks via vnop_advlock. This includes the O_EXLOCK and O_SHLOCK | ||
| 319 | * flags of the open(2) call. | ||
| 320 | * | ||
| 321 | * VOL_CAP_INT_EXTENDED_SECURITY: When set, the volume implements | ||
| 322 | * extended security (ACLs). | ||
| 323 | * | ||
| 324 | * VOL_CAP_INT_USERACCESS: When set, the volume supports the | ||
| 325 | * ATTR_CMN_USERACCESS attribute (used to get the user's access | ||
| 326 | * mode to the file). | ||
| 327 | * | ||
| 328 | * VOL_CAP_INT_MANLOCK: When set, the volume supports AFP-style | ||
| 329 | * mandatory byte range locks via an ioctl(). | ||
| 330 | * | ||
| 331 | * VOL_CAP_INT_EXTENDED_ATTR: When set, the volume implements | ||
| 332 | * native extended attribues. | ||
| 333 | * | ||
| 334 | * VOL_CAP_INT_NAMEDSTREAMS: When set, the volume supports | ||
| 335 | * native named streams. | ||
| 336 | * | ||
| 337 | * VOL_CAP_INT_CLONE: When set, the volume supports clones. | ||
| 338 | * | ||
| 339 | * VOL_CAP_INT_SNAPSHOT: When set, the volume supports snapshots. | ||
| 340 | * | ||
| 341 | * VOL_CAP_INT_RENAME_SWAP: When set, the volume supports swapping | ||
| 342 | * file system objects. | ||
| 343 | * | ||
| 344 | * VOL_CAP_INT_RENAME_EXCL: When set, the volume supports an | ||
| 345 | * exclusive rename operation. | ||
| 346 | * | ||
| 347 | * VOL_CAP_INT_RENAME_OPENFAIL: When set, the volume may fail rename | ||
| 348 | * operations on files that are open. | ||
| 349 | */ | ||
| 350 | #define VOL_CAP_INT_SEARCHFS 0x00000001 | ||
| 351 | #define VOL_CAP_INT_ATTRLIST 0x00000002 | ||
| 352 | #define VOL_CAP_INT_NFSEXPORT 0x00000004 | ||
| 353 | #define VOL_CAP_INT_READDIRATTR 0x00000008 | ||
| 354 | #define VOL_CAP_INT_EXCHANGEDATA 0x00000010 | ||
| 355 | #define VOL_CAP_INT_COPYFILE 0x00000020 | ||
| 356 | #define VOL_CAP_INT_ALLOCATE 0x00000040 | ||
| 357 | #define VOL_CAP_INT_VOL_RENAME 0x00000080 | ||
| 358 | #define VOL_CAP_INT_ADVLOCK 0x00000100 | ||
| 359 | #define VOL_CAP_INT_FLOCK 0x00000200 | ||
| 360 | #define VOL_CAP_INT_EXTENDED_SECURITY 0x00000400 | ||
| 361 | #define VOL_CAP_INT_USERACCESS 0x00000800 | ||
| 362 | #define VOL_CAP_INT_MANLOCK 0x00001000 | ||
| 363 | #define VOL_CAP_INT_NAMEDSTREAMS 0x00002000 | ||
| 364 | #define VOL_CAP_INT_EXTENDED_ATTR 0x00004000 | ||
| 365 | #define VOL_CAP_INT_CLONE 0x00010000 | ||
| 366 | #define VOL_CAP_INT_SNAPSHOT 0x00020000 | ||
| 367 | #define VOL_CAP_INT_RENAME_SWAP 0x00040000 | ||
| 368 | #define VOL_CAP_INT_RENAME_EXCL 0x00080000 | ||
| 369 | #define VOL_CAP_INT_RENAME_OPENFAIL 0x00100000 | ||
| 370 | |||
| 371 | typedef struct vol_attributes_attr { | ||
| 372 | 	attribute_set_t validattr; | ||
| 373 | 	attribute_set_t nativeattr; | ||
| 374 | } vol_attributes_attr_t; | ||
| 375 | |||
| 376 | #define ATTR_CMN_NAME 0x00000001 | ||
| 377 | #define ATTR_CMN_DEVID 0x00000002 | ||
| 378 | #define ATTR_CMN_FSID 0x00000004 | ||
| 379 | #define ATTR_CMN_OBJTYPE 0x00000008 | ||
| 380 | #define ATTR_CMN_OBJTAG 0x00000010 | ||
| 381 | #define ATTR_CMN_OBJID 0x00000020 | ||
| 382 | #define ATTR_CMN_OBJPERMANENTID 0x00000040 | ||
| 383 | #define ATTR_CMN_PAROBJID 0x00000080 | ||
| 384 | #define ATTR_CMN_SCRIPT 0x00000100 | ||
| 385 | #define ATTR_CMN_CRTIME 0x00000200 | ||
| 386 | #define ATTR_CMN_MODTIME 0x00000400 | ||
| 387 | #define ATTR_CMN_CHGTIME 0x00000800 | ||
| 388 | #define ATTR_CMN_ACCTIME 0x00001000 | ||
| 389 | #define ATTR_CMN_BKUPTIME 0x00002000 | ||
| 390 | #define ATTR_CMN_FNDRINFO 0x00004000 | ||
| 391 | #define ATTR_CMN_OWNERID 0x00008000 | ||
| 392 | #define ATTR_CMN_GRPID 0x00010000 | ||
| 393 | #define ATTR_CMN_ACCESSMASK 0x00020000 | ||
| 394 | #define ATTR_CMN_FLAGS 0x00040000 | ||
| 395 | |||
| 396 | /* The following were defined as:				*/ | ||
| 397 | /* #define ATTR_CMN_NAMEDATTRCOUNT		0x00080000	*/ | ||
| 398 | /* #define ATTR_CMN_NAMEDATTRLIST		0x00100000	*/ | ||
| 399 | /* These bits have been salvaged for use as:			*/ | ||
| 400 | /*	#define ATTR_CMN_GEN_COUNT		0x00080000	*/ | ||
| 401 | /*	#define ATTR_CMN_DOCUMENT_ID		0x00100000	*/ | ||
| 402 | /* They can only be used with the FSOPT_ATTR_CMN_EXTENDED	*/ | ||
| 403 | /* option flag. */ | ||
| 404 | |||
| 405 | #define ATTR_CMN_GEN_COUNT 0x00080000 | ||
| 406 | #define ATTR_CMN_DOCUMENT_ID 0x00100000 | ||
| 407 | |||
| 408 | #define ATTR_CMN_USERACCESS 0x00200000 | ||
| 409 | #define ATTR_CMN_EXTENDED_SECURITY 0x00400000 | ||
| 410 | #define ATTR_CMN_UUID 0x00800000 | ||
| 411 | #define ATTR_CMN_GRPUUID 0x01000000 | ||
| 412 | #define ATTR_CMN_FILEID 0x02000000 | ||
| 413 | #define ATTR_CMN_PARENTID 0x04000000 | ||
| 414 | #define ATTR_CMN_FULLPATH 0x08000000 | ||
| 415 | #define ATTR_CMN_ADDEDTIME 0x10000000 | ||
| 416 | #define ATTR_CMN_ERROR 0x20000000 | ||
| 417 | #define ATTR_CMN_DATA_PROTECT_FLAGS 0x40000000 | ||
| 418 | |||
| 419 | /* | ||
| 420 | * ATTR_CMN_RETURNED_ATTRS is only valid with getattrlist(2) and | ||
| 421 | * getattrlistbulk(2). It is always the first attribute in the return buffer. | ||
| 422 | */ | ||
| 423 | #define ATTR_CMN_RETURNED_ATTRS 0x80000000 | ||
| 424 | |||
| 425 | #define ATTR_CMN_VALIDMASK 0xFFFFFFFF | ||
| 426 | /* | ||
| 427 | * The settable ATTR_CMN_* attributes include the following: | ||
| 428 | * ATTR_CMN_SCRIPT | ||
| 429 | * ATTR_CMN_CRTIME | ||
| 430 | * ATTR_CMN_MODTIME | ||
| 431 | * ATTR_CMN_CHGTIME | ||
| 432 | * | ||
| 433 | * ATTR_CMN_ACCTIME | ||
| 434 | * ATTR_CMN_BKUPTIME | ||
| 435 | * ATTR_CMN_FNDRINFO | ||
| 436 | * ATTR_CMN_OWNERID | ||
| 437 | * | ||
| 438 | * ATTR_CMN_GRPID | ||
| 439 | * ATTR_CMN_ACCESSMASK | ||
| 440 | * ATTR_CMN_FLAGS | ||
| 441 | * | ||
| 442 | * ATTR_CMN_EXTENDED_SECURITY | ||
| 443 | * ATTR_CMN_UUID | ||
| 444 | * | ||
| 445 | * ATTR_CMN_GRPUUID | ||
| 446 | * | ||
| 447 | * ATTR_CMN_DATA_PROTECT_FLAGS | ||
| 448 | */ | ||
| 449 | #define ATTR_CMN_SETMASK 0x51C7FF00 | ||
| 450 | #define ATTR_CMN_VOLSETMASK 0x00006700 | ||
| 451 | |||
| 452 | #define ATTR_VOL_FSTYPE 0x00000001 | ||
| 453 | #define ATTR_VOL_SIGNATURE 0x00000002 | ||
| 454 | #define ATTR_VOL_SIZE 0x00000004 | ||
| 455 | #define ATTR_VOL_SPACEFREE 0x00000008 | ||
| 456 | #define ATTR_VOL_SPACEAVAIL 0x00000010 | ||
| 457 | #define ATTR_VOL_MINALLOCATION 0x00000020 | ||
| 458 | #define ATTR_VOL_ALLOCATIONCLUMP 0x00000040 | ||
| 459 | #define ATTR_VOL_IOBLOCKSIZE 0x00000080 | ||
| 460 | #define ATTR_VOL_OBJCOUNT 0x00000100 | ||
| 461 | #define ATTR_VOL_FILECOUNT 0x00000200 | ||
| 462 | #define ATTR_VOL_DIRCOUNT 0x00000400 | ||
| 463 | #define ATTR_VOL_MAXOBJCOUNT 0x00000800 | ||
| 464 | #define ATTR_VOL_MOUNTPOINT 0x00001000 | ||
| 465 | #define ATTR_VOL_NAME 0x00002000 | ||
| 466 | #define ATTR_VOL_MOUNTFLAGS 0x00004000 | ||
| 467 | #define ATTR_VOL_MOUNTEDDEVICE 0x00008000 | ||
| 468 | #define ATTR_VOL_ENCODINGSUSED 0x00010000 | ||
| 469 | #define ATTR_VOL_CAPABILITIES 0x00020000 | ||
| 470 | #define ATTR_VOL_UUID 0x00040000 | ||
| 471 | #define ATTR_VOL_SPACEUSED 0x00800000 | ||
| 472 | #define ATTR_VOL_QUOTA_SIZE 0x10000000 | ||
| 473 | #define ATTR_VOL_RESERVED_SIZE 0x20000000 | ||
| 474 | #define ATTR_VOL_ATTRIBUTES 0x40000000 | ||
| 475 | #define ATTR_VOL_INFO 0x80000000 | ||
| 476 | |||
| 477 | #define ATTR_VOL_VALIDMASK 0xF087FFFF | ||
| 478 | |||
| 479 | /* | ||
| 480 | * The list of settable ATTR_VOL_* attributes include the following: | ||
| 481 | * ATTR_VOL_NAME | ||
| 482 | * ATTR_VOL_INFO | ||
| 483 | */ | ||
| 484 | #define ATTR_VOL_SETMASK 0x80002000 | ||
| 485 | |||
| 486 | |||
| 487 | /* File/directory attributes: */ | ||
| 488 | #define ATTR_DIR_LINKCOUNT 0x00000001 | ||
| 489 | #define ATTR_DIR_ENTRYCOUNT 0x00000002 | ||
| 490 | #define ATTR_DIR_MOUNTSTATUS 0x00000004 | ||
| 491 | #define ATTR_DIR_ALLOCSIZE 0x00000008 | ||
| 492 | #define ATTR_DIR_IOBLOCKSIZE 0x00000010 | ||
| 493 | #define ATTR_DIR_DATALENGTH 0x00000020 | ||
| 494 | |||
| 495 | /* ATTR_DIR_MOUNTSTATUS Flags: */ | ||
| 496 | #define DIR_MNTSTATUS_MNTPOINT 0x00000001 | ||
| 497 | #define DIR_MNTSTATUS_TRIGGER 0x00000002 | ||
| 498 | |||
| 499 | #define ATTR_DIR_VALIDMASK 0x0000003f | ||
| 500 | #define ATTR_DIR_SETMASK 0x00000000 | ||
| 501 | |||
| 502 | #define ATTR_FILE_LINKCOUNT 0x00000001 | ||
| 503 | #define ATTR_FILE_TOTALSIZE 0x00000002 | ||
| 504 | #define ATTR_FILE_ALLOCSIZE 0x00000004 | ||
| 505 | #define ATTR_FILE_IOBLOCKSIZE 0x00000008 | ||
| 506 | #define ATTR_FILE_DEVTYPE 0x00000020 | ||
| 507 | #define ATTR_FILE_FORKCOUNT 0x00000080 | ||
| 508 | #define ATTR_FILE_FORKLIST 0x00000100 | ||
| 509 | #define ATTR_FILE_DATALENGTH 0x00000200 | ||
| 510 | #define ATTR_FILE_DATAALLOCSIZE 0x00000400 | ||
| 511 | #define ATTR_FILE_RSRCLENGTH 0x00001000 | ||
| 512 | #define ATTR_FILE_RSRCALLOCSIZE 0x00002000 | ||
| 513 | |||
| 514 | #define ATTR_FILE_VALIDMASK 0x000037FF | ||
| 515 | /* | ||
| 516 | * Settable ATTR_FILE_* attributes include: | ||
| 517 | * ATTR_FILE_DEVTYPE | ||
| 518 | */ | ||
| 519 | #define ATTR_FILE_SETMASK 0x00000020 | ||
| 520 | |||
| 521 | /* CMNEXT attributes extend the common attributes, but in the forkattr field */ | ||
| 522 | #define ATTR_CMNEXT_RELPATH 0x00000004 | ||
| 523 | #define ATTR_CMNEXT_PRIVATESIZE 0x00000008 | ||
| 524 | #define ATTR_CMNEXT_LINKID 0x00000010 | ||
| 525 | #define ATTR_CMNEXT_NOFIRMLINKPATH 0x00000020 | ||
| 526 | #define ATTR_CMNEXT_REALDEVID 0x00000040 | ||
| 527 | #define ATTR_CMNEXT_REALFSID 0x00000080 | ||
| 528 | #define ATTR_CMNEXT_CLONEID 0x00000100 | ||
| 529 | #define ATTR_CMNEXT_EXT_FLAGS 0x00000200 | ||
| 530 | #define ATTR_CMNEXT_RECURSIVE_GENCOUNT 0x00000400 | ||
| 531 | |||
| 532 | #define ATTR_CMNEXT_VALIDMASK 0x000007fc | ||
| 533 | #define ATTR_CMNEXT_SETMASK 0x00000000 | ||
| 534 | |||
| 535 | /* Deprecated fork attributes */ | ||
| 536 | #define ATTR_FORK_TOTALSIZE 0x00000001 | ||
| 537 | #define ATTR_FORK_ALLOCSIZE 0x00000002 | ||
| 538 | #define ATTR_FORK_RESERVED 0xffffffff | ||
| 539 | |||
| 540 | #define ATTR_FORK_VALIDMASK 0x00000003 | ||
| 541 | #define ATTR_FORK_SETMASK 0x00000000 | ||
| 542 | |||
| 543 | /* Obsolete, implemented, not supported */ | ||
| 544 | #define ATTR_CMN_NAMEDATTRCOUNT 0x00080000 | ||
| 545 | #define ATTR_CMN_NAMEDATTRLIST 0x00100000 | ||
| 546 | #define ATTR_FILE_CLUMPSIZE 0x00000010 /* obsolete */ | ||
| 547 | #define ATTR_FILE_FILETYPE 0x00000040 /* always zero */ | ||
| 548 | #define ATTR_FILE_DATAEXTENTS 0x00000800 /* obsolete, HFS-specific */ | ||
| 549 | #define ATTR_FILE_RSRCEXTENTS 0x00004000 /* obsolete, HFS-specific */ | ||
| 550 | |||
| 551 | /* Required attributes for getattrlistbulk(2) */ | ||
| 552 | #define ATTR_BULK_REQUIRED (ATTR_CMN_NAME | ATTR_CMN_RETURNED_ATTRS) | ||
| 553 | |||
| 554 | /* | ||
| 555 | * Searchfs | ||
| 556 | */ | ||
| 557 | #define SRCHFS_START 0x00000001 | ||
| 558 | #define SRCHFS_MATCHPARTIALNAMES 0x00000002 | ||
| 559 | #define SRCHFS_MATCHDIRS 0x00000004 | ||
| 560 | #define SRCHFS_MATCHFILES 0x00000008 | ||
| 561 | #define SRCHFS_SKIPLINKS 0x00000010 | ||
| 562 | #define SRCHFS_SKIPINVISIBLE 0x00000020 | ||
| 563 | #define SRCHFS_SKIPPACKAGES 0x00000040 | ||
| 564 | #define SRCHFS_SKIPINAPPROPRIATE 0x00000080 | ||
| 565 | |||
| 566 | #define SRCHFS_NEGATEPARAMS 0x80000000 | ||
| 567 | #define SRCHFS_VALIDOPTIONSMASK 0x800000FF | ||
| 568 | |||
| 569 | struct fssearchblock { | ||
| 570 | 	struct attrlist *returnattrs; | ||
| 571 | 	void *returnbuffer; | ||
| 572 | 	size_t returnbuffersize; | ||
| 573 | 	u_long maxmatches; | ||
| 574 | 	struct timeval timelimit; | ||
| 575 | 	void *searchparams1; | ||
| 576 | 	size_t sizeofsearchparams1; | ||
| 577 | 	void *searchparams2; | ||
| 578 | 	size_t sizeofsearchparams2; | ||
| 579 | 	struct attrlist searchattrs; | ||
| 580 | }; | ||
| 581 | |||
| 582 | |||
| 583 | struct searchstate { | ||
| 584 | 	uint32_t ss_union_flags; // for SRCHFS_START | ||
| 585 | 	uint32_t ss_union_layer; // 0 = top | ||
| 586 | 	u_char ss_fsstate[548]; // fs private | ||
| 587 | } __attribute__((packed)); | ||
| 588 | |||
| 589 | #define FST_EOF (-1) /* end-of-file offset */ | ||
| 590 | |||
| 591 | #endif /* __APPLE_API_UNSTABLE */ | ||
| 592 | #endif /* !_SYS_ATTR_H_ */ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.12-any/unistd.h created+791| ... | @@ -0,0 +1,791 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, 2002-2006, 2008-2010, 2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /*- | ||
| 24 | * Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved | ||
| 25 | * Copyright (c) 1991, 1993, 1994 | ||
| 26 | *	The Regents of the University of California. All rights reserved. | ||
| 27 | * | ||
| 28 | * Redistribution and use in source and binary forms, with or without | ||
| 29 | * modification, are permitted provided that the following conditions | ||
| 30 | * are met: | ||
| 31 | * 1. Redistributions of source code must retain the above copyright | ||
| 32 | * notice, this list of conditions and the following disclaimer. | ||
| 33 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 34 | * notice, this list of conditions and the following disclaimer in the | ||
| 35 | * documentation and/or other materials provided with the distribution. | ||
| 36 | * 3. All advertising materials mentioning features or use of this software | ||
| 37 | * must display the following acknowledgement: | ||
| 38 | *	This product includes software developed by the University of | ||
| 39 | *	California, Berkeley and its contributors. | ||
| 40 | * 4. Neither the name of the University nor the names of its contributors | ||
| 41 | * may be used to endorse or promote products derived from this software | ||
| 42 | * without specific prior written permission. | ||
| 43 | * | ||
| 44 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 45 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 46 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 47 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 48 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 49 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 50 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 51 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 52 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 53 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 54 | * SUCH DAMAGE. | ||
| 55 | * | ||
| 56 | *	@(#)unistd.h	8.12 (Berkeley) 4/27/95 | ||
| 57 | * | ||
| 58 | * Copyright (c) 1998 Apple Compter, Inc. | ||
| 59 | * All Rights Reserved | ||
| 60 | */ | ||
| 61 | |||
| 62 | /* History: | ||
| 63 | 7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr | ||
| 64 | 3/26/98 CHW at Apple added real interface to searchfs call | ||
| 65 | 	3/5/98 CHW at Apple added hfs semantic system calls headers | ||
| 66 | */ | ||
| 67 | |||
| 68 | #ifndef _UNISTD_H_ | ||
| 69 | #define	_UNISTD_H_ | ||
| 70 | |||
| 71 | #include <_types.h> | ||
| 72 | #include <sys/unistd.h> | ||
| 73 | #include <Availability.h> | ||
| 74 | #include <sys/_types/_gid_t.h> | ||
| 75 | #include <sys/_types/_intptr_t.h> | ||
| 76 | #include <sys/_types/_off_t.h> | ||
| 77 | #include <sys/_types/_pid_t.h> | ||
| 78 | /* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: | ||
| 79 | * _GCC_SIZE_T */ | ||
| 80 | #include <sys/_types/_size_t.h> | ||
| 81 | #include <sys/_types/_ssize_t.h> | ||
| 82 | #include <sys/_types/_uid_t.h> | ||
| 83 | #include <sys/_types/_useconds_t.h> | ||
| 84 | #include <sys/_types/_null.h> | ||
| 85 | |||
| 86 | #define	 STDIN_FILENO	0	/* standard input file descriptor */ | ||
| 87 | #define	STDOUT_FILENO	1	/* standard output file descriptor */ | ||
| 88 | #define	STDERR_FILENO	2	/* standard error file descriptor */ | ||
| 89 | |||
| 90 | |||
| 91 | /* Version test macros */ | ||
| 92 | /* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */ | ||
| 93 | #define	_XOPEN_VERSION			600		/* [XSI] */ | ||
| 94 | #define	_XOPEN_XCU_VERSION		4		/* Older standard */ | ||
| 95 | |||
| 96 | |||
| 97 | /* Please keep this list in the same order as the applicable standard */ | ||
| 98 | #define	_POSIX_ADVISORY_INFO		(-1)		/* [ADV] */ | ||
| 99 | #define	_POSIX_ASYNCHRONOUS_IO		(-1)		/* [AIO] */ | ||
| 100 | #define	_POSIX_BARRIERS			(-1)		/* [BAR] */ | ||
| 101 | #define	_POSIX_CHOWN_RESTRICTED		200112L | ||
| 102 | #define	_POSIX_CLOCK_SELECTION		(-1)		/* [CS] */ | ||
| 103 | #define	_POSIX_CPUTIME			(-1)		/* [CPT] */ | ||
| 104 | #define	_POSIX_FSYNC			200112L		/* [FSC] */ | ||
| 105 | #define	_POSIX_IPV6			200112L | ||
| 106 | #define	_POSIX_JOB_CONTROL		200112L | ||
| 107 | #define	_POSIX_MAPPED_FILES		200112L		/* [MF] */ | ||
| 108 | #define	_POSIX_MEMLOCK			(-1)		/* [ML] */ | ||
| 109 | #define	_POSIX_MEMLOCK_RANGE		(-1)		/* [MR] */ | ||
| 110 | #define	_POSIX_MEMORY_PROTECTION	200112L		/* [MPR] */ | ||
| 111 | #define	_POSIX_MESSAGE_PASSING		(-1)		/* [MSG] */ | ||
| 112 | #define	_POSIX_MONOTONIC_CLOCK		(-1)		/* [MON] */ | ||
| 113 | #define	_POSIX_NO_TRUNC			200112L | ||
| 114 | #define	_POSIX_PRIORITIZED_IO		(-1)		/* [PIO] */ | ||
| 115 | #define	_POSIX_PRIORITY_SCHEDULING	(-1)		/* [PS] */ | ||
| 116 | #define	_POSIX_RAW_SOCKETS		(-1)		/* [RS] */ | ||
| 117 | #define	_POSIX_READER_WRITER_LOCKS	200112L		/* [THR] */ | ||
| 118 | #define	_POSIX_REALTIME_SIGNALS		(-1)		/* [RTS] */ | ||
| 119 | #define	_POSIX_REGEXP			200112L | ||
| 120 | #define	_POSIX_SAVED_IDS		200112L		/* XXX required */ | ||
| 121 | #define	_POSIX_SEMAPHORES		(-1)		/* [SEM] */ | ||
| 122 | #define	_POSIX_SHARED_MEMORY_OBJECTS	(-1)		/* [SHM] */ | ||
| 123 | #define	_POSIX_SHELL			200112L | ||
| 124 | #define	_POSIX_SPAWN			(-1)		/* [SPN] */ | ||
| 125 | #define	_POSIX_SPIN_LOCKS		(-1)		/* [SPI] */ | ||
| 126 | #define	_POSIX_SPORADIC_SERVER		(-1)		/* [SS] */ | ||
| 127 | #define	_POSIX_SYNCHRONIZED_IO		(-1)		/* [SIO] */ | ||
| 128 | #define	_POSIX_THREAD_ATTR_STACKADDR	200112L		/* [TSA] */ | ||
| 129 | #define	_POSIX_THREAD_ATTR_STACKSIZE	200112L		/* [TSS] */ | ||
| 130 | #define	_POSIX_THREAD_CPUTIME		(-1)		/* [TCT] */ | ||
| 131 | #define	_POSIX_THREAD_PRIO_INHERIT	(-1)		/* [TPI] */ | ||
| 132 | #define	_POSIX_THREAD_PRIO_PROTECT	(-1)		/* [TPP] */ | ||
| 133 | #define	_POSIX_THREAD_PRIORITY_SCHEDULING	(-1)	/* [TPS] */ | ||
| 134 | #define	_POSIX_THREAD_PROCESS_SHARED	200112L		/* [TSH] */ | ||
| 135 | #define	_POSIX_THREAD_SAFE_FUNCTIONS	200112L		/* [TSF] */ | ||
| 136 | #define	_POSIX_THREAD_SPORADIC_SERVER	(-1)		/* [TSP] */ | ||
| 137 | #define	_POSIX_THREADS			200112L		/* [THR] */ | ||
| 138 | #define	_POSIX_TIMEOUTS			(-1)		/* [TMO] */ | ||
| 139 | #define	_POSIX_TIMERS			(-1)		/* [TMR] */ | ||
| 140 | #define	_POSIX_TRACE			(-1)		/* [TRC] */ | ||
| 141 | #define	_POSIX_TRACE_EVENT_FILTER	(-1)		/* [TEF] */ | ||
| 142 | #define	_POSIX_TRACE_INHERIT		(-1)		/* [TRI] */ | ||
| 143 | #define	_POSIX_TRACE_LOG		(-1)		/* [TRL] */ | ||
| 144 | #define	_POSIX_TYPED_MEMORY_OBJECTS	(-1)		/* [TYM] */ | ||
| 145 | #ifndef _POSIX_VDISABLE | ||
| 146 | #define	_POSIX_VDISABLE			0xff		/* same as sys/termios.h */ | ||
| 147 | #endif /* _POSIX_VDISABLE */ | ||
| 148 | |||
| 149 | #if __DARWIN_C_LEVEL >= 199209L | ||
| 150 | #define	_POSIX2_C_BIND			200112L | ||
| 151 | #define	_POSIX2_C_DEV			200112L		/* c99 command */ | ||
| 152 | #define	_POSIX2_CHAR_TERM		200112L | ||
| 153 | #define	_POSIX2_FORT_DEV		(-1)		/* fort77 command */ | ||
| 154 | #define	_POSIX2_FORT_RUN		200112L | ||
| 155 | #define	_POSIX2_LOCALEDEF		200112L		/* localedef command */ | ||
| 156 | #define	_POSIX2_PBS			(-1) | ||
| 157 | #define	_POSIX2_PBS_ACCOUNTING		(-1) | ||
| 158 | #define	_POSIX2_PBS_CHECKPOINT		(-1) | ||
| 159 | #define	_POSIX2_PBS_LOCATE		(-1) | ||
| 160 | #define	_POSIX2_PBS_MESSAGE		(-1) | ||
| 161 | #define	_POSIX2_PBS_TRACK		(-1) | ||
| 162 | #define	_POSIX2_SW_DEV			200112L | ||
| 163 | #define	_POSIX2_UPE			200112L	/* XXXX no fc, newgrp, tabs */ | ||
| 164 | #endif /* __DARWIN_C_LEVEL */ | ||
| 165 | |||
| 166 | #define	__ILP32_OFF32 (-1) | ||
| 167 | #define	__ILP32_OFFBIG (-1) | ||
| 168 | |||
| 169 | #define	__LP64_OFF64 (1) | ||
| 170 | #define	__LPBIG_OFFBIG (1) | ||
| 171 | |||
| 172 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 173 | #define	_POSIX_V6_ILP32_OFF32		__ILP32_OFF32 | ||
| 174 | #define	_POSIX_V6_ILP32_OFFBIG		__ILP32_OFFBIG | ||
| 175 | #define	_POSIX_V6_LP64_OFF64		__LP64_OFF64 | ||
| 176 | #define	_POSIX_V6_LPBIG_OFFBIG		__LPBIG_OFFBIG | ||
| 177 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 178 | |||
| 179 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 180 | #define	_POSIX_V7_ILP32_OFF32		__ILP32_OFF32 | ||
| 181 | #define	_POSIX_V7_ILP32_OFFBIG		__ILP32_OFFBIG | ||
| 182 | #define	_POSIX_V7_LP64_OFF64		__LP64_OFF64 | ||
| 183 | #define	_POSIX_V7_LPBIG_OFFBIG		__LPBIG_OFFBIG | ||
| 184 | #endif /* __DARWIN_C_LEVEL >= 200809L */ | ||
| 185 | |||
| 186 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 187 | #define	_V6_ILP32_OFF32 __ILP32_OFF32 | ||
| 188 | #define	_V6_ILP32_OFFBIG __ILP32_OFFBIG | ||
| 189 | #define	_V6_LP64_OFF64 __LP64_OFF64 | ||
| 190 | #define	_V6_LPBIG_OFFBIG __LPBIG_OFFBIG | ||
| 191 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 192 | |||
| 193 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 194 | /* Removed in Issue 7 */ | ||
| 195 | #define	_XBS5_ILP32_OFF32		 __ILP32_OFF32 | ||
| 196 | #define	_XBS5_ILP32_OFFBIG		 __ILP32_OFFBIG | ||
| 197 | #define	_XBS5_LP64_OFF64		 __LP64_OFF64 | ||
| 198 | #define	_XBS5_LPBIG_OFFBIG		 __LPBIG_OFFBIG | ||
| 199 | #endif /* __DARWIN_C_LEVEL < 200809L */ | ||
| 200 | |||
| 201 | #if __DARWIN_C_LEVEL >= 199506L /* This really should be XSI */ | ||
| 202 | #define	_XOPEN_CRYPT			(1) | ||
| 203 | #define	_XOPEN_ENH_I18N			(1)		/* XXX required */ | ||
| 204 | #define	_XOPEN_LEGACY			(-1)	/* no ftime gcvt, wcswcs */ | ||
| 205 | #define	_XOPEN_REALTIME			(-1)	/* no q'ed signals, mq_* */ | ||
| 206 | #define	_XOPEN_REALTIME_THREADS		(-1)	/* no posix_spawn, et. al. */ | ||
| 207 | #define	_XOPEN_SHM			(1) | ||
| 208 | #define	_XOPEN_STREAMS			(-1) /* Issue 6 */ | ||
| 209 | #define	_XOPEN_UNIX			(1) | ||
| 210 | #endif /* XSI */ | ||
| 211 | |||
| 212 | /* configurable system variables */ | ||
| 213 | #define	_SC_ARG_MAX			 1 | ||
| 214 | #define	_SC_CHILD_MAX			 2 | ||
| 215 | #define	_SC_CLK_TCK			 3 | ||
| 216 | #define	_SC_NGROUPS_MAX			 4 | ||
| 217 | #define	_SC_OPEN_MAX			 5 | ||
| 218 | #define	_SC_JOB_CONTROL			 6 | ||
| 219 | #define	_SC_SAVED_IDS			 7 | ||
| 220 | #define	_SC_VERSION			 8 | ||
| 221 | #define	_SC_BC_BASE_MAX			 9 | ||
| 222 | #define	_SC_BC_DIM_MAX			10 | ||
| 223 | #define	_SC_BC_SCALE_MAX		11 | ||
| 224 | #define	_SC_BC_STRING_MAX		12 | ||
| 225 | #define	_SC_COLL_WEIGHTS_MAX		13 | ||
| 226 | #define	_SC_EXPR_NEST_MAX		14 | ||
| 227 | #define	_SC_LINE_MAX			15 | ||
| 228 | #define	_SC_RE_DUP_MAX			16 | ||
| 229 | #define	_SC_2_VERSION			17 | ||
| 230 | #define	_SC_2_C_BIND			18 | ||
| 231 | #define	_SC_2_C_DEV			19 | ||
| 232 | #define	_SC_2_CHAR_TERM			20 | ||
| 233 | #define	_SC_2_FORT_DEV			21 | ||
| 234 | #define	_SC_2_FORT_RUN			22 | ||
| 235 | #define	_SC_2_LOCALEDEF			23 | ||
| 236 | #define	_SC_2_SW_DEV			24 | ||
| 237 | #define	_SC_2_UPE			25 | ||
| 238 | #define	_SC_STREAM_MAX			26 | ||
| 239 | #define	_SC_TZNAME_MAX			27 | ||
| 240 | |||
| 241 | #if __DARWIN_C_LEVEL >= 199309L | ||
| 242 | #define	_SC_ASYNCHRONOUS_IO		28 | ||
| 243 | #define	_SC_PAGESIZE			29 | ||
| 244 | #define	_SC_MEMLOCK			30 | ||
| 245 | #define	_SC_MEMLOCK_RANGE		31 | ||
| 246 | #define	_SC_MEMORY_PROTECTION		32 | ||
| 247 | #define	_SC_MESSAGE_PASSING		33 | ||
| 248 | #define	_SC_PRIORITIZED_IO		34 | ||
| 249 | #define	_SC_PRIORITY_SCHEDULING		35 | ||
| 250 | #define	_SC_REALTIME_SIGNALS		36 | ||
| 251 | #define	_SC_SEMAPHORES			37 | ||
| 252 | #define	_SC_FSYNC			38 | ||
| 253 | #define	_SC_SHARED_MEMORY_OBJECTS 	39 | ||
| 254 | #define	_SC_SYNCHRONIZED_IO		40 | ||
| 255 | #define	_SC_TIMERS			41 | ||
| 256 | #define	_SC_AIO_LISTIO_MAX		42 | ||
| 257 | #define	_SC_AIO_MAX			43 | ||
| 258 | #define	_SC_AIO_PRIO_DELTA_MAX		44 | ||
| 259 | #define	_SC_DELAYTIMER_MAX		45 | ||
| 260 | #define	_SC_MQ_OPEN_MAX			46 | ||
| 261 | #define	_SC_MAPPED_FILES		47	/* swap _SC_PAGESIZE vs. BSD */ | ||
| 262 | #define	_SC_RTSIG_MAX			48 | ||
| 263 | #define	_SC_SEM_NSEMS_MAX		49 | ||
| 264 | #define	_SC_SEM_VALUE_MAX		50 | ||
| 265 | #define	_SC_SIGQUEUE_MAX		51 | ||
| 266 | #define	_SC_TIMER_MAX			52 | ||
| 267 | #endif /* __DARWIN_C_LEVEL >= 199309L */ | ||
| 268 | |||
| 269 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 270 | #define	_SC_NPROCESSORS_CONF		57 | ||
| 271 | #define	_SC_NPROCESSORS_ONLN		58 | ||
| 272 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 273 | |||
| 274 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 275 | #define	_SC_2_PBS			59 | ||
| 276 | #define	_SC_2_PBS_ACCOUNTING		60 | ||
| 277 | #define	_SC_2_PBS_CHECKPOINT		61 | ||
| 278 | #define	_SC_2_PBS_LOCATE		62 | ||
| 279 | #define	_SC_2_PBS_MESSAGE		63 | ||
| 280 | #define	_SC_2_PBS_TRACK			64 | ||
| 281 | #define	_SC_ADVISORY_INFO		65 | ||
| 282 | #define	_SC_BARRIERS			66 | ||
| 283 | #define	_SC_CLOCK_SELECTION		67 | ||
| 284 | #define	_SC_CPUTIME			68 | ||
| 285 | #define	_SC_FILE_LOCKING		69 | ||
| 286 | #define	_SC_GETGR_R_SIZE_MAX		70 | ||
| 287 | #define	_SC_GETPW_R_SIZE_MAX		71 | ||
| 288 | #define	_SC_HOST_NAME_MAX		72 | ||
| 289 | #define	_SC_LOGIN_NAME_MAX		73 | ||
| 290 | #define	_SC_MONOTONIC_CLOCK		74 | ||
| 291 | #define	_SC_MQ_PRIO_MAX			75 | ||
| 292 | #define	_SC_READER_WRITER_LOCKS		76 | ||
| 293 | #define	_SC_REGEXP			77 | ||
| 294 | #define	_SC_SHELL			78 | ||
| 295 | #define	_SC_SPAWN			79 | ||
| 296 | #define	_SC_SPIN_LOCKS			80 | ||
| 297 | #define	_SC_SPORADIC_SERVER		81 | ||
| 298 | #define	_SC_THREAD_ATTR_STACKADDR	82 | ||
| 299 | #define	_SC_THREAD_ATTR_STACKSIZE	83 | ||
| 300 | #define	_SC_THREAD_CPUTIME		84 | ||
| 301 | #define	_SC_THREAD_DESTRUCTOR_ITERATIONS 85 | ||
| 302 | #define	_SC_THREAD_KEYS_MAX		86 | ||
| 303 | #define	_SC_THREAD_PRIO_INHERIT		87 | ||
| 304 | #define	_SC_THREAD_PRIO_PROTECT		88 | ||
| 305 | #define	_SC_THREAD_PRIORITY_SCHEDULING	89 | ||
| 306 | #define	_SC_THREAD_PROCESS_SHARED	90 | ||
| 307 | #define	_SC_THREAD_SAFE_FUNCTIONS	91 | ||
| 308 | #define	_SC_THREAD_SPORADIC_SERVER	92 | ||
| 309 | #define	_SC_THREAD_STACK_MIN		93 | ||
| 310 | #define	_SC_THREAD_THREADS_MAX		94 | ||
| 311 | #define	_SC_TIMEOUTS			95 | ||
| 312 | #define	_SC_THREADS			96 | ||
| 313 | #define	_SC_TRACE			97 | ||
| 314 | #define	_SC_TRACE_EVENT_FILTER		98 | ||
| 315 | #define	_SC_TRACE_INHERIT		99 | ||
| 316 | #define	_SC_TRACE_LOG			100 | ||
| 317 | #define	_SC_TTY_NAME_MAX		101 | ||
| 318 | #define	_SC_TYPED_MEMORY_OBJECTS	102 | ||
| 319 | #define	_SC_V6_ILP32_OFF32		103 | ||
| 320 | #define	_SC_V6_ILP32_OFFBIG		104 | ||
| 321 | #define	_SC_V6_LP64_OFF64		105 | ||
| 322 | #define	_SC_V6_LPBIG_OFFBIG		106 | ||
| 323 | #define	_SC_IPV6			118 | ||
| 324 | #define	_SC_RAW_SOCKETS			119 | ||
| 325 | #define	_SC_SYMLOOP_MAX			120 | ||
| 326 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 327 | |||
| 328 | #if __DARWIN_C_LEVEL >= 199506L /* Really XSI */ | ||
| 329 | #define	_SC_ATEXIT_MAX			107 | ||
| 330 | #define	_SC_IOV_MAX			56 | ||
| 331 | #define	_SC_PAGE_SIZE			_SC_PAGESIZE | ||
| 332 | #define	_SC_XOPEN_CRYPT			108 | ||
| 333 | #define	_SC_XOPEN_ENH_I18N		109 | ||
| 334 | #define	_SC_XOPEN_LEGACY		110 /* Issue 6 */ | ||
| 335 | #define	_SC_XOPEN_REALTIME		111 /* Issue 6 */ | ||
| 336 | #define	_SC_XOPEN_REALTIME_THREADS	112 /* Issue 6 */ | ||
| 337 | #define	_SC_XOPEN_SHM			113 | ||
| 338 | #define	_SC_XOPEN_STREAMS		114 /* Issue 6 */ | ||
| 339 | #define	_SC_XOPEN_UNIX			115 | ||
| 340 | #define	_SC_XOPEN_VERSION		116 | ||
| 341 | #define	_SC_XOPEN_XCU_VERSION		121 | ||
| 342 | #endif /* XSI */ | ||
| 343 | |||
| 344 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 345 | /* Removed in Issue 7 */ | ||
| 346 | #define	_SC_XBS5_ILP32_OFF32		122 | ||
| 347 | #define	_SC_XBS5_ILP32_OFFBIG		123 | ||
| 348 | #define	_SC_XBS5_LP64_OFF64		124 | ||
| 349 | #define	_SC_XBS5_LPBIG_OFFBIG		125 | ||
| 350 | #endif /* __DARWIN_C_LEVEL <= 200809L */ | ||
| 351 | |||
| 352 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 353 | #define	_SC_SS_REPL_MAX			126 | ||
| 354 | #define	_SC_TRACE_EVENT_NAME_MAX	127 | ||
| 355 | #define	_SC_TRACE_NAME_MAX		128 | ||
| 356 | #define	_SC_TRACE_SYS_MAX		129 | ||
| 357 | #define	_SC_TRACE_USER_EVENT_MAX	130 | ||
| 358 | #endif | ||
| 359 | |||
| 360 | #if __DARWIN_C_LEVEL < 200112L || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 361 | /* Removed in Issue 6 */ | ||
| 362 | #define	_SC_PASS_MAX			131 | ||
| 363 | #endif | ||
| 364 | |||
| 365 | /* 132-199 available for future use */ | ||
| 366 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 367 | #define	_SC_PHYS_PAGES			200 | ||
| 368 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 369 | |||
| 370 | #if __DARWIN_C_LEVEL >= 199209L | ||
| 371 | #ifndef _CS_PATH /* Defined in <sys/unistd.h> */ | ||
| 372 | #define	_CS_PATH				1 | ||
| 373 | #endif | ||
| 374 | #endif | ||
| 375 | |||
| 376 | #if __DARWIN_C_LEVEL >= 200112 | ||
| 377 | #define	_CS_POSIX_V6_ILP32_OFF32_CFLAGS		2 | ||
| 378 | #define	_CS_POSIX_V6_ILP32_OFF32_LDFLAGS	3 | ||
| 379 | #define	_CS_POSIX_V6_ILP32_OFF32_LIBS		4 | ||
| 380 | #define	_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS	5 | ||
| 381 | #define	_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS	6 | ||
| 382 | #define	_CS_POSIX_V6_ILP32_OFFBIG_LIBS		7 | ||
| 383 | #define	_CS_POSIX_V6_LP64_OFF64_CFLAGS		8 | ||
| 384 | #define	_CS_POSIX_V6_LP64_OFF64_LDFLAGS		9 | ||
| 385 | #define	_CS_POSIX_V6_LP64_OFF64_LIBS		10 | ||
| 386 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS	11 | ||
| 387 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS	12 | ||
| 388 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_LIBS		13 | ||
| 389 | #define	_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS	14 | ||
| 390 | #endif | ||
| 391 | |||
| 392 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 393 | /* Removed in Issue 7 */ | ||
| 394 | #define	_CS_XBS5_ILP32_OFF32_CFLAGS		20 | ||
| 395 | #define	_CS_XBS5_ILP32_OFF32_LDFLAGS		21 | ||
| 396 | #define	_CS_XBS5_ILP32_OFF32_LIBS		22 | ||
| 397 | #define	_CS_XBS5_ILP32_OFF32_LINTFLAGS		23 | ||
| 398 | #define	_CS_XBS5_ILP32_OFFBIG_CFLAGS		24 | ||
| 399 | #define	_CS_XBS5_ILP32_OFFBIG_LDFLAGS		25 | ||
| 400 | #define	_CS_XBS5_ILP32_OFFBIG_LIBS		26 | ||
| 401 | #define	_CS_XBS5_ILP32_OFFBIG_LINTFLAGS		27 | ||
| 402 | #define	_CS_XBS5_LP64_OFF64_CFLAGS		28 | ||
| 403 | #define	_CS_XBS5_LP64_OFF64_LDFLAGS		29 | ||
| 404 | #define	_CS_XBS5_LP64_OFF64_LIBS		30 | ||
| 405 | #define	_CS_XBS5_LP64_OFF64_LINTFLAGS		31 | ||
| 406 | #define	_CS_XBS5_LPBIG_OFFBIG_CFLAGS		32 | ||
| 407 | #define	_CS_XBS5_LPBIG_OFFBIG_LDFLAGS		33 | ||
| 408 | #define	_CS_XBS5_LPBIG_OFFBIG_LIBS		34 | ||
| 409 | #define	_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS		35 | ||
| 410 | #endif | ||
| 411 | |||
| 412 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 413 | #define	_CS_DARWIN_USER_DIR			65536 | ||
| 414 | #define	_CS_DARWIN_USER_TEMP_DIR		65537 | ||
| 415 | #define	_CS_DARWIN_USER_CACHE_DIR		65538 | ||
| 416 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 417 | |||
| 418 | |||
| 419 | #ifdef _DARWIN_UNLIMITED_GETGROUPS | ||
| 420 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2 | ||
| 421 | #error "_DARWIN_UNLIMITED_GETGROUPS specified, but -miphoneos-version-min version does not support it." | ||
| 422 | #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6 | ||
| 423 | #error "_DARWIN_UNLIMITED_GETGROUPS specified, but -mmacosx-version-min version does not support it." | ||
| 424 | #endif | ||
| 425 | #endif | ||
| 426 | |||
| 427 | /* POSIX.1-1990 */ | ||
| 428 | |||
| 429 | __BEGIN_DECLS | ||
| 430 | void	 _exit(int) __dead2; | ||
| 431 | int	 access(const char *, int); | ||
| 432 | unsigned int | ||
| 433 | 	 alarm(unsigned int); | ||
| 434 | int	 chdir(const char *); | ||
| 435 | int	 chown(const char *, uid_t, gid_t); | ||
| 436 | |||
| 437 | int	 close(int) __DARWIN_ALIAS_C(close); | ||
| 438 | |||
| 439 | int	 dup(int); | ||
| 440 | int	 dup2(int, int); | ||
| 441 | int	 execl(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 442 | int	 execle(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 443 | int	 execlp(const char * __file, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 444 | int	 execv(const char * __path, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 445 | int	 execve(const char * __file, char * const * __argv, char * const * __envp) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 446 | int	 execvp(const char * __file, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 447 | pid_t	 fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 448 | long	 fpathconf(int, int); | ||
| 449 | char	*getcwd(char *, size_t); | ||
| 450 | gid_t	 getegid(void); | ||
| 451 | uid_t	 geteuid(void); | ||
| 452 | gid_t	 getgid(void); | ||
| 453 | #if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE) | ||
| 454 | int	 getgroups(int, gid_t []) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(getgroups)); | ||
| 455 | #else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */ | ||
| 456 | int	 getgroups(int, gid_t []); | ||
| 457 | #endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */ | ||
| 458 | char	*getlogin(void); | ||
| 459 | pid_t	 getpgrp(void); | ||
| 460 | pid_t	 getpid(void); | ||
| 461 | pid_t	 getppid(void); | ||
| 462 | uid_t	 getuid(void); | ||
| 463 | int	 isatty(int); | ||
| 464 | int	 link(const char *, const char *); | ||
| 465 | off_t	 lseek(int, off_t, int); | ||
| 466 | long	 pathconf(const char *, int); | ||
| 467 | |||
| 468 | int	 pause(void) __DARWIN_ALIAS_C(pause); | ||
| 469 | |||
| 470 | int	 pipe(int [2]); | ||
| 471 | |||
| 472 | ssize_t	 read(int, void *, size_t) __DARWIN_ALIAS_C(read); | ||
| 473 | |||
| 474 | int	 rmdir(const char *); | ||
| 475 | int	 setgid(gid_t); | ||
| 476 | int	 setpgid(pid_t, pid_t); | ||
| 477 | pid_t	 setsid(void); | ||
| 478 | int	 setuid(uid_t); | ||
| 479 | |||
| 480 | unsigned int | ||
| 481 | 	 sleep(unsigned int) __DARWIN_ALIAS_C(sleep); | ||
| 482 | |||
| 483 | long	 sysconf(int); | ||
| 484 | pid_t	 tcgetpgrp(int); | ||
| 485 | int	 tcsetpgrp(int, pid_t); | ||
| 486 | char	*ttyname(int); | ||
| 487 | |||
| 488 | #if __DARWIN_UNIX03 | ||
| 489 | int	 ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r); | ||
| 490 | #else /* !__DARWIN_UNIX03 */ | ||
| 491 | char	*ttyname_r(int, char *, size_t); | ||
| 492 | #endif /* __DARWIN_UNIX03 */ | ||
| 493 | |||
| 494 | int	 unlink(const char *); | ||
| 495 | |||
| 496 | ssize_t	 write(int __fd, const void * __buf, size_t __nbyte) __DARWIN_ALIAS_C(write); | ||
| 497 | __END_DECLS | ||
| 498 | |||
| 499 | |||
| 500 | |||
| 501 | /* Additional functionality provided by: | ||
| 502 | * POSIX.2-1992 C Language Binding Option | ||
| 503 | */ | ||
| 504 | |||
| 505 | #if __DARWIN_C_LEVEL >= 199209L | ||
| 506 | __BEGIN_DECLS | ||
| 507 | size_t	 confstr(int, char *, size_t) __DARWIN_ALIAS(confstr); | ||
| 508 | |||
| 509 | int	 getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt); | ||
| 510 | |||
| 511 | extern char *optarg;			/* getopt(3) external variables */ | ||
| 512 | extern int optind, opterr, optopt; | ||
| 513 | __END_DECLS | ||
| 514 | #endif /* __DARWIN_C_LEVEL >= 199209L */ | ||
| 515 | |||
| 516 | |||
| 517 | |||
| 518 | /* Additional functionality provided by: | ||
| 519 | * POSIX.1c-1995, | ||
| 520 | * POSIX.1i-1995, | ||
| 521 | * and the omnibus ISO/IEC 9945-1: 1996 | ||
| 522 | */ | ||
| 523 | |||
| 524 | #if __DARWIN_C_LEVEL >= 199506L | ||
| 525 | #include <_ctermid.h> | ||
| 526 | /* These F_* are really XSI or Issue 6 */ | ||
| 527 | #define F_ULOCK 0 /* unlock locked section */ | ||
| 528 | #define	F_LOCK 1 /* lock a section for exclusive use */ | ||
| 529 | #define	F_TLOCK 2 /* test and lock a section for exclusive use */ | ||
| 530 | #define	F_TEST 3 /* test a section for locks by other procs */ | ||
| 531 | |||
| 532 | __BEGIN_DECLS | ||
| 533 | |||
| 534 | /* Begin XSI */ | ||
| 535 | /* Removed in Issue 6 */ | ||
| 536 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | ||
| 537 | #if !defined(_POSIX_C_SOURCE) | ||
| 538 | __deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 539 | #endif | ||
| 540 | void	*brk(const void *); | ||
| 541 | int	 chroot(const char *) __POSIX_C_DEPRECATED(199506L); | ||
| 542 | #endif | ||
| 543 | |||
| 544 | char	*crypt(const char *, const char *); | ||
| 545 | #if __DARWIN_UNIX03 | ||
| 546 | void	 encrypt(char *, int) __DARWIN_ALIAS(encrypt); | ||
| 547 | #else /* !__DARWIN_UNIX03 */ | ||
| 548 | int	 encrypt(char *, int); | ||
| 549 | #endif /* __DARWIN_UNIX03 */ | ||
| 550 | int	 fchdir(int); | ||
| 551 | long	 gethostid(void); | ||
| 552 | pid_t	 getpgid(pid_t); | ||
| 553 | pid_t	 getsid(pid_t); | ||
| 554 | |||
| 555 | /* Removed in Issue 6 */ | ||
| 556 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | ||
| 557 | int	 getdtablesize(void) __POSIX_C_DEPRECATED(199506L); | ||
| 558 | int	 getpagesize(void) __pure2 __POSIX_C_DEPRECATED(199506L); | ||
| 559 | char	*getpass(const char *) __POSIX_C_DEPRECATED(199506L); | ||
| 560 | #endif | ||
| 561 | |||
| 562 | /* Removed in Issue 7 */ | ||
| 563 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L | ||
| 564 | char	*getwd(char *) __POSIX_C_DEPRECATED(200112L); /* obsoleted by getcwd() */ | ||
| 565 | #endif | ||
| 566 | |||
| 567 | int	 lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown); | ||
| 568 | |||
| 569 | int	 lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf); | ||
| 570 | |||
| 571 | int	 nice(int) __DARWIN_ALIAS(nice); | ||
| 572 | |||
| 573 | ssize_t	 pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pread); | ||
| 574 | |||
| 575 | ssize_t	 pwrite(int __fd, const void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pwrite); | ||
| 576 | |||
| 577 | /* Removed in Issue 6 */ | ||
| 578 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | ||
| 579 | /* Note that Issue 5 changed the argument as intprt_t, | ||
| 580 | * but we keep it as int for binary compatability. */ | ||
| 581 | #if !defined(_POSIX_C_SOURCE) | ||
| 582 | __deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 583 | #endif | ||
| 584 | void	*sbrk(int); | ||
| 585 | #endif | ||
| 586 | |||
| 587 | #if __DARWIN_UNIX03 | ||
| 588 | pid_t	 setpgrp(void) __DARWIN_ALIAS(setpgrp); | ||
| 589 | #else /* !__DARWIN_UNIX03 */ | ||
| 590 | int	 setpgrp(pid_t pid, pid_t pgrp);	/* obsoleted by setpgid() */ | ||
| 591 | #endif /* __DARWIN_UNIX03 */ | ||
| 592 | |||
| 593 | int	 setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid); | ||
| 594 | |||
| 595 | int	 setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid); | ||
| 596 | |||
| 597 | void swab(const void * __restrict, void * __restrict, ssize_t); | ||
| 598 | void	 sync(void); | ||
| 599 | int	 truncate(const char *, off_t); | ||
| 600 | useconds_t	 ualarm(useconds_t, useconds_t); | ||
| 601 | int	 usleep(useconds_t) __DARWIN_ALIAS_C(usleep); | ||
| 602 | |||
| 603 | #if !defined(_POSIX_C_SOURCE) | ||
| 604 | __deprecated_msg("Use posix_spawn or fork") | ||
| 605 | #endif | ||
| 606 | pid_t	 vfork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 607 | /* End XSI */ | ||
| 608 | |||
| 609 | int	 fsync(int) __DARWIN_ALIAS_C(fsync); | ||
| 610 | |||
| 611 | int	 ftruncate(int, off_t); | ||
| 612 | int	 getlogin_r(char *, size_t); | ||
| 613 | __END_DECLS | ||
| 614 | #endif /* __DARWIN_C_LEVEL >= 199506L */ | ||
| 615 | |||
| 616 | |||
| 617 | |||
| 618 | /* Additional functionality provided by: | ||
| 619 | * POSIX.1-2001 | ||
| 620 | * ISO C99 | ||
| 621 | */ | ||
| 622 | |||
| 623 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 624 | __BEGIN_DECLS | ||
| 625 | int	 fchown(int, uid_t, gid_t); | ||
| 626 | int	 gethostname(char *, size_t); | ||
| 627 | ssize_t readlink(const char * __restrict, char * __restrict, size_t); | ||
| 628 | int	 setegid(gid_t); | ||
| 629 | int	 seteuid(uid_t); | ||
| 630 | int	 symlink(const char *, const char *); | ||
| 631 | __END_DECLS | ||
| 632 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 633 | |||
| 634 | |||
| 635 | |||
| 636 | /* Darwin extensions */ | ||
| 637 | |||
| 638 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 639 | #include <sys/select.h> | ||
| 640 | |||
| 641 | #include <sys/_types/_dev_t.h> | ||
| 642 | #include <sys/_types/_mode_t.h> | ||
| 643 | #include <sys/_types/_uuid_t.h> | ||
| 644 | |||
| 645 | __BEGIN_DECLS | ||
| 646 | void	 _Exit(int) __dead2; | ||
| 647 | int	 accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t); | ||
| 648 | int	 acct(const char *); | ||
| 649 | int	 add_profil(char *, size_t, unsigned long, unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 650 | void	 endusershell(void); | ||
| 651 | int	 execvP(const char * __file, const char * __searchpath, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 652 | char	*fflagstostr(unsigned long); | ||
| 653 | int	 getdomainname(char *, int); | ||
| 654 | int	 getgrouplist(const char *, int, int *, int *); | ||
| 655 | #if defined(__has_include) | ||
| 656 | #if __has_include(<gethostuuid_private.h>) | ||
| 657 | #include <gethostuuid_private.h> | ||
| 658 | #else | ||
| 659 | #include <gethostuuid.h> | ||
| 660 | #endif | ||
| 661 | #else | ||
| 662 | #include <gethostuuid.h> | ||
| 663 | #endif | ||
| 664 | mode_t	 getmode(const void *, mode_t); | ||
| 665 | int	 getpeereid(int, uid_t *, gid_t *); | ||
| 666 | int	 getsgroups_np(int *, uuid_t); | ||
| 667 | char	*getusershell(void); | ||
| 668 | int	 getwgroups_np(int *, uuid_t); | ||
| 669 | int	 initgroups(const char *, int); | ||
| 670 | int	 issetugid(void); | ||
| 671 | char	*mkdtemp(char *); | ||
| 672 | int	 mknod(const char *, mode_t, dev_t); | ||
| 673 | int	 mkpath_np(const char *path, mode_t omode) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_0); /* returns errno */ | ||
| 674 | int	 mkpathat_np(int dfd, const char *path, mode_t omode) /* returns errno */ | ||
| 675 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 676 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 677 | int	 mkstemp(char *); | ||
| 678 | int	 mkstemps(char *, int); | ||
| 679 | char	*mktemp(char *); | ||
| 680 | int	 mkostemp(char *path, int oflags) | ||
| 681 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 682 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 683 | int	 mkostemps(char *path, int slen, int oflags) | ||
| 684 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 685 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 686 | /* Non-portable mkstemp that uses open_dprotected_np */ | ||
| 687 | int	 mkstemp_dprotected_np(char *path, int dpclass, int dpflags) | ||
| 688 | 		__OSX_UNAVAILABLE __IOS_AVAILABLE(10.0) | ||
| 689 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 690 | char *mkdtempat_np(int dfd, char *path) | ||
| 691 | 		__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 692 | 		__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 693 | int mkstempsat_np(int dfd, char *path, int slen) | ||
| 694 | 		__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 695 | 		__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 696 | int mkostempsat_np(int dfd, char *path, int slen, int oflags) | ||
| 697 | 		__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 698 | 		__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 699 | int	 nfssvc(int, void *); | ||
| 700 | int	 profil(char *, size_t, unsigned long, unsigned int); | ||
| 701 | |||
| 702 | __deprecated_msg("Use of per-thread security contexts is error-prone and discouraged.") | ||
| 703 | int	 pthread_setugid_np(uid_t, gid_t); | ||
| 704 | int	 pthread_getugid_np( uid_t *, gid_t *); | ||
| 705 | |||
| 706 | int	 reboot(int); | ||
| 707 | int	 revoke(const char *); | ||
| 708 | |||
| 709 | __deprecated int	 rcmd(char **, int, const char *, const char *, const char *, int *); | ||
| 710 | __deprecated int	 rcmd_af(char **, int, const char *, const char *, const char *, int *, | ||
| 711 | 		int); | ||
| 712 | __deprecated int	 rresvport(int *); | ||
| 713 | __deprecated int	 rresvport_af(int *, int); | ||
| 714 | __deprecated int	 iruserok(unsigned long, int, const char *, const char *); | ||
| 715 | __deprecated int	 iruserok_sa(const void *, int, int, const char *, const char *); | ||
| 716 | __deprecated int	 ruserok(const char *, int, const char *, const char *); | ||
| 717 | |||
| 718 | int	 setdomainname(const char *, int); | ||
| 719 | int	 setgroups(int, const gid_t *); | ||
| 720 | void	 sethostid(long); | ||
| 721 | int	 sethostname(const char *, int); | ||
| 722 | #if __DARWIN_UNIX03 | ||
| 723 | void	 setkey(const char *) __DARWIN_ALIAS(setkey); | ||
| 724 | #else /* !__DARWIN_UNIX03 */ | ||
| 725 | int	 setkey(const char *); | ||
| 726 | #endif /* __DARWIN_UNIX03 */ | ||
| 727 | int	 setlogin(const char *); | ||
| 728 | void	*setmode(const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(setmode)); | ||
| 729 | int	 setrgid(gid_t); | ||
| 730 | int	 setruid(uid_t); | ||
| 731 | int	 setsgroups_np(int, const uuid_t); | ||
| 732 | void	 setusershell(void); | ||
| 733 | int	 setwgroups_np(int, const uuid_t); | ||
| 734 | int	 strtofflags(char **, unsigned long *, unsigned long *); | ||
| 735 | int	 swapon(const char *); | ||
| 736 | int	 ttyslot(void); | ||
| 737 | int	 undelete(const char *); | ||
| 738 | int	 unwhiteout(const char *); | ||
| 739 | void	*valloc(size_t);			 | ||
| 740 | |||
| 741 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 742 | __OS_AVAILABILITY_MSG(ios,deprecated=10.0,"syscall(2) is unsupported; " | ||
| 743 | "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().") | ||
| 744 | __OS_AVAILABILITY_MSG(macosx,deprecated=10.12,"syscall(2) is unsupported; " | ||
| 745 | "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().") | ||
| 746 | int	 syscall(int, ...); | ||
| 747 | |||
| 748 | extern char *suboptarg;			/* getsubopt(3) external variable */ | ||
| 749 | int	 getsubopt(char **, char * const *, char **); | ||
| 750 | |||
| 751 | /* HFS & HFS Plus semantics system calls go here */ | ||
| 752 | #ifdef __LP64__ | ||
| 753 | int fgetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 754 | int fsetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 755 | int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist); | ||
| 756 | int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist); | ||
| 757 | int exchangedata(const char*,const char*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 758 | int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 759 | |||
| 760 | #else /* __LP64__ */ | ||
| 761 | int	fgetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 762 | int	fsetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 763 | int	getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist); | ||
| 764 | int	setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist); | ||
| 765 | int exchangedata(const char*,const char*,unsigned long) | ||
| 766 | 		__OSX_DEPRECATED(10.0, 10.13, "use renamex_np with the RENAME_SWAP flag") | ||
| 767 | 		__IOS_DEPRECATED(2.0, 11.0, "use renamex_np with the RENAME_SWAP flag") | ||
| 768 | 		__WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 769 | int	getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 770 | |||
| 771 | #endif /* __LP64__ */ | ||
| 772 | |||
| 773 | struct fssearchblock; | ||
| 774 | struct searchstate; | ||
| 775 | |||
| 776 | int	 searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 777 | int	 fsctl(const char *,unsigned long,void*,unsigned int); | ||
| 778 | int	 ffsctl(int,unsigned long,void*,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 779 | |||
| 780 | #define	SYNC_VOLUME_FULLSYNC	0x01	/* Flush data and metadata to platter, not just to disk cache */ | ||
| 781 | #define SYNC_VOLUME_WAIT	0x02	/* Wait for sync to complete */ | ||
| 782 | |||
| 783 | int	fsync_volume_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 784 | int	sync_volume_np(const char *, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 785 | |||
| 786 | extern int optreset; | ||
| 787 | |||
| 788 | __END_DECLS | ||
| 789 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 790 | |||
| 791 | #endif /* _UNISTD_H_ */ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.12-any/xpc/availability.h created+130| ... | @@ -0,0 +1,130 @@ | ||
| 1 | #ifndef __XPC_AVAILABILITY_H__ | ||
| 2 | #define __XPC_AVAILABILITY_H__ | ||
| 3 | |||
| 4 | #include <Availability.h> | ||
| 5 | |||
| 6 | // Certain parts of the project use all the project's headers but have to build | ||
| 7 | // against newer OSX SDKs than ebuild uses -- liblaunch_host being the example. | ||
| 8 | // So we need to define these. | ||
| 9 | #ifndef __MAC_10_16 | ||
| 10 | #define __MAC_10_16 101600 | ||
| 11 | #endif // __MAC_10_16 | ||
| 12 | |||
| 13 | #ifndef __MAC_10_15 | ||
| 14 | #define __MAC_10_15 101500 | ||
| 15 | #define __AVAILABILITY_INTERNAL__MAC_10_15 \ | ||
| 16 | __attribute__((availability(macosx, introduced=10.15))) | ||
| 17 | #endif // __MAC_10_15 | ||
| 18 | |||
| 19 | #ifndef __MAC_10_14 | ||
| 20 | #define __MAC_10_14 101400 | ||
| 21 | #define __AVAILABILITY_INTERNAL__MAC_10_14 \ | ||
| 22 | __attribute__((availability(macosx, introduced=10.14))) | ||
| 23 | #endif // __MAC_10_14 | ||
| 24 | |||
| 25 | #ifndef __MAC_10_13 | ||
| 26 | #define __MAC_10_13 101300 | ||
| 27 | #define __AVAILABILITY_INTERNAL__MAC_10_13 \ | ||
| 28 | 	__attribute__((availability(macosx, introduced=10.13))) | ||
| 29 | #endif // __MAC_10_13 | ||
| 30 | |||
| 31 | #ifndef __MAC_10_12 | ||
| 32 | #define __MAC_10_12 101200 | ||
| 33 | #define __AVAILABILITY_INTERNAL__MAC_10_12 \ | ||
| 34 | 	__attribute__((availability(macosx, introduced=10.12))) | ||
| 35 | #endif // __MAC_10_12 | ||
| 36 | |||
| 37 | #ifndef __MAC_10_11 | ||
| 38 | #define __MAC_10_11 101100 | ||
| 39 | #define __AVAILABILITY_INTERNAL__MAC_10_11 \ | ||
| 40 | 	__attribute__((availability(macosx, introduced=10.11))) | ||
| 41 | #endif // __MAC_10_11 | ||
| 42 | |||
| 43 | #ifndef __MAC_12_0 | ||
| 44 | #define __MAC_12_0 120000 | ||
| 45 | #define __AVAILABILITY_INTERNAL__MAC_12_0 \ | ||
| 46 | 	__attribute__((availability(macosx, introduced=12.0))) | ||
| 47 | #endif // __MAC_12_0 | ||
| 48 | |||
| 49 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 | ||
| 50 | #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 | ||
| 51 | #endif // __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 | ||
| 52 | |||
| 53 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 | ||
| 54 | #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 | ||
| 55 | #endif // __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 | ||
| 56 | |||
| 57 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 | ||
| 58 | #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 | ||
| 59 | #endif // __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 | ||
| 60 | |||
| 61 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 | ||
| 62 | #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 | ||
| 63 | #endif // __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 | ||
| 64 | |||
| 65 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 | ||
| 66 | #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 | ||
| 67 | #endif // __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 | ||
| 68 | |||
| 69 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 | ||
| 70 | #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 | ||
| 71 | #endif // __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 | ||
| 72 | |||
| 73 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 | ||
| 74 | #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 | ||
| 75 | #endif // __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 | ||
| 76 | |||
| 77 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 | ||
| 78 | #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 | ||
| 79 | #endif // __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 | ||
| 80 | |||
| 81 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 | ||
| 82 | #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 | ||
| 83 | #endif // __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 | ||
| 84 | |||
| 85 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 | ||
| 86 | #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 | ||
| 87 | #endif // __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 | ||
| 88 | |||
| 89 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 | ||
| 90 | #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 | ||
| 91 | #endif // __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 | ||
| 92 | |||
| 93 | #if __has_include(<simulator_host.h>) | ||
| 94 | #include <simulator_host.h> | ||
| 95 | #else // __has_include(<simulator_host.h>) | ||
| 96 | #ifndef IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED | ||
| 97 | #define IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED 999999 | ||
| 98 | #endif // IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED | ||
| 99 | #endif // __has_include(<simulator_host.h>) | ||
| 100 | |||
| 101 | #ifndef __WATCHOS_UNAVAILABLE | ||
| 102 | #define __WATCHOS_UNAVAILABLE | ||
| 103 | #endif | ||
| 104 | |||
| 105 | #ifndef __TVOS_UNAVAILABLE | ||
| 106 | #define __TVOS_UNAVAILABLE | ||
| 107 | #endif | ||
| 108 | |||
| 109 | // simulator host-side bits build against SDKs not having __*_AVAILABLE() yet | ||
| 110 | #ifndef __OSX_AVAILABLE | ||
| 111 | #define __OSX_AVAILABLE(...) | ||
| 112 | #endif | ||
| 113 | |||
| 114 | #ifndef __IOS_AVAILABLE | ||
| 115 | #define __IOS_AVAILABLE(...) | ||
| 116 | #endif | ||
| 117 | |||
| 118 | #ifndef __TVOS_AVAILABLE | ||
| 119 | #define __TVOS_AVAILABLE(...) | ||
| 120 | #endif | ||
| 121 | |||
| 122 | #ifndef __WATCHOS_AVAILABLE | ||
| 123 | #define __WATCHOS_AVAILABLE(...) | ||
| 124 | #endif | ||
| 125 | |||
| 126 | #ifndef __API_AVAILABLE | ||
| 127 | #define __API_AVAILABLE(...) | ||
| 128 | #endif | ||
| 129 | |||
| 130 | #endif // __XPC_AVAILABILITY_H__ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.13-any/AvailabilityInternal.h+5-5| ... | @@ -55,7 +55,7 @@ | ... | @@ -55,7 +55,7 @@ |
| 55 | #ifdef __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ | 55 | #ifdef __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ |
| 56 | /* compiler sets __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ when -mtvos-version-min is used */ | 56 | /* compiler sets __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ when -mtvos-version-min is used */ |
| 57 | #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ | 57 | #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ |
| 58 | #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_16_2 | 58 | #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_16_4 |
| 59 | /* for compatibility with existing code. New code should use platform specific checks */ | 59 | /* for compatibility with existing code. New code should use platform specific checks */ |
| 60 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000 | 60 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000 |
| 61 | #endif | 61 | #endif |
| ... | @@ -65,7 +65,7 @@ | ... | @@ -65,7 +65,7 @@ |
| 65 | #ifdef __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ | 65 | #ifdef __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ |
| 66 | /* compiler sets __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ when -mwatchos-version-min is used */ | 66 | /* compiler sets __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ when -mwatchos-version-min is used */ |
| 67 | #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ | 67 | #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ |
| 68 | #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_9_2 | 68 | #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_9_4 |
| 69 | /* for compatibility with existing code. New code should use platform specific checks */ | 69 | /* for compatibility with existing code. New code should use platform specific checks */ |
| 70 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000 | 70 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 90000 |
| 71 | #endif | 71 | #endif |
| ... | @@ -75,7 +75,7 @@ | ... | @@ -75,7 +75,7 @@ |
| 75 | #ifdef __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ | 75 | #ifdef __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ |
| 76 | 76 | ||
| 77 | #define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ | 77 | #define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__ |
| 78 | #define __BRIDGE_OS_VERSION_MAX_ALLOWED 70100 | 78 | #define __BRIDGE_OS_VERSION_MAX_ALLOWED 70300 |
| 79 | /* for compatibility with existing code. New code should use platform specific checks */ | 79 | /* for compatibility with existing code. New code should use platform specific checks */ |
| 80 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 110000 | 80 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 110000 |
| 81 | #endif | 81 | #endif |
| ... | @@ -90,14 +90,14 @@ | ... | @@ -90,14 +90,14 @@ |
| 90 | #ifdef __MAC_OS_X_VERSION_MIN_REQUIRED | 90 | #ifdef __MAC_OS_X_VERSION_MIN_REQUIRED |
| 91 | /* make sure a default max version is set */ | 91 | /* make sure a default max version is set */ |
| 92 | #ifndef __MAC_OS_X_VERSION_MAX_ALLOWED | 92 | #ifndef __MAC_OS_X_VERSION_MAX_ALLOWED |
| 93 | #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_13_1 | 93 | #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_13_3 |
| 94 | #endif | 94 | #endif |
| 95 | #endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */ | 95 | #endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */ |
| 96 | 96 | ||
| 97 | #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED | 97 | #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED |
| 98 | /* make sure a default max version is set */ | 98 | /* make sure a default max version is set */ |
| 99 | #ifndef __IPHONE_OS_VERSION_MAX_ALLOWED | 99 | #ifndef __IPHONE_OS_VERSION_MAX_ALLOWED |
| 100 | #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_16_2 | 100 | #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_16_4 |
| 101 | #endif | 101 | #endif |
| 102 | /* make sure a valid min is set */ | 102 | /* make sure a valid min is set */ |
| 103 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_0 | 103 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_0 |
lib/libc/include/any-macos.13-any/AvailabilityMacros.h+3-2| ... | @@ -123,6 +123,7 @@ | ... | @@ -123,6 +123,7 @@ |
| 123 | #define MAC_OS_VERSION_12_0 120000 | 123 | #define MAC_OS_VERSION_12_0 120000 |
| 124 | #define MAC_OS_VERSION_13_0 130000 | 124 | #define MAC_OS_VERSION_13_0 130000 |
| 125 | #define MAC_OS_VERSION_13_1 130100 | 125 | #define MAC_OS_VERSION_13_1 130100 |
| 126 | #define MAC_OS_VERSION_13_3 130300 | ||
| 126 | 127 | ||
| 127 | /* | 128 | /* |
| 128 | * If min OS not specified, assume 10.4 for intel | 129 | * If min OS not specified, assume 10.4 for intel |
| ... | @@ -149,10 +150,10 @@ | ... | @@ -149,10 +150,10 @@ |
| 149 | * if max OS not specified, assume larger of (10.15, min) | 150 | * if max OS not specified, assume larger of (10.15, min) |
| 150 | */ | 151 | */ |
| 151 | #ifndef MAC_OS_X_VERSION_MAX_ALLOWED | 152 | #ifndef MAC_OS_X_VERSION_MAX_ALLOWED |
| 152 | #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_VERSION_13_1 | 153 | #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_VERSION_13_3 |
| 153 | #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED | 154 | #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED |
| 154 | #else | 155 | #else |
| 155 | #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_VERSION_13_1 | 156 | #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_VERSION_13_3 |
| 156 | #endif | 157 | #endif |
| 157 | #endif | 158 | #endif |
| 158 | 159 |
lib/libc/include/any-macos.13-any/AvailabilityVersions.h+8| ... | @@ -69,6 +69,8 @@ | ... | @@ -69,6 +69,8 @@ |
| 69 | #define __MAC_12_3 120300 | 69 | #define __MAC_12_3 120300 |
| 70 | #define __MAC_13_0 130000 | 70 | #define __MAC_13_0 130000 |
| 71 | #define __MAC_13_1 130100 | 71 | #define __MAC_13_1 130100 |
| 72 | #define __MAC_13_2 130200 | ||
| 73 | #define __MAC_13_3 130300 | ||
| 72 | /* __MAC_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ | 74 | /* __MAC_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ |
| 73 | 75 | ||
| 74 | #define __IPHONE_2_0 20000 | 76 | #define __IPHONE_2_0 20000 |
| ... | @@ -134,6 +136,8 @@ | ... | @@ -134,6 +136,8 @@ |
| 134 | #define __IPHONE_16_0 160000 | 136 | #define __IPHONE_16_0 160000 |
| 135 | #define __IPHONE_16_1 160100 | 137 | #define __IPHONE_16_1 160100 |
| 136 | #define __IPHONE_16_2 160200 | 138 | #define __IPHONE_16_2 160200 |
| 139 | #define __IPHONE_16_3 160300 | ||
| 140 | #define __IPHONE_16_4 160400 | ||
| 137 | /* __IPHONE_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ | 141 | /* __IPHONE_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ |
| 138 | 142 | ||
| 139 | #define __TVOS_9_0 90000 | 143 | #define __TVOS_9_0 90000 |
| ... | @@ -172,6 +176,8 @@ | ... | @@ -172,6 +176,8 @@ |
| 172 | #define __TVOS_16_0 160000 | 176 | #define __TVOS_16_0 160000 |
| 173 | #define __TVOS_16_1 160100 | 177 | #define __TVOS_16_1 160100 |
| 174 | #define __TVOS_16_2 160200 | 178 | #define __TVOS_16_2 160200 |
| 179 | #define __TVOS_16_3 160300 | ||
| 180 | #define __TVOS_16_4 160400 | ||
| 175 | 181 | ||
| 176 | #define __WATCHOS_1_0 10000 | 182 | #define __WATCHOS_1_0 10000 |
| 177 | #define __WATCHOS_2_0 20000 | 183 | #define __WATCHOS_2_0 20000 |
| ... | @@ -207,6 +213,8 @@ | ... | @@ -207,6 +213,8 @@ |
| 207 | #define __WATCHOS_9_0 90000 | 213 | #define __WATCHOS_9_0 90000 |
| 208 | #define __WATCHOS_9_1 90100 | 214 | #define __WATCHOS_9_1 90100 |
| 209 | #define __WATCHOS_9_2 90200 | 215 | #define __WATCHOS_9_2 90200 |
| 216 | #define __WATCHOS_9_3 90300 | ||
| 217 | #define __WATCHOS_9_4 90400 | ||
| 210 | 218 | ||
| 211 | /* | 219 | /* |
| 212 | * Set up standard Mac OS X versions | 220 | * Set up standard Mac OS X versions |
lib/libc/include/any-macos.13-any/Block.h+7-2| ... | @@ -18,7 +18,12 @@ | ... | @@ -18,7 +18,12 @@ |
| 18 | # endif | 18 | # endif |
| 19 | #endif | 19 | #endif |
| 20 | 20 | ||
| 21 | #if __has_include(<Availability.h>) | ||
| 21 | #include <Availability.h> | 22 | #include <Availability.h> |
| 23 | #else | ||
| 24 | #define __OSX_AVAILABLE_STARTING(m,i) | ||
| 25 | #endif | ||
| 26 | |||
| 22 | #include <TargetConditionals.h> | 27 | #include <TargetConditionals.h> |
| 23 | #include <sys/cdefs.h> | 28 | #include <sys/cdefs.h> |
| 24 | 29 | ||
| ... | @@ -58,8 +63,8 @@ BLOCK_EXPORT void * _NSConcreteStackBlock[32] | ... | @@ -58,8 +63,8 @@ BLOCK_EXPORT void * _NSConcreteStackBlock[32] |
| 58 | 63 | ||
| 59 | // Type correct macros | 64 | // Type correct macros |
| 60 | 65 | ||
| 61 | #define Block_copy(...) ((__typeof(__VA_ARGS__))_Block_copy((const void *)(__VA_ARGS__))) | 66 | #define Block_copy(...) ((__typeof(__VA_ARGS__))_Block_copy(__unsafe_forge_single(const void *, (const void *)(__VA_ARGS__)))) |
| 62 | #define Block_release(...) _Block_release((const void *)(__VA_ARGS__)) | 67 | #define Block_release(...) _Block_release(__unsafe_forge_single(const void *, (const void *)(__VA_ARGS__))) |
| 63 | 68 | ||
| 64 | 69 | ||
| 65 | #endif | 70 | #endif |
| \ No newline at end of file | |||
lib/libc/include/any-macos.13-any/libkern/OSKextLib.h created+572| ... | @@ -0,0 +1,572 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2008 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef _LIBKERN_OSKEXTLIB_H | ||
| 30 | #define _LIBKERN_OSKEXTLIB_H | ||
| 31 | |||
| 32 | #include <sys/cdefs.h> | ||
| 33 | __BEGIN_DECLS | ||
| 34 | |||
| 35 | #include <stdint.h> | ||
| 36 | #include <mach/kmod.h> | ||
| 37 | #include <mach/vm_types.h> | ||
| 38 | #include <uuid/uuid.h> | ||
| 39 | |||
| 40 | #include <libkern/OSReturn.h> | ||
| 41 | |||
| 42 | /*! | ||
| 43 | * @header | ||
| 44 | * | ||
| 45 | * Declares functions, basic return values, and other constants | ||
| 46 | * related to kernel extensions (kexts). | ||
| 47 | */ | ||
| 48 | |||
| 49 | #if PRAGMA_MARK | ||
| 50 | #pragma mark - | ||
| 51 | /********************************************************************/ | ||
| 52 | #pragma mark OSReturn Values for Kernel Extensions | ||
| 53 | /********************************************************************/ | ||
| 54 | #endif | ||
| 55 | /*! | ||
| 56 | * @group OSReturn Values for Kernel Extensions | ||
| 57 | * Many kext-related functions return these values, | ||
| 58 | * as well as those defined under | ||
| 59 | * <code>@link //apple_ref/c/tdef/OSReturn OSReturn@/link</code> | ||
| 60 | * and other variants of <code>kern_return_t</code>. | ||
| 61 | */ | ||
| 62 | |||
| 63 | |||
| 64 | #define sub_libkern_kext err_sub(2) | ||
| 65 | #define libkern_kext_err(code) (sys_libkern|sub_libkern_kext|(code)) | ||
| 66 | |||
| 67 | |||
| 68 | /*! | ||
| 69 | * @define kOSKextReturnInternalError | ||
| 70 | * @abstract An internal error in the kext library. | ||
| 71 | * Contrast with <code>@link //apple_ref/c/econst/OSReturnError | ||
| 72 | * OSReturnError@/link</code>. | ||
| 73 | */ | ||
| 74 | #define kOSKextReturnInternalError libkern_kext_err(0x1) | ||
| 75 | |||
| 76 | /*! | ||
| 77 | * @define kOSKextReturnNoMemory | ||
| 78 | * @abstract Memory allocation failed. | ||
| 79 | */ | ||
| 80 | #define kOSKextReturnNoMemory libkern_kext_err(0x2) | ||
| 81 | |||
| 82 | /*! | ||
| 83 | * @define kOSKextReturnNoResources | ||
| 84 | * @abstract Some resource other than memory (such as available load tags) | ||
| 85 | * is exhausted. | ||
| 86 | */ | ||
| 87 | #define kOSKextReturnNoResources libkern_kext_err(0x3) | ||
| 88 | |||
| 89 | /*! | ||
| 90 | * @define kOSKextReturnNotPrivileged | ||
| 91 | * @abstract The caller lacks privileges to perform the requested operation. | ||
| 92 | */ | ||
| 93 | #define kOSKextReturnNotPrivileged libkern_kext_err(0x4) | ||
| 94 | |||
| 95 | /*! | ||
| 96 | * @define kOSKextReturnInvalidArgument | ||
| 97 | * @abstract Invalid argument. | ||
| 98 | */ | ||
| 99 | #define kOSKextReturnInvalidArgument libkern_kext_err(0x5) | ||
| 100 | |||
| 101 | /*! | ||
| 102 | * @define kOSKextReturnNotFound | ||
| 103 | * @abstract Search item not found. | ||
| 104 | */ | ||
| 105 | #define kOSKextReturnNotFound libkern_kext_err(0x6) | ||
| 106 | |||
| 107 | /*! | ||
| 108 | * @define kOSKextReturnBadData | ||
| 109 | * @abstract Malformed data (not used for XML). | ||
| 110 | */ | ||
| 111 | #define kOSKextReturnBadData libkern_kext_err(0x7) | ||
| 112 | |||
| 113 | /*! | ||
| 114 | * @define kOSKextReturnSerialization | ||
| 115 | * @abstract Error converting or (un)serializing URL, string, or XML. | ||
| 116 | */ | ||
| 117 | #define kOSKextReturnSerialization libkern_kext_err(0x8) | ||
| 118 | |||
| 119 | /*! | ||
| 120 | * @define kOSKextReturnUnsupported | ||
| 121 | * @abstract Operation is no longer or not yet supported. | ||
| 122 | */ | ||
| 123 | #define kOSKextReturnUnsupported libkern_kext_err(0x9) | ||
| 124 | |||
| 125 | /*! | ||
| 126 | * @define kOSKextReturnDisabled | ||
| 127 | * @abstract Operation is currently disabled. | ||
| 128 | */ | ||
| 129 | #define kOSKextReturnDisabled libkern_kext_err(0xa) | ||
| 130 | |||
| 131 | /*! | ||
| 132 | * @define kOSKextReturnNotAKext | ||
| 133 | * @abstract Bundle is not a kernel extension. | ||
| 134 | */ | ||
| 135 | #define kOSKextReturnNotAKext libkern_kext_err(0xb) | ||
| 136 | |||
| 137 | /*! | ||
| 138 | * @define kOSKextReturnValidation | ||
| 139 | * @abstract Validation failures encountered; check diagnostics for details. | ||
| 140 | */ | ||
| 141 | #define kOSKextReturnValidation libkern_kext_err(0xc) | ||
| 142 | |||
| 143 | /*! | ||
| 144 | * @define kOSKextReturnAuthentication | ||
| 145 | * @abstract Authetication failures encountered; check diagnostics for details. | ||
| 146 | */ | ||
| 147 | #define kOSKextReturnAuthentication libkern_kext_err(0xd) | ||
| 148 | |||
| 149 | /*! | ||
| 150 | * @define kOSKextReturnDependencies | ||
| 151 | * @abstract Dependency resolution failures encountered; check diagnostics for details. | ||
| 152 | */ | ||
| 153 | #define kOSKextReturnDependencies libkern_kext_err(0xe) | ||
| 154 | |||
| 155 | /*! | ||
| 156 | * @define kOSKextReturnArchNotFound | ||
| 157 | * @abstract Kext does not contain code for the requested architecture. | ||
| 158 | */ | ||
| 159 | #define kOSKextReturnArchNotFound libkern_kext_err(0xf) | ||
| 160 | |||
| 161 | /*! | ||
| 162 | * @define kOSKextReturnCache | ||
| 163 | * @abstract An error occurred processing a system kext cache. | ||
| 164 | */ | ||
| 165 | #define kOSKextReturnCache libkern_kext_err(0x10) | ||
| 166 | |||
| 167 | /*! | ||
| 168 | * @define kOSKextReturnDeferred | ||
| 169 | * @abstract Operation has been posted asynchronously to user space (kernel only). | ||
| 170 | */ | ||
| 171 | #define kOSKextReturnDeferred libkern_kext_err(0x11) | ||
| 172 | |||
| 173 | /*! | ||
| 174 | * @define kOSKextReturnBootLevel | ||
| 175 | * @abstract Kext not loadable or operation not allowed at current boot level. | ||
| 176 | */ | ||
| 177 | #define kOSKextReturnBootLevel libkern_kext_err(0x12) | ||
| 178 | |||
| 179 | /*! | ||
| 180 | * @define kOSKextReturnNotLoadable | ||
| 181 | * @abstract Kext cannot be loaded; check diagnostics for details. | ||
| 182 | */ | ||
| 183 | #define kOSKextReturnNotLoadable libkern_kext_err(0x13) | ||
| 184 | |||
| 185 | /*! | ||
| 186 | * @define kOSKextReturnLoadedVersionDiffers | ||
| 187 | * @abstract A different version (or executable UUID, or executable by checksum) | ||
| 188 | * of the requested kext is already loaded. | ||
| 189 | */ | ||
| 190 | #define kOSKextReturnLoadedVersionDiffers libkern_kext_err(0x14) | ||
| 191 | |||
| 192 | /*! | ||
| 193 | * @define kOSKextReturnDependencyLoadError | ||
| 194 | * @abstract A load error occurred on a dependency of the kext being loaded. | ||
| 195 | */ | ||
| 196 | #define kOSKextReturnDependencyLoadError libkern_kext_err(0x15) | ||
| 197 | |||
| 198 | /*! | ||
| 199 | * @define kOSKextReturnLinkError | ||
| 200 | * @abstract A link failure occured with this kext or a dependency. | ||
| 201 | */ | ||
| 202 | #define kOSKextReturnLinkError libkern_kext_err(0x16) | ||
| 203 | |||
| 204 | /*! | ||
| 205 | * @define kOSKextReturnStartStopError | ||
| 206 | * @abstract The kext start or stop routine returned an error. | ||
| 207 | */ | ||
| 208 | #define kOSKextReturnStartStopError libkern_kext_err(0x17) | ||
| 209 | |||
| 210 | /*! | ||
| 211 | * @define kOSKextReturnInUse | ||
| 212 | * @abstract The kext is currently in use or has outstanding references, | ||
| 213 | * and cannot be unloaded. | ||
| 214 | */ | ||
| 215 | #define kOSKextReturnInUse libkern_kext_err(0x18) | ||
| 216 | |||
| 217 | /*! | ||
| 218 | * @define kOSKextReturnTimeout | ||
| 219 | * @abstract A kext request has timed out. | ||
| 220 | */ | ||
| 221 | #define kOSKextReturnTimeout libkern_kext_err(0x19) | ||
| 222 | |||
| 223 | /*! | ||
| 224 | * @define kOSKextReturnStopping | ||
| 225 | * @abstract The kext is in the process of stopping; requests cannot be made. | ||
| 226 | */ | ||
| 227 | #define kOSKextReturnStopping libkern_kext_err(0x1a) | ||
| 228 | |||
| 229 | /*! | ||
| 230 | * @define kOSKextReturnSystemPolicy | ||
| 231 | * @abstract The kext was prevented from loading due to system policy. | ||
| 232 | */ | ||
| 233 | #define kOSKextReturnSystemPolicy libkern_kext_err(0x1b) | ||
| 234 | |||
| 235 | /*! | ||
| 236 | * @define kOSKextReturnKCLoadFailure | ||
| 237 | * @abstract Loading of the System KC failed | ||
| 238 | */ | ||
| 239 | #define kOSKextReturnKCLoadFailure libkern_kext_err(0x1c) | ||
| 240 | |||
| 241 | /*! | ||
| 242 | * @define kOSKextReturnKCLoadFailureSystemKC | ||
| 243 | * @abstract Loading of the System KC failed | ||
| 244 | * | ||
| 245 | * This a sub-code of kOSKextReturnKCLoadFailure. It can be OR'd together | ||
| 246 | * with: kOSKextReturnKCLoadFailureAuxKC | ||
| 247 | * | ||
| 248 | * If both the System and Aux KCs fail to load, then the error code will be: | ||
| 249 | * libkern_kext_err(0x1f) | ||
| 250 | */ | ||
| 251 | #define kOSKextReturnKCLoadFailureSystemKC libkern_kext_err(0x1d) | ||
| 252 | |||
| 253 | /*! | ||
| 254 | * @define kOSKextReturnKCLoadFailureAuxKC | ||
| 255 | * @abstract Loading of the Aux KC failed | ||
| 256 | * | ||
| 257 | * This a sub-code of kOSKextReturnKCLoadFailure. It can be OR'd together | ||
| 258 | * with: kOSKextReturnKCLoadFailureSystemKC | ||
| 259 | * | ||
| 260 | * If both the System and Aux KCs fail to load, then the error code will be: | ||
| 261 | * libkern_kext_err(0x1f) | ||
| 262 | */ | ||
| 263 | #define kOSKextReturnKCLoadFailureAuxKC libkern_kext_err(0x1e) | ||
| 264 | |||
| 265 | /* next available error is: libkern_kext_err(0x20) */ | ||
| 266 | |||
| 267 | #if PRAGMA_MARK | ||
| 268 | #pragma mark - | ||
| 269 | /********************************************************************/ | ||
| 270 | #pragma mark Kext/OSBundle Property List Keys | ||
| 271 | /********************************************************************/ | ||
| 272 | #endif | ||
| 273 | /*! | ||
| 274 | * @group Kext Property List Keys | ||
| 275 | * These constants cover CFBundle properties defined for kernel extensions. | ||
| 276 | * Because they are used in the kernel, if you want to use one with | ||
| 277 | * CFBundle APIs you'll need to wrap it in a <code>CFSTR()</code> macro. | ||
| 278 | */ | ||
| 279 | |||
| 280 | |||
| 281 | /*! | ||
| 282 | * @define kOSBundleCompatibleVersionKey | ||
| 283 | * @abstract A string giving the backwards-compatible version of a library kext | ||
| 284 | * in extended Mac OS 'vers' format (####.##.##s{1-255} where 's' | ||
| 285 | * is a build stage 'd', 'a', 'b', 'f' or 'fc'). | ||
| 286 | */ | ||
| 287 | #define kOSBundleCompatibleVersionKey "OSBundleCompatibleVersion" | ||
| 288 | |||
| 289 | /*! | ||
| 290 | * @define kOSBundleEnableKextLoggingKey | ||
| 291 | * @abstract Set to true to have the kernel kext logging spec applied | ||
| 292 | * to the kext. | ||
| 293 | * See <code>@link //apple_ref/c/econst/OSKextLogSpec | ||
| 294 | * OSKextLogSpec@/link</code>. | ||
| 295 | */ | ||
| 296 | #define kOSBundleEnableKextLoggingKey "OSBundleEnableKextLogging" | ||
| 297 | |||
| 298 | /*! | ||
| 299 | * @define kOSBundleIsInterfaceKey | ||
| 300 | * @abstract A boolean value indicating whether the kext executable | ||
| 301 | * contains only symbol references. | ||
| 302 | */ | ||
| 303 | #define kOSBundleIsInterfaceKey "OSBundleIsInterface" | ||
| 304 | |||
| 305 | /*! | ||
| 306 | * @define kOSBundleLibrariesKey | ||
| 307 | * @abstract A dictionary listing link dependencies for this kext. | ||
| 308 | * Keys are bundle identifiers, values are version strings. | ||
| 309 | */ | ||
| 310 | #define kOSBundleLibrariesKey "OSBundleLibraries" | ||
| 311 | |||
| 312 | /*! | ||
| 313 | * @define kOSBundleRequiredKey | ||
| 314 | * @abstract A string indicating in which kinds of startup this kext | ||
| 315 | * may need to load during early startup (before | ||
| 316 | * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code>). | ||
| 317 | * @discussion | ||
| 318 | * The value is one of: | ||
| 319 | * <ul> | ||
| 320 | * <li>@link kOSBundleRequiredRoot "OSBundleRequiredRoot"@/link</li> | ||
| 321 | * <li>@link kOSBundleRequiredLocalRoot "OSBundleRequiredLocalRoot"@/link</li> | ||
| 322 | * <li>@link kOSBundleRequiredNetworkRoot "OSBundleRequiredNetworkRoot"@/link</li> | ||
| 323 | * <li>@link kOSBundleRequiredSafeBoot "OSBundleRequiredSafeBoot"@/link</li> | ||
| 324 | * <li>@link kOSBundleRequiredConsole "OSBundleRequiredConsole"@/link</li> | ||
| 325 | * </ul> | ||
| 326 | * | ||
| 327 | * Use this property judiciously. | ||
| 328 | * Every kext that declares a value other than "OSBundleRequiredSafeBoot" | ||
| 329 | * increases startup time, as the booter must read it into memory, | ||
| 330 | * or startup kext caches must include it. | ||
| 331 | */ | ||
| 332 | #define kOSBundleRequiredKey "OSBundleRequired" | ||
| 333 | |||
| 334 | /*! | ||
| 335 | * @define kOSBundleRequireExplicitLoadKey | ||
| 336 | * @abstract A boolean value indicating whether the kext requires an | ||
| 337 | * explicit kextload in order to start/match. | ||
| 338 | */ | ||
| 339 | #define kOSBundleRequireExplicitLoadKey "OSBundleRequireExplicitLoad" | ||
| 340 | |||
| 341 | /*! | ||
| 342 | * @define kOSBundleAllowUserLoadKey | ||
| 343 | * @abstract A boolean value indicating whether | ||
| 344 | * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code> | ||
| 345 | * will honor a non-root process's request to load a kext. | ||
| 346 | * @discussion | ||
| 347 | * See <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithURL | ||
| 348 | * KextManagerLoadKextWithURL@/link</code> | ||
| 349 | * and <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithIdentifier | ||
| 350 | * KextManagerLoadKextWithIdentifier@/link</code>. | ||
| 351 | */ | ||
| 352 | #define kOSBundleAllowUserLoadKey "OSBundleAllowUserLoad" | ||
| 353 | |||
| 354 | /*! | ||
| 355 | * @define kOSBundleAllowUserTerminateKey | ||
| 356 | * @abstract A boolean value indicating whether the kextunload tool | ||
| 357 | * is allowed to issue IOService terminate to classes defined in this kext. | ||
| 358 | * @discussion A boolean value indicating whether the kextunload tool | ||
| 359 | * is allowed to issue IOService terminate to classes defined in this kext. | ||
| 360 | */ | ||
| 361 | #define kOSBundleAllowUserTerminateKey "OSBundleAllowUserTerminate" | ||
| 362 | |||
| 363 | /*! | ||
| 364 | * @define kOSKernelResourceKey | ||
| 365 | * @abstract A boolean value indicating whether the kext represents a built-in | ||
| 366 | * component of the kernel. | ||
| 367 | */ | ||
| 368 | #define kOSKernelResourceKey "OSKernelResource" | ||
| 369 | |||
| 370 | /*! | ||
| 371 | * @define kOSKextVariantOverrideKey | ||
| 372 | * @abstract A dictionary with target names as key and a target-specific variant | ||
| 373 | * name as value. | ||
| 374 | */ | ||
| 375 | #define kOSKextVariantOverrideKey "OSKextVariantOverride" | ||
| 376 | |||
| 377 | /*! | ||
| 378 | * @define kIOKitPersonalitiesKey | ||
| 379 | * @abstract A dictionary of dictionaries used in matching for I/O Kit drivers. | ||
| 380 | */ | ||
| 381 | #define kIOKitPersonalitiesKey "IOKitPersonalities" | ||
| 382 | |||
| 383 | /* | ||
| 384 | * @define kIOPersonalityPublisherKey | ||
| 385 | * @abstract Used in personalities sent to the I/O Kit, | ||
| 386 | * contains the CFBundleIdentifier of the kext | ||
| 387 | * that the personality originated in. | ||
| 388 | */ | ||
| 389 | #define kIOPersonalityPublisherKey "IOPersonalityPublisher" | ||
| 390 | |||
| 391 | #if CONFIG_KEC_FIPS | ||
| 392 | /* | ||
| 393 | * @define kAppleTextHashesKey | ||
| 394 | * @abstract A dictionary conataining hashes for corecrypto kext. | ||
| 395 | */ | ||
| 396 | #define kAppleTextHashesKey "AppleTextHashes" | ||
| 397 | #endif | ||
| 398 | |||
| 399 | /*! | ||
| 400 | * @define kOSMutableSegmentCopy | ||
| 401 | * @abstract A boolean value indicating whether the kext requires a copy of | ||
| 402 | * its mutable segments to be kept in memory, and then reset when the kext | ||
| 403 | * unloads. This should be used with caution as it will increase the | ||
| 404 | * amount of memory used by the kext. | ||
| 405 | */ | ||
| 406 | #define kOSMutableSegmentCopy "OSMutableSegmentCopy" | ||
| 407 | |||
| 408 | |||
| 409 | #if PRAGMA_MARK | ||
| 410 | /********************************************************************/ | ||
| 411 | #pragma mark Kext/OSBundle Property Deprecated Keys | ||
| 412 | /********************************************************************/ | ||
| 413 | #endif | ||
| 414 | /* | ||
| 415 | * @define kOSBundleDebugLevelKey | ||
| 416 | * @abstract | ||
| 417 | * Deprecated (used on some releases of Mac OS X prior to 10.6 Snow Leopard). | ||
| 418 | * Value is an integer from 1-6, corresponding to the verbose levels | ||
| 419 | * of kext tools on those releases. | ||
| 420 | * On 10.6 Snow Leopard, use <code>@link OSKextEnableKextLogging | ||
| 421 | * OSKextEnableKextLogging@/link</code>. | ||
| 422 | */ | ||
| 423 | #define kOSBundleDebugLevelKey "OSBundleDebugLevel" | ||
| 424 | |||
| 425 | /*! | ||
| 426 | * @define kOSBundleSharedExecutableIdentifierKey | ||
| 427 | * @abstract Deprecated (used on some releases of Mac OS X | ||
| 428 | * prior to 10.6 Snow Leopard). | ||
| 429 | * Value is the bundle identifier of the pseudokext | ||
| 430 | * that contains an executable shared by this kext. | ||
| 431 | */ | ||
| 432 | #define kOSBundleSharedExecutableIdentifierKey "OSBundleSharedExecutableIdentifier" | ||
| 433 | |||
| 434 | |||
| 435 | #if PRAGMA_MARK | ||
| 436 | /********************************************************************/ | ||
| 437 | #pragma mark Kext/OSBundle Property List Values | ||
| 438 | /********************************************************************/ | ||
| 439 | #endif | ||
| 440 | |||
| 441 | /*! | ||
| 442 | * @group Kext Property List Values | ||
| 443 | * These constants encompass established values | ||
| 444 | * for kernel extension bundle properties. | ||
| 445 | */ | ||
| 446 | |||
| 447 | /*! | ||
| 448 | * @define kOSKextKernelIdentifier | ||
| 449 | * @abstract | ||
| 450 | * This is the CFBundleIdentifier user for the kernel itself. | ||
| 451 | */ | ||
| 452 | #define kOSKextKernelIdentifier "__kernel__" | ||
| 453 | |||
| 454 | |||
| 455 | /*! | ||
| 456 | * @define kOSKextBundlePackageTypeKext | ||
| 457 | * @abstract | ||
| 458 | * The bundle type value for Kernel Extensions. | ||
| 459 | */ | ||
| 460 | #define kOSKextBundlePackageTypeKext "KEXT" | ||
| 461 | |||
| 462 | /*! | ||
| 463 | * @define kOSKextBundlePackageTypeDriverKit | ||
| 464 | * @abstract | ||
| 465 | * The bundle type value for Driver Extensions. | ||
| 466 | */ | ||
| 467 | #define kOSKextBundlePackageTypeDriverKit "DEXT" | ||
| 468 | |||
| 469 | /*! | ||
| 470 | * @define kOSBundleRequiredRoot | ||
| 471 | * @abstract | ||
| 472 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 473 | * value indicates that the kext may be needed to mount the root filesystem | ||
| 474 | * whether starting from a local or a network volume. | ||
| 475 | */ | ||
| 476 | #define kOSBundleRequiredRoot "Root" | ||
| 477 | |||
| 478 | /*! | ||
| 479 | * @define kOSBundleRequiredLocalRoot | ||
| 480 | * @abstract | ||
| 481 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 482 | * value indicates that the kext may be needed to mount the root filesystem | ||
| 483 | * when starting from a local disk. | ||
| 484 | */ | ||
| 485 | #define kOSBundleRequiredLocalRoot "Local-Root" | ||
| 486 | |||
| 487 | /*! | ||
| 488 | * @define kOSBundleRequiredNetworkRoot | ||
| 489 | * @abstract | ||
| 490 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 491 | * value indicates that the kext may be needed to mount the root filesystem | ||
| 492 | * when starting over a network connection. | ||
| 493 | */ | ||
| 494 | #define kOSBundleRequiredNetworkRoot "Network-Root" | ||
| 495 | |||
| 496 | /*! | ||
| 497 | * @define kOSBundleRequiredSafeBoot | ||
| 498 | * @abstract | ||
| 499 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 500 | * value indicates that the kext can be loaded during a safe startup. | ||
| 501 | * This value does not normally cause the kext to be read by the booter | ||
| 502 | * or included in startup kext caches. | ||
| 503 | */ | ||
| 504 | #define kOSBundleRequiredSafeBoot "Safe Boot" | ||
| 505 | |||
| 506 | /*! | ||
| 507 | * @define kOSBundleRequiredConsole | ||
| 508 | * @abstract | ||
| 509 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 510 | * value indicates that the kext may be needed for console access | ||
| 511 | * (specifically in a single-user startup when | ||
| 512 | * <code>@link //apple_ref/doc/man/8/kextd kextd(8)@/link</code>. | ||
| 513 | * does not run) | ||
| 514 | * and should be loaded during early startup. | ||
| 515 | */ | ||
| 516 | #define kOSBundleRequiredConsole "Console" | ||
| 517 | |||
| 518 | /*! | ||
| 519 | * @define kOSBundleRequiredDriverKit | ||
| 520 | * @abstract | ||
| 521 | * This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> | ||
| 522 | * value indicates that the driver extension's (DriverKit driver's) | ||
| 523 | * personalities must be present in the kernel at early boot (specifically | ||
| 524 | * before <code>@link //apple_ref/doc/man/8/kextd kextd(8)@/link</code> starts) | ||
| 525 | * in order to compete with kexts built into the prelinkedkernel. Note that | ||
| 526 | * kextd is still required to launch the user space driver binary. The IOKit | ||
| 527 | * matching will happen during early boot, and the actual driver launch | ||
| 528 | * will happen after kextd starts. | ||
| 529 | */ | ||
| 530 | #define kOSBundleRequiredDriverKit "DriverKit" | ||
| 531 | |||
| 532 | #if PRAGMA_MARK | ||
| 533 | #pragma mark - | ||
| 534 | /********************************************************************/ | ||
| 535 | #pragma mark Kext Information | ||
| 536 | /********************************************************************/ | ||
| 537 | #endif | ||
| 538 | /*! | ||
| 539 | * @group Kext Information | ||
| 540 | * Types, constants, and macros providing a kext with information | ||
| 541 | * about itself. | ||
| 542 | */ | ||
| 543 | |||
| 544 | /*! | ||
| 545 | * @typedef OSKextLoadTag | ||
| 546 | * | ||
| 547 | * @abstract | ||
| 548 | * A unique identifier assigned to a loaded instanace of a kext. | ||
| 549 | * | ||
| 550 | * @discussion | ||
| 551 | * If a kext is unloaded and later reloaded, the new instance | ||
| 552 | * has a different load tag. | ||
| 553 | * | ||
| 554 | * A kext can get its own load tag in the <code>kmod_info_t</code> | ||
| 555 | * structure passed into its module start routine, as the | ||
| 556 | * <code>id</code> field (cast to this type). | ||
| 557 | */ | ||
| 558 | typedef uint32_t OSKextLoadTag; | ||
| 559 | |||
| 560 | /*! | ||
| 561 | * @define kOSKextInvalidLoadTag | ||
| 562 | * | ||
| 563 | * @abstract | ||
| 564 | * A load tag value that will never be used for a loaded kext; | ||
| 565 | * indicates kext not found. | ||
| 566 | */ | ||
| 567 | #define kOSKextInvalidLoadTag ((OSKextLoadTag)(-1)) | ||
| 568 | |||
| 569 | |||
| 570 | __END_DECLS | ||
| 571 | |||
| 572 | #endif /* _LIBKERN_OSKEXTLIB_H */ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.13-any/mach-o/arm64/reloc.h created+254| ... | @@ -0,0 +1,254 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2010 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef _MACHO_ARM64_RELOC_H_ | ||
| 25 | #define _MACHO_ARM64_RELOC_H_ | ||
| 26 | |||
| 27 | /* | ||
| 28 | * Relocations for arm64 are a bit different than for other architectures in | ||
| 29 | * Mach-O: Scattered relocations are not used. Almost all relocations produced | ||
| 30 | * by the compiler are external relocations. An external relocation has the | ||
| 31 | * r_extern bit set to 1 and the r_symbolnum field contains the symbol table | ||
| 32 | * index of the target label. | ||
| 33 | * | ||
| 34 | * When the assembler is generating relocations, if the target label is a local | ||
| 35 | * label (begins with 'L'), then the previous non-local label in the same | ||
| 36 | * section is used as the target of the external relocation. An addend is used | ||
| 37 | * with the distance from that non-local label to the target label. Only when | ||
| 38 | * there is no previous non-local label in the section is an internal | ||
| 39 | * relocation used. | ||
| 40 | * | ||
| 41 | * The addend (i.e. the 4 in _foo+4) is encoded either in the instruction or | ||
| 42 | * in the r_symbolnum of ARM64_RELOC_ADDEND. | ||
| 43 | * For ARM64_RELOC_UNSIGNED and ARM64_RELOC_AUTHENTICATED_POINTER, the addend | ||
| 44 | * is stored in the instruction. ARM64_RELOC_PAGE21, ARM64_RELOC_PAGEOFF12 and | ||
| 45 | * ARM64_RELOC_BRANCH26 must be preceded by an ARM64_RELOC_ADDEND if they need | ||
| 46 | * an addend. No other relocations support addends. | ||
| 47 | * | ||
| 48 | * The relocation types are: | ||
| 49 | * | ||
| 50 | * ARM64_RELOC_UNSIGNED // For pointer sized fixups | ||
| 51 | * ARM64_RELOC_SUBTRACTOR // must be followed by a ARM64_RELOC_UNSIGNED | ||
| 52 | * ARM64_RELOC_BRANCH26 // a BL instruction with pc-relative +-128MB displacement | ||
| 53 | * ARM64_RELOC_PAGE21 // pc-rel distance to page of target | ||
| 54 | * ARM64_RELOC_PAGEOFF12 // offset within page, scaled by r_length | ||
| 55 | * ARM64_RELOC_GOT_LOAD_PAGE21 // load with a pc-rel distance to page of a GOT entry | ||
| 56 | * ARM64_RELOC_GOT_LOAD_PAGEOFF12 // load with an offset within page, scaled by r_length, of GOT entry | ||
| 57 | * ARM64_RELOC_POINTER_TO_GOT // 32-bit pc-rel (or 64-bit absolute) offset to a GOT entry | ||
| 58 | * ARM64_RELOC_TLVP_LOAD_PAGE21 // tlv load with a pc-rel distance to page of a GOT entry | ||
| 59 | * ARM64_RELOC_TLVP_LOAD_PAGEOFF12 // tlv load with an offset within page, scaled by r_length, of GOT entry | ||
| 60 | * ARM64_RELOC_ADDEND // must be followed by ARM64_RELOC_BRANCH26/ARM64_RELOC_PAGE21/ARM64_RELOC_PAGEOFF12 | ||
| 61 | * ARM64_RELOC_AUTHENTICATED_POINTER // 64-bit pointer with authentication | ||
| 62 | * | ||
| 63 | * The following are sample assembly instructions, followed by the relocation | ||
| 64 | * and section content they generate in an object file: | ||
| 65 | * | ||
| 66 | * (arm64_32 only) | ||
| 67 | * .long _foo | ||
| 68 | * r_type=ARM64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 69 | * 00 00 00 00 | ||
| 70 | * | ||
| 71 | * (arm64_32 only) | ||
| 72 | * .long _foo + 4 | ||
| 73 | * r_type=ARM64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 74 | * 04 00 00 00 | ||
| 75 | * | ||
| 76 | * .quad _foo | ||
| 77 | * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 78 | * 00 00 00 00 00 00 00 00 | ||
| 79 | * | ||
| 80 | * .quad _foo + 16 | ||
| 81 | * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 82 | * 10 00 00 00 00 00 00 00 | ||
| 83 | * | ||
| 84 | * .quad L1 | ||
| 85 | * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev | ||
| 86 | * 10 00 00 00 00 00 00 00 | ||
| 87 | * // assumes _prev is the first non-local label 0x10 bytes before L1 | ||
| 88 | * 10 00 00 00 00 00 00 00 | ||
| 89 | * | ||
| 90 | * (arm64_32 only) | ||
| 91 | * .long _foo - _bar | ||
| 92 | * r_type=ARM64_RELOC_SUBTRACTOR, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_bar | ||
| 93 | * r_type=ARM64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 94 | * 00 00 00 00 | ||
| 95 | * | ||
| 96 | * (arm64_32 only) | ||
| 97 | * .long _foo - _bar + 4 | ||
| 98 | * r_type=ARM64_RELOC_SUBTRACTOR, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_bar | ||
| 99 | * r_type=ARM64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 100 | * 04 00 00 00 | ||
| 101 | * | ||
| 102 | * .quad _foo - _bar | ||
| 103 | * r_type=ARM64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_bar | ||
| 104 | * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 105 | * 00 00 00 00 00 00 00 00 | ||
| 106 | * | ||
| 107 | * .quad _foo - _bar + 4 | ||
| 108 | * r_type=ARM64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_bar | ||
| 109 | * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 110 | * 04 00 00 00 00 00 00 00 | ||
| 111 | * | ||
| 112 | * .long _foo - . | ||
| 113 | * r_type=ARM64_RELOC_SUBTRACTOR, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_prev | ||
| 114 | * r_type=ARM64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 115 | * f8 ff ff ff | ||
| 116 | * // assumes _prev is the first non-local label 0x8 bytes before this | ||
| 117 | * // .quad | ||
| 118 | * | ||
| 119 | * .long _foo - L1 | ||
| 120 | * r_type=ARM64_RELOC_SUBTRACTOR, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_prev | ||
| 121 | * r_type=ARM64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 122 | * f8 ff ff ff | ||
| 123 | * // assumes _prev is the first non-local label 0x8 bytes before L1 | ||
| 124 | * | ||
| 125 | * .quad _foo - . | ||
| 126 | * r_type=ARM64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev | ||
| 127 | * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 128 | * f8 ff ff ff ff ff ff ff | ||
| 129 | * // assumes _prev is the first non-local label 0x8 bytes before this | ||
| 130 | * // .quad | ||
| 131 | * | ||
| 132 | * .quad _foo - L1 | ||
| 133 | * r_type=ARM64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev | ||
| 134 | * r_type=ARM64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 135 | * f8 ff ff ff ff ff ff ff | ||
| 136 | * // assumes _prev is the first non-local label 0x8 bytes before L1 | ||
| 137 | * | ||
| 138 | * .long L1 - _prev | ||
| 139 | * // No relocations. This is an assembly time constant. | ||
| 140 | * 12 00 00 00 00 00 00 00 | ||
| 141 | * // assumes _prev is the first non-local label 0x12 bytes before L1 | ||
| 142 | * | ||
| 143 | * .quad L1 - _prev | ||
| 144 | * // No relocations. This is an assembly time constant. | ||
| 145 | * 12 00 00 00 00 00 00 00 | ||
| 146 | * // assumes _prev is the first non-local label 0x12 bytes before L1 | ||
| 147 | * | ||
| 148 | * bl _foo | ||
| 149 | * r_type=ARM64_RELOC_BRANCH26, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo | ||
| 150 | * 0x14000000 | ||
| 151 | * | ||
| 152 | * bl _foo + 4 | ||
| 153 | * r_type=ARM64_RELOC_ADDEND, r_length=2, r_extern=0, r_pcrel=0, r_symbolnum=0x000004 | ||
| 154 | * r_type=ARM64_RELOC_BRANCH26, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo | ||
| 155 | * 0x14000000 | ||
| 156 | * | ||
| 157 | * adrp x0, _foo@PAGE | ||
| 158 | * r_type=ARM64_RELOC_PAGE21, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo | ||
| 159 | * 0x90000000 | ||
| 160 | * | ||
| 161 | * ldr x0, [x0, _foo@PAGEOFF] | ||
| 162 | * r_type=ARM64_RELOC_PAGEOFF12, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 163 | * 0xf9400000 | ||
| 164 | * | ||
| 165 | * adrp x0, _foo@PAGE + 0x24 | ||
| 166 | * r_type=ARM64_RELOC_ADDEND, r_length=2, r_extern=0, r_pcrel=0, r_symbolnum=0x000024 | ||
| 167 | * r_type=ARM64_RELOC_PAGE21, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo | ||
| 168 | * 0x90000000 | ||
| 169 | * | ||
| 170 | * ldr x0, [x0, _foo@PAGEOFF + 0x24] | ||
| 171 | * r_type=ARM64_RELOC_ADDEND, r_length=2, r_extern=0, r_pcrel=0, r_symbolnum=0x000024 | ||
| 172 | * r_type=ARM64_RELOC_PAGEOFF12, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 173 | * 0xf9400000 | ||
| 174 | * | ||
| 175 | * adrp x0, _foo@GOTPAGE | ||
| 176 | * r_type=ARM64_RELOC_GOT_LOAD_PAGE21, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo | ||
| 177 | * 0x90000000 | ||
| 178 | * | ||
| 179 | * ldr x0, [x0, _foo@GOTPAGEOFF] | ||
| 180 | * r_type=ARM64_RELOC_GOT_LOAD_PAGEOFF12, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 181 | * 0xf9400000 | ||
| 182 | * | ||
| 183 | * adrp x0, _foo@TLVPPAGE | ||
| 184 | * r_type=ARM64_RELOC_TLVP_LOAD_PAGE21, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo | ||
| 185 | * 0x90000000 | ||
| 186 | * | ||
| 187 | * ldr x0, [x0, _foo@TLVPPAGEOFF] | ||
| 188 | * r_type=ARM64_RELOC_TLVP_LOAD_PAGEOFF12, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 189 | * 0xf9400000 | ||
| 190 | * | ||
| 191 | * .long _foo@GOT - . | ||
| 192 | * r_type=ARM64_RELOC_POINTER_TO_GOT, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo | ||
| 193 | * 00 00 00 00 | ||
| 194 | * | ||
| 195 | * (arm64_32 only) | ||
| 196 | * .long _foo@GOT | ||
| 197 | * r_type=ARM64_RELOC_POINTER_TO_GOT, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 198 | * 00 00 00 00 | ||
| 199 | * | ||
| 200 | * .quad _foo@GOT | ||
| 201 | * r_type=ARM64_RELOC_POINTER_TO_GOT, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 202 | * 00 00 00 00 00 00 00 00 | ||
| 203 | * | ||
| 204 | * (arm64e only) | ||
| 205 | * .quad _foo@AUTH(da,5,addr) | ||
| 206 | * r_type=ARM64_RELOC_AUTHENTICATED_POINTER, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 207 | * 00 00 00 00 05 00 05 80 | ||
| 208 | * | ||
| 209 | * (arm64e only) | ||
| 210 | * .quad (_foo + 0x10)@AUTH(da,5,addr) | ||
| 211 | * r_type=ARM64_RELOC_AUTHENTICATED_POINTER, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo | ||
| 212 | * 10 00 00 00 05 00 05 80 | ||
| 213 | * | ||
| 214 | * | ||
| 215 | */ | ||
| 216 | enum reloc_type_arm64 | ||
| 217 | { | ||
| 218 | ARM64_RELOC_UNSIGNED,	 // for pointers | ||
| 219 | ARM64_RELOC_SUBTRACTOR, // must be followed by a ARM64_RELOC_UNSIGNED | ||
| 220 | ARM64_RELOC_BRANCH26, // a B/BL instruction with 26-bit displacement | ||
| 221 | ARM64_RELOC_PAGE21, // pc-rel distance to page of target | ||
| 222 | ARM64_RELOC_PAGEOFF12, // offset within page, scaled by r_length | ||
| 223 | ARM64_RELOC_GOT_LOAD_PAGE21, // pc-rel distance to page of GOT slot | ||
| 224 | ARM64_RELOC_GOT_LOAD_PAGEOFF12, // offset within page of GOT slot, | ||
| 225 | // scaled by r_length | ||
| 226 | ARM64_RELOC_POINTER_TO_GOT, // for pointers to GOT slots | ||
| 227 | ARM64_RELOC_TLVP_LOAD_PAGE21, // pc-rel distance to page of TLVP slot | ||
| 228 | ARM64_RELOC_TLVP_LOAD_PAGEOFF12, // offset within page of TLVP slot, | ||
| 229 | // scaled by r_length | ||
| 230 | ARM64_RELOC_ADDEND,		 // must be followed by PAGE21 or PAGEOFF12 | ||
| 231 | |||
| 232 | // An arm64e authenticated pointer. | ||
| 233 | // | ||
| 234 | // Represents a pointer to a symbol (like ARM64_RELOC_UNSIGNED). | ||
| 235 | // Additionally, the resulting pointer is signed. The signature is | ||
| 236 | // specified in the target location: the addend is restricted to the lower | ||
| 237 | // 32 bits (instead of the full 64 bits for ARM64_RELOC_UNSIGNED): | ||
| 238 | // | ||
| 239 | // |63|62|61-51|50-49| 48 |47 - 32|31 - 0| | ||
| 240 | // | 1| 0| 0 | key | addr | discriminator | addend | | ||
| 241 | // | ||
| 242 | // The key is one of: | ||
| 243 | // IA: 00 IB: 01 | ||
| 244 | // DA: 10 DB: 11 | ||
| 245 | // | ||
| 246 | // The discriminator field is used as extra signature diversification. | ||
| 247 | // | ||
| 248 | // The addr field indicates whether the target address should be blended | ||
| 249 | // into the discriminator. | ||
| 250 | // | ||
| 251 | ARM64_RELOC_AUTHENTICATED_POINTER, | ||
| 252 | }; | ||
| 253 | |||
| 254 | #endif /* #ifndef _MACHO_ARM64_RELOC_H_ */ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.13-any/mach-o/compact_unwind_encoding.h created+532| ... | @@ -0,0 +1,532 @@ | ||
| 1 | //===----------------------------------------------------------------------===// | ||
| 2 | // | ||
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| 4 | // See https://llvm.org/LICENSE.txt for license information. | ||
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| 6 | // | ||
| 7 | // | ||
| 8 | // Darwin's alternative to DWARF based unwind encodings. | ||
| 9 | // | ||
| 10 | //===----------------------------------------------------------------------===// | ||
| 11 | |||
| 12 | |||
| 13 | #ifndef __COMPACT_UNWIND_ENCODING__ | ||
| 14 | #define __COMPACT_UNWIND_ENCODING__ | ||
| 15 | |||
| 16 | #include <stdint.h> | ||
| 17 | |||
| 18 | // | ||
| 19 | // Compilers can emit standard DWARF FDEs in the __TEXT,__eh_frame section | ||
| 20 | // of object files. Or compilers can emit compact unwind information in | ||
| 21 | // the __LD,__compact_unwind section. | ||
| 22 | // | ||
| 23 | // When the linker creates a final linked image, it will create a | ||
| 24 | // __TEXT,__unwind_info section. This section is a small and fast way for the | ||
| 25 | // runtime to access unwind info for any given function. If the compiler | ||
| 26 | // emitted compact unwind info for the function, that compact unwind info will | ||
| 27 | // be encoded in the __TEXT,__unwind_info section. If the compiler emitted | ||
| 28 | // DWARF unwind info, the __TEXT,__unwind_info section will contain the offset | ||
| 29 | // of the FDE in the __TEXT,__eh_frame section in the final linked image. | ||
| 30 | // | ||
| 31 | // Note: Previously, the linker would transform some DWARF unwind infos into | ||
| 32 | // compact unwind info. But that is fragile and no longer done. | ||
| 33 | |||
| 34 | |||
| 35 | // | ||
| 36 | // The compact unwind endoding is a 32-bit value which encoded in an | ||
| 37 | // architecture specific way, which registers to restore from where, and how | ||
| 38 | // to unwind out of the function. | ||
| 39 | // | ||
| 40 | typedef uint32_t compact_unwind_encoding_t; | ||
| 41 | |||
| 42 | |||
| 43 | // architecture independent bits | ||
| 44 | enum { | ||
| 45 | UNWIND_IS_NOT_FUNCTION_START = 0x80000000, | ||
| 46 | UNWIND_HAS_LSDA = 0x40000000, | ||
| 47 | UNWIND_PERSONALITY_MASK = 0x30000000, | ||
| 48 | }; | ||
| 49 | |||
| 50 | |||
| 51 | |||
| 52 | |||
| 53 | // | ||
| 54 | // x86 | ||
| 55 | // | ||
| 56 | // 1-bit: start | ||
| 57 | // 1-bit: has lsda | ||
| 58 | // 2-bit: personality index | ||
| 59 | // | ||
| 60 | // 4-bits: 0=old, 1=ebp based, 2=stack-imm, 3=stack-ind, 4=DWARF | ||
| 61 | // ebp based: | ||
| 62 | // 15-bits (5*3-bits per reg) register permutation | ||
| 63 | // 8-bits for stack offset | ||
| 64 | // frameless: | ||
| 65 | // 8-bits stack size | ||
| 66 | // 3-bits stack adjust | ||
| 67 | // 3-bits register count | ||
| 68 | // 10-bits register permutation | ||
| 69 | // | ||
| 70 | enum { | ||
| 71 | UNWIND_X86_MODE_MASK = 0x0F000000, | ||
| 72 | UNWIND_X86_MODE_EBP_FRAME = 0x01000000, | ||
| 73 | UNWIND_X86_MODE_STACK_IMMD = 0x02000000, | ||
| 74 | UNWIND_X86_MODE_STACK_IND = 0x03000000, | ||
| 75 | UNWIND_X86_MODE_DWARF = 0x04000000, | ||
| 76 | |||
| 77 | UNWIND_X86_EBP_FRAME_REGISTERS = 0x00007FFF, | ||
| 78 | UNWIND_X86_EBP_FRAME_OFFSET = 0x00FF0000, | ||
| 79 | |||
| 80 | UNWIND_X86_FRAMELESS_STACK_SIZE = 0x00FF0000, | ||
| 81 | UNWIND_X86_FRAMELESS_STACK_ADJUST = 0x0000E000, | ||
| 82 | UNWIND_X86_FRAMELESS_STACK_REG_COUNT = 0x00001C00, | ||
| 83 | UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF, | ||
| 84 | |||
| 85 | UNWIND_X86_DWARF_SECTION_OFFSET = 0x00FFFFFF, | ||
| 86 | }; | ||
| 87 | |||
| 88 | enum { | ||
| 89 | UNWIND_X86_REG_NONE = 0, | ||
| 90 | UNWIND_X86_REG_EBX = 1, | ||
| 91 | UNWIND_X86_REG_ECX = 2, | ||
| 92 | UNWIND_X86_REG_EDX = 3, | ||
| 93 | UNWIND_X86_REG_EDI = 4, | ||
| 94 | UNWIND_X86_REG_ESI = 5, | ||
| 95 | UNWIND_X86_REG_EBP = 6, | ||
| 96 | }; | ||
| 97 | |||
| 98 | // | ||
| 99 | // For x86 there are four modes for the compact unwind encoding: | ||
| 100 | // UNWIND_X86_MODE_EBP_FRAME: | ||
| 101 | // EBP based frame where EBP is push on stack immediately after return address, | ||
| 102 | // then ESP is moved to EBP. Thus, to unwind ESP is restored with the current | ||
| 103 | // EPB value, then EBP is restored by popping off the stack, and the return | ||
| 104 | // is done by popping the stack once more into the pc. | ||
| 105 | // All non-volatile registers that need to be restored must have been saved | ||
| 106 | // in a small range in the stack that starts EBP-4 to EBP-1020. The offset/4 | ||
| 107 | // is encoded in the UNWIND_X86_EBP_FRAME_OFFSET bits. The registers saved | ||
| 108 | // are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit entries. | ||
| 109 | // Each entry contains which register to restore. | ||
| 110 | // UNWIND_X86_MODE_STACK_IMMD: | ||
| 111 | // A "frameless" (EBP not used as frame pointer) function with a small | ||
| 112 | // constant stack size. To return, a constant (encoded in the compact | ||
| 113 | // unwind encoding) is added to the ESP. Then the return is done by | ||
| 114 | // popping the stack into the pc. | ||
| 115 | // All non-volatile registers that need to be restored must have been saved | ||
| 116 | // on the stack immediately after the return address. The stack_size/4 is | ||
| 117 | // encoded in the UNWIND_X86_FRAMELESS_STACK_SIZE (max stack size is 1024). | ||
| 118 | // The number of registers saved is encoded in UNWIND_X86_FRAMELESS_STACK_REG_COUNT. | ||
| 119 | // UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION constains which registers were | ||
| 120 | // saved and their order. | ||
| 121 | // UNWIND_X86_MODE_STACK_IND: | ||
| 122 | // A "frameless" (EBP not used as frame pointer) function large constant | ||
| 123 | // stack size. This case is like the previous, except the stack size is too | ||
| 124 | // large to encode in the compact unwind encoding. Instead it requires that | ||
| 125 | // the function contains "subl $nnnnnnnn,ESP" in its prolog. The compact | ||
| 126 | // encoding contains the offset to the nnnnnnnn value in the function in | ||
| 127 | // UNWIND_X86_FRAMELESS_STACK_SIZE. | ||
| 128 | // UNWIND_X86_MODE_DWARF: | ||
| 129 | // No compact unwind encoding is available. Instead the low 24-bits of the | ||
| 130 | // compact encoding is the offset of the DWARF FDE in the __eh_frame section. | ||
| 131 | // This mode is never used in object files. It is only generated by the | ||
| 132 | // linker in final linked images which have only DWARF unwind info for a | ||
| 133 | // function. | ||
| 134 | // | ||
| 135 | // The permutation encoding is a Lehmer code sequence encoded into a | ||
| 136 | // single variable-base number so we can encode the ordering of up to | ||
| 137 | // six registers in a 10-bit space. | ||
| 138 | // | ||
| 139 | // The following is the algorithm used to create the permutation encoding used | ||
| 140 | // with frameless stacks. It is passed the number of registers to be saved and | ||
| 141 | // an array of the register numbers saved. | ||
| 142 | // | ||
| 143 | //uint32_t permute_encode(uint32_t registerCount, const uint32_t registers[6]) | ||
| 144 | //{ | ||
| 145 | // uint32_t renumregs[6]; | ||
| 146 | // for (int i=6-registerCount; i < 6; ++i) { | ||
| 147 | // int countless = 0; | ||
| 148 | // for (int j=6-registerCount; j < i; ++j) { | ||
| 149 | // if ( registers[j] < registers[i] ) | ||
| 150 | // ++countless; | ||
| 151 | // } | ||
| 152 | // renumregs[i] = registers[i] - countless -1; | ||
| 153 | // } | ||
| 154 | // uint32_t permutationEncoding = 0; | ||
| 155 | // switch ( registerCount ) { | ||
| 156 | // case 6: | ||
| 157 | // permutationEncoding |= (120*renumregs[0] + 24*renumregs[1] | ||
| 158 | // + 6*renumregs[2] + 2*renumregs[3] | ||
| 159 | // + renumregs[4]); | ||
| 160 | // break; | ||
| 161 | // case 5: | ||
| 162 | // permutationEncoding |= (120*renumregs[1] + 24*renumregs[2] | ||
| 163 | // + 6*renumregs[3] + 2*renumregs[4] | ||
| 164 | // + renumregs[5]); | ||
| 165 | // break; | ||
| 166 | // case 4: | ||
| 167 | // permutationEncoding |= (60*renumregs[2] + 12*renumregs[3] | ||
| 168 | // + 3*renumregs[4] + renumregs[5]); | ||
| 169 | // break; | ||
| 170 | // case 3: | ||
| 171 | // permutationEncoding |= (20*renumregs[3] + 4*renumregs[4] | ||
| 172 | // + renumregs[5]); | ||
| 173 | // break; | ||
| 174 | // case 2: | ||
| 175 | // permutationEncoding |= (5*renumregs[4] + renumregs[5]); | ||
| 176 | // break; | ||
| 177 | // case 1: | ||
| 178 | // permutationEncoding |= (renumregs[5]); | ||
| 179 | // break; | ||
| 180 | // } | ||
| 181 | // return permutationEncoding; | ||
| 182 | //} | ||
| 183 | // | ||
| 184 | |||
| 185 | |||
| 186 | |||
| 187 | |||
| 188 | // | ||
| 189 | // x86_64 | ||
| 190 | // | ||
| 191 | // 1-bit: start | ||
| 192 | // 1-bit: has lsda | ||
| 193 | // 2-bit: personality index | ||
| 194 | // | ||
| 195 | // 4-bits: 0=old, 1=rbp based, 2=stack-imm, 3=stack-ind, 4=DWARF | ||
| 196 | // rbp based: | ||
| 197 | // 15-bits (5*3-bits per reg) register permutation | ||
| 198 | // 8-bits for stack offset | ||
| 199 | // frameless: | ||
| 200 | // 8-bits stack size | ||
| 201 | // 3-bits stack adjust | ||
| 202 | // 3-bits register count | ||
| 203 | // 10-bits register permutation | ||
| 204 | // | ||
| 205 | enum { | ||
| 206 | UNWIND_X86_64_MODE_MASK = 0x0F000000, | ||
| 207 | UNWIND_X86_64_MODE_RBP_FRAME = 0x01000000, | ||
| 208 | UNWIND_X86_64_MODE_STACK_IMMD = 0x02000000, | ||
| 209 | UNWIND_X86_64_MODE_STACK_IND = 0x03000000, | ||
| 210 | UNWIND_X86_64_MODE_DWARF = 0x04000000, | ||
| 211 | |||
| 212 | UNWIND_X86_64_RBP_FRAME_REGISTERS = 0x00007FFF, | ||
| 213 | UNWIND_X86_64_RBP_FRAME_OFFSET = 0x00FF0000, | ||
| 214 | |||
| 215 | UNWIND_X86_64_FRAMELESS_STACK_SIZE = 0x00FF0000, | ||
| 216 | UNWIND_X86_64_FRAMELESS_STACK_ADJUST = 0x0000E000, | ||
| 217 | UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT = 0x00001C00, | ||
| 218 | UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF, | ||
| 219 | |||
| 220 | UNWIND_X86_64_DWARF_SECTION_OFFSET = 0x00FFFFFF, | ||
| 221 | }; | ||
| 222 | |||
| 223 | enum { | ||
| 224 | UNWIND_X86_64_REG_NONE = 0, | ||
| 225 | UNWIND_X86_64_REG_RBX = 1, | ||
| 226 | UNWIND_X86_64_REG_R12 = 2, | ||
| 227 | UNWIND_X86_64_REG_R13 = 3, | ||
| 228 | UNWIND_X86_64_REG_R14 = 4, | ||
| 229 | UNWIND_X86_64_REG_R15 = 5, | ||
| 230 | UNWIND_X86_64_REG_RBP = 6, | ||
| 231 | }; | ||
| 232 | // | ||
| 233 | // For x86_64 there are four modes for the compact unwind encoding: | ||
| 234 | // UNWIND_X86_64_MODE_RBP_FRAME: | ||
| 235 | // RBP based frame where RBP is push on stack immediately after return address, | ||
| 236 | // then RSP is moved to RBP. Thus, to unwind RSP is restored with the current | ||
| 237 | // EPB value, then RBP is restored by popping off the stack, and the return | ||
| 238 | // is done by popping the stack once more into the pc. | ||
| 239 | // All non-volatile registers that need to be restored must have been saved | ||
| 240 | // in a small range in the stack that starts RBP-8 to RBP-2040. The offset/8 | ||
| 241 | // is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits. The registers saved | ||
| 242 | // are encoded in the UNWIND_X86_64_RBP_FRAME_REGISTERS bits as five 3-bit entries. | ||
| 243 | // Each entry contains which register to restore. | ||
| 244 | // UNWIND_X86_64_MODE_STACK_IMMD: | ||
| 245 | // A "frameless" (RBP not used as frame pointer) function with a small | ||
| 246 | // constant stack size. To return, a constant (encoded in the compact | ||
| 247 | // unwind encoding) is added to the RSP. Then the return is done by | ||
| 248 | // popping the stack into the pc. | ||
| 249 | // All non-volatile registers that need to be restored must have been saved | ||
| 250 | // on the stack immediately after the return address. The stack_size/8 is | ||
| 251 | // encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 2048). | ||
| 252 | // The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT. | ||
| 253 | // UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION constains which registers were | ||
| 254 | // saved and their order. | ||
| 255 | // UNWIND_X86_64_MODE_STACK_IND: | ||
| 256 | // A "frameless" (RBP not used as frame pointer) function large constant | ||
| 257 | // stack size. This case is like the previous, except the stack size is too | ||
| 258 | // large to encode in the compact unwind encoding. Instead it requires that | ||
| 259 | // the function contains "subq $nnnnnnnn,RSP" in its prolog. The compact | ||
| 260 | // encoding contains the offset to the nnnnnnnn value in the function in | ||
| 261 | // UNWIND_X86_64_FRAMELESS_STACK_SIZE. | ||
| 262 | // UNWIND_X86_64_MODE_DWARF: | ||
| 263 | // No compact unwind encoding is available. Instead the low 24-bits of the | ||
| 264 | // compact encoding is the offset of the DWARF FDE in the __eh_frame section. | ||
| 265 | // This mode is never used in object files. It is only generated by the | ||
| 266 | // linker in final linked images which have only DWARF unwind info for a | ||
| 267 | // function. | ||
| 268 | // | ||
| 269 | |||
| 270 | |||
| 271 | // ARM64 | ||
| 272 | // | ||
| 273 | // 1-bit: start | ||
| 274 | // 1-bit: has lsda | ||
| 275 | // 2-bit: personality index | ||
| 276 | // | ||
| 277 | // 4-bits: 4=frame-based, 3=DWARF, 2=frameless | ||
| 278 | // frameless: | ||
| 279 | // 12-bits of stack size | ||
| 280 | // frame-based: | ||
| 281 | // 4-bits D reg pairs saved | ||
| 282 | // 5-bits X reg pairs saved | ||
| 283 | // DWARF: | ||
| 284 | // 24-bits offset of DWARF FDE in __eh_frame section | ||
| 285 | // | ||
| 286 | enum { | ||
| 287 | UNWIND_ARM64_MODE_MASK = 0x0F000000, | ||
| 288 | UNWIND_ARM64_MODE_FRAMELESS = 0x02000000, | ||
| 289 | UNWIND_ARM64_MODE_DWARF = 0x03000000, | ||
| 290 | UNWIND_ARM64_MODE_FRAME = 0x04000000, | ||
| 291 | |||
| 292 | UNWIND_ARM64_FRAME_X19_X20_PAIR = 0x00000001, | ||
| 293 | UNWIND_ARM64_FRAME_X21_X22_PAIR = 0x00000002, | ||
| 294 | UNWIND_ARM64_FRAME_X23_X24_PAIR = 0x00000004, | ||
| 295 | UNWIND_ARM64_FRAME_X25_X26_PAIR = 0x00000008, | ||
| 296 | UNWIND_ARM64_FRAME_X27_X28_PAIR = 0x00000010, | ||
| 297 | UNWIND_ARM64_FRAME_D8_D9_PAIR = 0x00000100, | ||
| 298 | UNWIND_ARM64_FRAME_D10_D11_PAIR = 0x00000200, | ||
| 299 | UNWIND_ARM64_FRAME_D12_D13_PAIR = 0x00000400, | ||
| 300 | UNWIND_ARM64_FRAME_D14_D15_PAIR = 0x00000800, | ||
| 301 | |||
| 302 | UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK = 0x00FFF000, | ||
| 303 | UNWIND_ARM64_DWARF_SECTION_OFFSET = 0x00FFFFFF, | ||
| 304 | }; | ||
| 305 | // For arm64 there are three modes for the compact unwind encoding: | ||
| 306 | // UNWIND_ARM64_MODE_FRAME: | ||
| 307 | // This is a standard arm64 prolog where FP/LR are immediately pushed on the | ||
| 308 | // stack, then SP is copied to FP. If there are any non-volatile registers | ||
| 309 | // saved, then are copied into the stack frame in pairs in a contiguous | ||
| 310 | // range right below the saved FP/LR pair. Any subset of the five X pairs | ||
| 311 | // and four D pairs can be saved, but the memory layout must be in register | ||
| 312 | // number order. | ||
| 313 | // UNWIND_ARM64_MODE_FRAMELESS: | ||
| 314 | // A "frameless" leaf function, where FP/LR are not saved. The return address | ||
| 315 | // remains in LR throughout the function. If any non-volatile registers | ||
| 316 | // are saved, they must be pushed onto the stack before any stack space is | ||
| 317 | // allocated for local variables. The stack sized (including any saved | ||
| 318 | // non-volatile registers) divided by 16 is encoded in the bits | ||
| 319 | // UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK. | ||
| 320 | // UNWIND_ARM64_MODE_DWARF: | ||
| 321 | // No compact unwind encoding is available. Instead the low 24-bits of the | ||
| 322 | // compact encoding is the offset of the DWARF FDE in the __eh_frame section. | ||
| 323 | // This mode is never used in object files. It is only generated by the | ||
| 324 | // linker in final linked images which have only DWARF unwind info for a | ||
| 325 | // function. | ||
| 326 | // | ||
| 327 | |||
| 328 | |||
| 329 | #ifndef __OPEN_SOURCE__ | ||
| 330 | // | ||
| 331 | // armv7k | ||
| 332 | // | ||
| 333 | // 1-bit: start | ||
| 334 | // 1-bit: has lsda | ||
| 335 | // 2-bit: personality index | ||
| 336 | // | ||
| 337 | // 4-bits: 1=frame, 2=frame+dregs, 4=dwarf | ||
| 338 | // | ||
| 339 | enum { | ||
| 340 | UNWIND_ARM_MODE_MASK = 0x0F000000, | ||
| 341 | UNWIND_ARM_MODE_FRAME = 0x01000000, | ||
| 342 | UNWIND_ARM_MODE_FRAME_D = 0x02000000, | ||
| 343 | UNWIND_ARM_MODE_DWARF = 0x04000000, | ||
| 344 | |||
| 345 | UNWIND_ARM_FRAME_STACK_ADJUST_MASK = 0x00C00000, | ||
| 346 | |||
| 347 | UNWIND_ARM_FRAME_FIRST_PUSH_R4 = 0x00000001, | ||
| 348 | UNWIND_ARM_FRAME_FIRST_PUSH_R5 = 0x00000002, | ||
| 349 | UNWIND_ARM_FRAME_FIRST_PUSH_R6 = 0x00000004, | ||
| 350 | |||
| 351 | UNWIND_ARM_FRAME_SECOND_PUSH_R8 = 0x00000008, | ||
| 352 | UNWIND_ARM_FRAME_SECOND_PUSH_R9 = 0x00000010, | ||
| 353 | UNWIND_ARM_FRAME_SECOND_PUSH_R10 = 0x00000020, | ||
| 354 | UNWIND_ARM_FRAME_SECOND_PUSH_R11 = 0x00000040, | ||
| 355 | UNWIND_ARM_FRAME_SECOND_PUSH_R12 = 0x00000080, | ||
| 356 | |||
| 357 | UNWIND_ARM_FRAME_D_REG_COUNT_MASK = 0x00000700, | ||
| 358 | |||
| 359 | UNWIND_ARM_DWARF_SECTION_OFFSET = 0x00FFFFFF, | ||
| 360 | }; | ||
| 361 | // For armv7k there are three modes for the compact unwind encoding: | ||
| 362 | // UNWIND_ARM_MODE_FRAME: | ||
| 363 | // This is a standard arm prolog where lr/r7 are immediately pushed on the | ||
| 364 | // stack. As part of that first push r4, r5, or r6 can be also pushed | ||
| 365 | // and if so the FIRST_PUSH bit is set in the compact unwind. Additionally | ||
| 366 | // there can be a second push multiple which can save r8 through r12. | ||
| 367 | // If that is used, the registers saved is recorded with a SECOND_PUSH bit. | ||
| 368 | // Lastly, for var-args support, the prolog may save r1, r2, r3 to the | ||
| 369 | // stack before the frame push. If that is done the STACK_ADJUST_MASK | ||
| 370 | // records that the stack pointer must be adjust (e.g 0x00800000 means | ||
| 371 | // the stack pointer was adjusted 8 bytes down and the unwinder would | ||
| 372 | // need to add back 8 bytes to SP when unwinding through this function. | ||
| 373 | // UNWIND_ARM_MODE_FRAME_D: | ||
| 374 | // This is the same as UNWIND_ARM_MODE_FRAME, except that additionally | ||
| 375 | // some D registers were saved. The D_REG_COUNT_MASK contains which | ||
| 376 | // set if D registers were saved and where. There are currently 8 (0-7) | ||
| 377 | // possible D register save patterns supported. | ||
| 378 | // UNWIND_ARM_MODE_DWARF: | ||
| 379 | // No compact unwind encoding is available. Instead the low 24-bits of the | ||
| 380 | // compact encoding is the offset of the dwarf FDE in the __eh_frame section. | ||
| 381 | // The offset only exists in final linked images. It is zero in object files. | ||
| 382 | #endif | ||
| 383 | |||
| 384 | |||
| 385 | |||
| 386 | |||
| 387 | |||
| 388 | //////////////////////////////////////////////////////////////////////////////// | ||
| 389 | // | ||
| 390 | // Relocatable Object Files: __LD,__compact_unwind | ||
| 391 | // | ||
| 392 | //////////////////////////////////////////////////////////////////////////////// | ||
| 393 | |||
| 394 | // | ||
| 395 | // A compiler can generated compact unwind information for a function by adding | ||
| 396 | // a "row" to the __LD,__compact_unwind section. This section has the | ||
| 397 | // S_ATTR_DEBUG bit set, so the section will be ignored by older linkers. | ||
| 398 | // It is removed by the new linker, so never ends up in final executables. | ||
| 399 | // This section is a table, initially with one row per function (that needs | ||
| 400 | // unwind info). The table columns and some conceptual entries are: | ||
| 401 | // | ||
| 402 | // range-start pointer to start of function/range | ||
| 403 | // range-length | ||
| 404 | // compact-unwind-encoding 32-bit encoding | ||
| 405 | // personality-function or zero if no personality function | ||
| 406 | // lsda or zero if no LSDA data | ||
| 407 | // | ||
| 408 | // The length and encoding fields are 32-bits. The other are all pointer sized. | ||
| 409 | // | ||
| 410 | // In x86_64 assembly, these entry would look like: | ||
| 411 | // | ||
| 412 | // .section __LD,__compact_unwind,regular,debug | ||
| 413 | // | ||
| 414 | // #compact unwind for _foo | ||
| 415 | // .quad _foo | ||
| 416 | // .set L1,LfooEnd-_foo | ||
| 417 | // .long L1 | ||
| 418 | // .long 0x01010001 | ||
| 419 | // .quad 0 | ||
| 420 | // .quad 0 | ||
| 421 | // | ||
| 422 | // #compact unwind for _bar | ||
| 423 | // .quad _bar | ||
| 424 | // .set L2,LbarEnd-_bar | ||
| 425 | // .long L2 | ||
| 426 | // .long 0x01020011 | ||
| 427 | // .quad __gxx_personality | ||
| 428 | // .quad except_tab1 | ||
| 429 | // | ||
| 430 | // | ||
| 431 | // Notes: There is no need for any labels in the the __compact_unwind section. | ||
| 432 | // The use of the .set directive is to force the evaluation of the | ||
| 433 | // range-length at assembly time, instead of generating relocations. | ||
| 434 | // | ||
| 435 | // To support future compiler optimizations where which non-volatile registers | ||
| 436 | // are saved changes within a function (e.g. delay saving non-volatiles until | ||
| 437 | // necessary), there can by multiple lines in the __compact_unwind table for one | ||
| 438 | // function, each with a different (non-overlapping) range and each with | ||
| 439 | // different compact unwind encodings that correspond to the non-volatiles | ||
| 440 | // saved at that range of the function. | ||
| 441 | // | ||
| 442 | // If a particular function is so wacky that there is no compact unwind way | ||
| 443 | // to encode it, then the compiler can emit traditional DWARF unwind info. | ||
| 444 | // The runtime will use which ever is available. | ||
| 445 | // | ||
| 446 | // Runtime support for compact unwind encodings are only available on 10.6 | ||
| 447 | // and later. So, the compiler should not generate it when targeting pre-10.6. | ||
| 448 | |||
| 449 | |||
| 450 | |||
| 451 | |||
| 452 | //////////////////////////////////////////////////////////////////////////////// | ||
| 453 | // | ||
| 454 | // Final Linked Images: __TEXT,__unwind_info | ||
| 455 | // | ||
| 456 | //////////////////////////////////////////////////////////////////////////////// | ||
| 457 | |||
| 458 | // | ||
| 459 | // The __TEXT,__unwind_info section is laid out for an efficient two level lookup. | ||
| 460 | // The header of the section contains a coarse index that maps function address | ||
| 461 | // to the page (4096 byte block) containing the unwind info for that function. | ||
| 462 | // | ||
| 463 | |||
| 464 | #define UNWIND_SECTION_VERSION 1 | ||
| 465 | struct unwind_info_section_header | ||
| 466 | { | ||
| 467 | uint32_t version; // UNWIND_SECTION_VERSION | ||
| 468 | uint32_t commonEncodingsArraySectionOffset; | ||
| 469 | uint32_t commonEncodingsArrayCount; | ||
| 470 | uint32_t personalityArraySectionOffset; | ||
| 471 | uint32_t personalityArrayCount; | ||
| 472 | uint32_t indexSectionOffset; | ||
| 473 | uint32_t indexCount; | ||
| 474 | // compact_unwind_encoding_t[] | ||
| 475 | // uint32_t personalities[] | ||
| 476 | // unwind_info_section_header_index_entry[] | ||
| 477 | // unwind_info_section_header_lsda_index_entry[] | ||
| 478 | }; | ||
| 479 | |||
| 480 | struct unwind_info_section_header_index_entry | ||
| 481 | { | ||
| 482 | uint32_t functionOffset; | ||
| 483 | uint32_t secondLevelPagesSectionOffset; // section offset to start of regular or compress page | ||
| 484 | uint32_t lsdaIndexArraySectionOffset; // section offset to start of lsda_index array for this range | ||
| 485 | }; | ||
| 486 | |||
| 487 | struct unwind_info_section_header_lsda_index_entry | ||
| 488 | { | ||
| 489 | uint32_t functionOffset; | ||
| 490 | uint32_t lsdaOffset; | ||
| 491 | }; | ||
| 492 | |||
| 493 | // | ||
| 494 | // There are two kinds of second level index pages: regular and compressed. | ||
| 495 | // A compressed page can hold up to 1021 entries, but it cannot be used | ||
| 496 | // if too many different encoding types are used. The regular page holds | ||
| 497 | // 511 entries. | ||
| 498 | // | ||
| 499 | |||
| 500 | struct unwind_info_regular_second_level_entry | ||
| 501 | { | ||
| 502 | uint32_t functionOffset; | ||
| 503 | compact_unwind_encoding_t encoding; | ||
| 504 | }; | ||
| 505 | |||
| 506 | #define UNWIND_SECOND_LEVEL_REGULAR 2 | ||
| 507 | struct unwind_info_regular_second_level_page_header | ||
| 508 | { | ||
| 509 | uint32_t kind; // UNWIND_SECOND_LEVEL_REGULAR | ||
| 510 | uint16_t entryPageOffset; | ||
| 511 | uint16_t entryCount; | ||
| 512 | // entry array | ||
| 513 | }; | ||
| 514 | |||
| 515 | #define UNWIND_SECOND_LEVEL_COMPRESSED 3 | ||
| 516 | struct unwind_info_compressed_second_level_page_header | ||
| 517 | { | ||
| 518 | uint32_t kind; // UNWIND_SECOND_LEVEL_COMPRESSED | ||
| 519 | uint16_t entryPageOffset; | ||
| 520 | uint16_t entryCount; | ||
| 521 | uint16_t encodingsPageOffset; | ||
| 522 | uint16_t encodingsCount; | ||
| 523 | // 32-bit entry array | ||
| 524 | // encodings array | ||
| 525 | }; | ||
| 526 | |||
| 527 | #define UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(entry) (entry & 0x00FFFFFF) | ||
| 528 | #define UNWIND_INFO_COMPRESSED_ENTRY_ENCODING_INDEX(entry) ((entry >> 24) & 0xFF) | ||
| 529 | |||
| 530 | |||
| 531 | |||
| 532 | #endif | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.13-any/mach-o/fat.h+7-4| ... | @@ -42,7 +42,10 @@ | ... | @@ -42,7 +42,10 @@ |
| 42 | * and contains the constants for the possible values of these types. | 42 | * and contains the constants for the possible values of these types. |
| 43 | */ | 43 | */ |
| 44 | #include <stdint.h> | 44 | #include <stdint.h> |
| 45 | |||
| 46 | #if __has_include(<mach/machine.h>) | ||
| 45 | #include <mach/machine.h> | 47 | #include <mach/machine.h> |
| 48 | #endif | ||
| 46 | 49 | ||
| 47 | #if __has_include(<architecture/byte_order.h>) | 50 | #if __has_include(<architecture/byte_order.h>) |
| 48 | #include <architecture/byte_order.h> | 51 | #include <architecture/byte_order.h> |
| ... | @@ -57,8 +60,8 @@ struct fat_header { | ... | @@ -57,8 +60,8 @@ struct fat_header { |
| 57 | }; | 60 | }; |
| 58 | 61 | ||
| 59 | struct fat_arch { | 62 | struct fat_arch { |
| 60 | 	cpu_type_t	cputype;	/* cpu specifier (int) */ | 63 | 	int32_t		cputype;	/* cpu specifier (int) */ |
| 61 | 	cpu_subtype_t	cpusubtype;	/* machine specifier (int) */ | 64 | 	int32_t		cpusubtype;	/* machine specifier (int) */ |
| 62 | 	uint32_t	offset;		/* file offset to this object file */ | 65 | 	uint32_t	offset;		/* file offset to this object file */ |
| 63 | 	uint32_t	size;		/* size of this object file */ | 66 | 	uint32_t	size;		/* size of this object file */ |
| 64 | 	uint32_t	align;		/* alignment as a power of 2 */ | 67 | 	uint32_t	align;		/* alignment as a power of 2 */ |
| ... | @@ -75,8 +78,8 @@ struct fat_arch { | ... | @@ -75,8 +78,8 @@ struct fat_arch { |
| 75 | #define FAT_CIGAM_64	0xbfbafeca	/* NXSwapLong(FAT_MAGIC_64) */ | 78 | #define FAT_CIGAM_64	0xbfbafeca	/* NXSwapLong(FAT_MAGIC_64) */ |
| 76 | 79 | ||
| 77 | struct fat_arch_64 { | 80 | struct fat_arch_64 { |
| 78 | 	cpu_type_t	cputype;	/* cpu specifier (int) */ | 81 | 	int32_t		cputype;	/* cpu specifier (int) */ |
| 79 | 	cpu_subtype_t	cpusubtype;	/* machine specifier (int) */ | 82 | 	int32_t		cpusubtype;	/* machine specifier (int) */ |
| 80 | 	uint64_t	offset;		/* file offset to this object file */ | 83 | 	uint64_t	offset;		/* file offset to this object file */ |
| 81 | 	uint64_t	size;		/* size of this object file */ | 84 | 	uint64_t	size;		/* size of this object file */ |
| 82 | 	uint32_t	align;		/* alignment as a power of 2 */ | 85 | 	uint32_t	align;		/* alignment as a power of 2 */ |
lib/libc/include/any-macos.13-any/mach/mach_host.h+2-2| ... | @@ -297,7 +297,7 @@ extern | ... | @@ -297,7 +297,7 @@ extern |
| 297 | #endif	/* mig_external */ | 297 | #endif	/* mig_external */ |
| 298 | kern_return_t mach_zone_info | 298 | kern_return_t mach_zone_info |
| 299 | ( | 299 | ( |
| 300 | 	host_priv_t host, | 300 | 	mach_port_t host, |
| 301 | 	mach_zone_name_array_t *names, | 301 | 	mach_zone_name_array_t *names, |
| 302 | 	mach_msg_type_number_t *namesCnt, | 302 | 	mach_msg_type_number_t *namesCnt, |
| 303 | 	mach_zone_info_array_t *info, | 303 | 	mach_zone_info_array_t *info, |
| ... | @@ -385,7 +385,7 @@ extern | ... | @@ -385,7 +385,7 @@ extern |
| 385 | #endif	/* mig_external */ | 385 | #endif	/* mig_external */ |
| 386 | kern_return_t mach_memory_info | 386 | kern_return_t mach_memory_info |
| 387 | ( | 387 | ( |
| 388 | 	host_priv_t host, | 388 | 	mach_port_t host, |
| 389 | 	mach_zone_name_array_t *names, | 389 | 	mach_zone_name_array_t *names, |
| 390 | 	mach_msg_type_number_t *namesCnt, | 390 | 	mach_msg_type_number_t *namesCnt, |
| 391 | 	mach_zone_info_array_t *info, | 391 | 	mach_zone_info_array_t *info, |
lib/libc/include/any-macos.13-any/mach/mach_types.h+6-2| ... | @@ -217,8 +217,12 @@ typedef clock_ctrl_t clock_ctrl_port_t; | ... | @@ -217,8 +217,12 @@ typedef clock_ctrl_t clock_ctrl_port_t; |
| 217 | typedef exception_handler_t exception_port_t; | 217 | typedef exception_handler_t exception_port_t; |
| 218 | typedef exception_handler_array_t exception_port_arrary_t; | 218 | typedef exception_handler_array_t exception_port_arrary_t; |
| 219 | typedef char vfs_path_t[4096]; | 219 | typedef char vfs_path_t[4096]; |
| 220 | typedef char nspace_path_t[1024]; /* 1024 == PATH_MAX */ | 220 | /* |
| 221 | typedef char nspace_name_t[1024]; /* 1024 == PATH_MAX */ | 221 | * 8K, c.f. FSGETPATH_MAXBUFLEN in bsd/vfs/vfs_syscalls.c. |
| 222 | * These types should NEVER be allocated on the stack. | ||
| 223 | */ | ||
| 224 | typedef char nspace_path_t[8192]; | ||
| 225 | typedef char nspace_name_t[8192]; | ||
| 222 | 226 | ||
| 223 | #define TASK_NULL ((task_t) 0) | 227 | #define TASK_NULL ((task_t) 0) |
| 224 | #define TASK_NAME_NULL ((task_name_t) 0) | 228 | #define TASK_NAME_NULL ((task_name_t) 0) |
lib/libc/include/any-macos.13-any/mach/port.h+1| ... | @@ -400,6 +400,7 @@ enum mach_port_guard_exception_codes { | ... | @@ -400,6 +400,7 @@ enum mach_port_guard_exception_codes { |
| 400 | 	kGUARD_EXC_MOD_REFS = 2, | 400 | 	kGUARD_EXC_MOD_REFS = 2, |
| 401 | 	kGUARD_EXC_INVALID_OPTIONS = 3, | 401 | 	kGUARD_EXC_INVALID_OPTIONS = 3, |
| 402 | 	kGUARD_EXC_SET_CONTEXT = 4, | 402 | 	kGUARD_EXC_SET_CONTEXT = 4, |
| 403 | 	kGUARD_EXC_THREAD_SET_STATE = 5, | ||
| 403 | 	kGUARD_EXC_UNGUARDED = 1u << 3, | 404 | 	kGUARD_EXC_UNGUARDED = 1u << 3, |
| 404 | 	kGUARD_EXC_INCORRECT_GUARD = 1u << 4, | 405 | 	kGUARD_EXC_INCORRECT_GUARD = 1u << 4, |
| 405 | 	kGUARD_EXC_IMMOVABLE = 1u << 5, | 406 | 	kGUARD_EXC_IMMOVABLE = 1u << 5, |
lib/libc/include/any-macos.13-any/mach/vm_statistics.h+4-1| ... | @@ -284,11 +284,12 @@ typedef struct vm_purgeable_info *vm_purgeable_info_t; | ... | @@ -284,11 +284,12 @@ typedef struct vm_purgeable_info *vm_purgeable_info_t; |
| 284 | #define VM_FLAGS_RETURN_4K_DATA_ADDR 0x00800000 /* Return 4K aligned address of target data */ | 284 | #define VM_FLAGS_RETURN_4K_DATA_ADDR 0x00800000 /* Return 4K aligned address of target data */ |
| 285 | #define VM_FLAGS_ALIAS_MASK 0xFF000000 | 285 | #define VM_FLAGS_ALIAS_MASK 0xFF000000 |
| 286 | #define VM_GET_FLAGS_ALIAS(flags, alias) \ | 286 | #define VM_GET_FLAGS_ALIAS(flags, alias) \ |
| 287 | 	 (alias) = ((flags) & VM_FLAGS_ALIAS_MASK) >> 24 | 287 | 	 (alias) = (((flags) >> 24) & 0xff) |
| 288 | #define VM_SET_FLAGS_ALIAS(flags, alias) \ | 288 | #define VM_SET_FLAGS_ALIAS(flags, alias) \ |
| 289 | 	 (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | \ | 289 | 	 (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | \ |
| 290 | 	 (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24)) | 290 | 	 (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24)) |
| 291 | 291 | ||
| 292 | |||
| 292 | /* These are the flags that we accept from user-space */ | 293 | /* These are the flags that we accept from user-space */ |
| 293 | #define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED | \ | 294 | #define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED | \ |
| 294 | 	 VM_FLAGS_ANYWHERE | \ | 295 | 	 VM_FLAGS_ANYWHERE | \ |
| ... | @@ -301,9 +302,11 @@ typedef struct vm_purgeable_info *vm_purgeable_info_t; | ... | @@ -301,9 +302,11 @@ typedef struct vm_purgeable_info *vm_purgeable_info_t; |
| 301 | 	 VM_FLAGS_SUPERPAGE_MASK | \ | 302 | 	 VM_FLAGS_SUPERPAGE_MASK | \ |
| 302 | 	 VM_FLAGS_TPRO | \ | 303 | 	 VM_FLAGS_TPRO | \ |
| 303 | 	 VM_FLAGS_ALIAS_MASK) | 304 | 	 VM_FLAGS_ALIAS_MASK) |
| 305 | |||
| 304 | #define VM_FLAGS_USER_MAP (VM_FLAGS_USER_ALLOCATE | \ | 306 | #define VM_FLAGS_USER_MAP (VM_FLAGS_USER_ALLOCATE | \ |
| 305 | 	 VM_FLAGS_RETURN_4K_DATA_ADDR | \ | 307 | 	 VM_FLAGS_RETURN_4K_DATA_ADDR | \ |
| 306 | 	 VM_FLAGS_RETURN_DATA_ADDR) | 308 | 	 VM_FLAGS_RETURN_DATA_ADDR) |
| 309 | |||
| 307 | #define VM_FLAGS_USER_REMAP (VM_FLAGS_FIXED | \ | 310 | #define VM_FLAGS_USER_REMAP (VM_FLAGS_FIXED | \ |
| 308 | 	 VM_FLAGS_ANYWHERE | \ | 311 | 	 VM_FLAGS_ANYWHERE | \ |
| 309 | 	 VM_FLAGS_RANDOM_ADDR | \ | 312 | 	 VM_FLAGS_RANDOM_ADDR | \ |
lib/libc/include/any-macos.13-any/mach/vm_types.h+1-1| ... | @@ -66,7 +66,7 @@ typedef uint32_t reg64_t; | ... | @@ -66,7 +66,7 @@ typedef uint32_t reg64_t; |
| 66 | * addresses (that are page aligned) as 32-bit page numbers. | 66 | * addresses (that are page aligned) as 32-bit page numbers. |
| 67 | * This limits the physical address space to 16TB of RAM. | 67 | * This limits the physical address space to 16TB of RAM. |
| 68 | */ | 68 | */ |
| 69 | typedef uint32_t ppnum_t; /* Physical page number */ | 69 | typedef uint32_t ppnum_t __kernel_ptr_semantics; /* Physical page number */ |
| 70 | #define PPNUM_MAX UINT32_MAX | 70 | #define PPNUM_MAX UINT32_MAX |
| 71 | 71 | ||
| 72 | 72 |
lib/libc/include/any-macos.13-any/net/if_var.h+1| ... | @@ -75,6 +75,7 @@ | ... | @@ -75,6 +75,7 @@ |
| 75 | #endif | 75 | #endif |
| 76 | 76 | ||
| 77 | 77 | ||
| 78 | |||
| 78 | #ifdef __APPLE__ | 79 | #ifdef __APPLE__ |
| 79 | #define APPLE_IF_FAM_LOOPBACK 1 | 80 | #define APPLE_IF_FAM_LOOPBACK 1 |
| 80 | #define APPLE_IF_FAM_ETHERNET 2 | 81 | #define APPLE_IF_FAM_ETHERNET 2 |
lib/libc/include/any-macos.13-any/objc/NSObject.h created+115| ... | @@ -0,0 +1,115 @@ | ||
| 1 | /*	NSObject.h | ||
| 2 | 	Copyright (c) 1994-2012, Apple Inc. All rights reserved. | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _OBJC_NSOBJECT_H_ | ||
| 6 | #define _OBJC_NSOBJECT_H_ | ||
| 7 | |||
| 8 | #if __OBJC__ | ||
| 9 | |||
| 10 | #include <objc/objc.h> | ||
| 11 | #include <objc/NSObjCRuntime.h> | ||
| 12 | |||
| 13 | @class NSString, NSMethodSignature, NSInvocation; | ||
| 14 | |||
| 15 | @protocol NSObject | ||
| 16 | |||
| 17 | - (BOOL)isEqual:(id)object; | ||
| 18 | @property (readonly) NSUInteger hash; | ||
| 19 | |||
| 20 | @property (readonly) Class superclass; | ||
| 21 | - (Class)class OBJC_SWIFT_UNAVAILABLE("use 'type(of: anObject)' instead"); | ||
| 22 | - (instancetype)self; | ||
| 23 | |||
| 24 | - (id)performSelector:(SEL)aSelector; | ||
| 25 | - (id)performSelector:(SEL)aSelector withObject:(id)object; | ||
| 26 | - (id)performSelector:(SEL)aSelector withObject:(id)object1 withObject:(id)object2; | ||
| 27 | |||
| 28 | - (BOOL)isProxy; | ||
| 29 | |||
| 30 | - (BOOL)isKindOfClass:(Class)aClass; | ||
| 31 | - (BOOL)isMemberOfClass:(Class)aClass; | ||
| 32 | - (BOOL)conformsToProtocol:(Protocol *)aProtocol; | ||
| 33 | |||
| 34 | - (BOOL)respondsToSelector:(SEL)aSelector; | ||
| 35 | |||
| 36 | - (instancetype)retain OBJC_ARC_UNAVAILABLE; | ||
| 37 | - (oneway void)release OBJC_ARC_UNAVAILABLE; | ||
| 38 | - (instancetype)autorelease OBJC_ARC_UNAVAILABLE; | ||
| 39 | - (NSUInteger)retainCount OBJC_ARC_UNAVAILABLE; | ||
| 40 | |||
| 41 | - (struct _NSZone *)zone OBJC_ARC_UNAVAILABLE; | ||
| 42 | |||
| 43 | @property (readonly, copy) NSString *description; | ||
| 44 | @optional | ||
| 45 | @property (readonly, copy) NSString *debugDescription; | ||
| 46 | |||
| 47 | @end | ||
| 48 | |||
| 49 | |||
| 50 | OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0) | ||
| 51 | OBJC_ROOT_CLASS | ||
| 52 | OBJC_EXPORT | ||
| 53 | @interface NSObject <NSObject> { | ||
| 54 | #pragma clang diagnostic push | ||
| 55 | #pragma clang diagnostic ignored "-Wobjc-interface-ivars" | ||
| 56 | Class isa OBJC_ISA_AVAILABILITY; | ||
| 57 | #pragma clang diagnostic pop | ||
| 58 | } | ||
| 59 | |||
| 60 | #pragma clang diagnostic push | ||
| 61 | #pragma clang diagnostic ignored "-Wobjc-load-method" | ||
| 62 | + (void)load; | ||
| 63 | #pragma clang diagnostic pop | ||
| 64 | |||
| 65 | + (void)initialize; | ||
| 66 | - (instancetype)init | ||
| 67 | #if NS_ENFORCE_NSOBJECT_DESIGNATED_INITIALIZER | ||
| 68 | NS_DESIGNATED_INITIALIZER | ||
| 69 | #endif | ||
| 70 | ; | ||
| 71 | |||
| 72 | + (instancetype)new OBJC_SWIFT_UNAVAILABLE("use object initializers instead"); | ||
| 73 | + (instancetype)allocWithZone:(struct _NSZone *)zone OBJC_SWIFT_UNAVAILABLE("use object initializers instead"); | ||
| 74 | + (instancetype)alloc OBJC_SWIFT_UNAVAILABLE("use object initializers instead"); | ||
| 75 | - (void)dealloc OBJC_SWIFT_UNAVAILABLE("use 'deinit' to define a de-initializer"); | ||
| 76 | |||
| 77 | - (void)finalize OBJC_DEPRECATED("Objective-C garbage collection is no longer supported"); | ||
| 78 | |||
| 79 | - (id)copy; | ||
| 80 | - (id)mutableCopy; | ||
| 81 | |||
| 82 | + (id)copyWithZone:(struct _NSZone *)zone OBJC_ARC_UNAVAILABLE; | ||
| 83 | + (id)mutableCopyWithZone:(struct _NSZone *)zone OBJC_ARC_UNAVAILABLE; | ||
| 84 | |||
| 85 | + (BOOL)instancesRespondToSelector:(SEL)aSelector; | ||
| 86 | + (BOOL)conformsToProtocol:(Protocol *)protocol; | ||
| 87 | - (IMP)methodForSelector:(SEL)aSelector; | ||
| 88 | + (IMP)instanceMethodForSelector:(SEL)aSelector; | ||
| 89 | - (void)doesNotRecognizeSelector:(SEL)aSelector; | ||
| 90 | |||
| 91 | - (id)forwardingTargetForSelector:(SEL)aSelector OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 92 | - (void)forwardInvocation:(NSInvocation *)anInvocation OBJC_SWIFT_UNAVAILABLE(""); | ||
| 93 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector OBJC_SWIFT_UNAVAILABLE(""); | ||
| 94 | |||
| 95 | + (NSMethodSignature *)instanceMethodSignatureForSelector:(SEL)aSelector OBJC_SWIFT_UNAVAILABLE(""); | ||
| 96 | |||
| 97 | - (BOOL)allowsWeakReference UNAVAILABLE_ATTRIBUTE; | ||
| 98 | - (BOOL)retainWeakReference UNAVAILABLE_ATTRIBUTE; | ||
| 99 | |||
| 100 | + (BOOL)isSubclassOfClass:(Class)aClass; | ||
| 101 | |||
| 102 | + (BOOL)resolveClassMethod:(SEL)sel OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 103 | + (BOOL)resolveInstanceMethod:(SEL)sel OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); | ||
| 104 | |||
| 105 | + (NSUInteger)hash; | ||
| 106 | + (Class)superclass; | ||
| 107 | + (Class)class OBJC_SWIFT_UNAVAILABLE("use 'aClass.self' instead"); | ||
| 108 | + (NSString *)description; | ||
| 109 | + (NSString *)debugDescription; | ||
| 110 | |||
| 111 | @end | ||
| 112 | |||
| 113 | #endif | ||
| 114 | |||
| 115 | #endif | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.13-any/objc/runtime.h+12-10| ... | @@ -542,7 +542,7 @@ class_getInstanceMethod(Class _Nullable cls, SEL _Nonnull name) | ... | @@ -542,7 +542,7 @@ class_getInstanceMethod(Class _Nullable cls, SEL _Nonnull name) |
| 542 | * | 542 | * |
| 543 | * @return A pointer to the \c Method data structure that corresponds to the implementation of the | 543 | * @return A pointer to the \c Method data structure that corresponds to the implementation of the |
| 544 | * selector specified by aSelector for the class specified by aClass, or NULL if the specified | 544 | * selector specified by aSelector for the class specified by aClass, or NULL if the specified |
| 545 | * class or its superclasses do not contain an instance method with the specified selector. | 545 | * class or its superclasses do not contain a class method with the specified selector. |
| 546 | * | 546 | * |
| 547 | * @note Note that this function searches superclasses for implementations, | 547 | * @note Note that this function searches superclasses for implementations, |
| 548 | * whereas \c class_copyMethodList does not. | 548 | * whereas \c class_copyMethodList does not. |
| ... | @@ -1898,6 +1898,17 @@ _objc_realizeClassFromSwift(Class _Nullable cls, void * _Nullable previously) | ... | @@ -1898,6 +1898,17 @@ _objc_realizeClassFromSwift(Class _Nullable cls, void * _Nullable previously) |
| 1898 | 1898 | ||
| 1899 | struct objc_method_list; | 1899 | struct objc_method_list; |
| 1900 | 1900 | ||
| 1901 | /* Used for testing only */ | ||
| 1902 | |||
| 1903 | OBJC_EXPORT void | ||
| 1904 | _objc_flush_caches(Class _Nullable cls) | ||
| 1905 | __OSX_DEPRECATED(10.0, 10.5, "not recommended") | ||
| 1906 | __IOS_DEPRECATED(2.0, 2.0, "not recommended") | ||
| 1907 | __TVOS_DEPRECATED(9.0, 9.0, "not recommended") | ||
| 1908 | __WATCHOS_DEPRECATED(1.0, 1.0, "not recommended") | ||
| 1909 | |||
| 1910 | ; | ||
| 1911 | |||
| 1901 | /* Obsolete functions */ | 1912 | /* Obsolete functions */ |
| 1902 | 1913 | ||
| 1903 | #if !0 | 1914 | #if !0 |
| ... | @@ -1919,15 +1930,6 @@ class_respondsToMethod(Class _Nullable cls, SEL _Nonnull sel) | ... | @@ -1919,15 +1930,6 @@ class_respondsToMethod(Class _Nullable cls, SEL _Nonnull sel) |
| 1919 | 1930 | ||
| 1920 | ; | 1931 | ; |
| 1921 | 1932 | ||
| 1922 | OBJC_EXPORT void | ||
| 1923 | _objc_flush_caches(Class _Nullable cls) | ||
| 1924 | __OSX_DEPRECATED(10.0, 10.5, "not recommended") | ||
| 1925 | __IOS_DEPRECATED(2.0, 2.0, "not recommended") | ||
| 1926 | __TVOS_DEPRECATED(9.0, 9.0, "not recommended") | ||
| 1927 | __WATCHOS_DEPRECATED(1.0, 1.0, "not recommended") | ||
| 1928 | |||
| 1929 | ; | ||
| 1930 | |||
| 1931 | OBJC_EXPORT id _Nullable | 1933 | OBJC_EXPORT id _Nullable |
| 1932 | object_copyFromZone(id _Nullable anObject, size_t nBytes, void * _Nullable z) | 1934 | object_copyFromZone(id _Nullable anObject, size_t nBytes, void * _Nullable z) |
| 1933 | OBJC_OSX_DEPRECATED_OTHERS_UNAVAILABLE(10.0, 10.5, "use object_copy instead"); | 1935 | OBJC_OSX_DEPRECATED_OTHERS_UNAVAILABLE(10.0, 10.5, "use object_copy instead"); |
lib/libc/include/any-macos.13-any/simd/simd.h created+30| ... | @@ -0,0 +1,30 @@ | ||
| 1 | /* Copyright (c) 2014 Apple, Inc. All rights reserved. | ||
| 2 | * | ||
| 3 | * This header provides small vector (simd) and matrix types, and basic | ||
| 4 | * arithmetic and mathematical functions for them. The vast majority of these | ||
| 5 | * operations are implemented as header inlines, as they can be performed | ||
| 6 | * using just a few instructions on most processors. | ||
| 7 | * | ||
| 8 | * These functions are broken into two groups; vector and matrix. This header | ||
| 9 | * includes all of them, but these may also be included separately. Consult | ||
| 10 | * these two headers for detailed documentation of what types and operations | ||
| 11 | * are available. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __SIMD_HEADER__ | ||
| 15 | #define __SIMD_HEADER__ | ||
| 16 | |||
| 17 | #if __has_include(<realtime_safety/realtime_safety.h>) | ||
| 18 | #include <realtime_safety/realtime_safety.h> | ||
| 19 | REALTIME_SAFE_BEGIN | ||
| 20 | #endif | ||
| 21 | |||
| 22 | #include <simd/vector.h> | ||
| 23 | #include <simd/matrix.h> | ||
| 24 | #include <simd/quaternion.h> | ||
| 25 | |||
| 26 | #if __has_include(<realtime_safety/realtime_safety.h>) | ||
| 27 | REALTIME_SAFE_END | ||
| 28 | #endif | ||
| 29 | |||
| 30 | #endif | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.13-any/sys/_symbol_aliasing.h+24| ... | @@ -389,6 +389,18 @@ | ... | @@ -389,6 +389,18 @@ |
| 389 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_2(x) | 389 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_2(x) |
| 390 | #endif | 390 | #endif |
| 391 | 391 | ||
| 392 | #if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 160300 | ||
| 393 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_3(x) x | ||
| 394 | #else | ||
| 395 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_3(x) | ||
| 396 | #endif | ||
| 397 | |||
| 398 | #if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 160400 | ||
| 399 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_4(x) x | ||
| 400 | #else | ||
| 401 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_16_4(x) | ||
| 402 | #endif | ||
| 403 | |||
| 392 | #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000 | 404 | #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000 |
| 393 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x | 405 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x |
| 394 | #else | 406 | #else |
| ... | @@ -645,4 +657,16 @@ | ... | @@ -645,4 +657,16 @@ |
| 645 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_13_1(x) x | 657 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_13_1(x) x |
| 646 | #else | 658 | #else |
| 647 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_13_1(x) | 659 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_13_1(x) |
| 660 | #endif | ||
| 661 | |||
| 662 | #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 130200 | ||
| 663 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_13_2(x) x | ||
| 664 | #else | ||
| 665 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_13_2(x) | ||
| 666 | #endif | ||
| 667 | |||
| 668 | #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 130300 | ||
| 669 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_13_3(x) x | ||
| 670 | #else | ||
| 671 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_13_3(x) | ||
| 648 | #endif | 672 | #endif |
| \ No newline at end of file | |||
lib/libc/include/any-macos.13-any/sys/attr.h created+594| ... | @@ -0,0 +1,594 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2018 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | |||
| 29 | /* | ||
| 30 | * attr.h - attribute data structures and interfaces | ||
| 31 | * | ||
| 32 | * Copyright (c) 1998, Apple Computer, Inc. All Rights Reserved. | ||
| 33 | */ | ||
| 34 | |||
| 35 | #ifndef _SYS_ATTR_H_ | ||
| 36 | #define _SYS_ATTR_H_ | ||
| 37 | |||
| 38 | #include <sys/appleapiopts.h> | ||
| 39 | |||
| 40 | #ifdef __APPLE_API_UNSTABLE | ||
| 41 | #include <sys/types.h> | ||
| 42 | #include <sys/ucred.h> | ||
| 43 | #include <sys/time.h> | ||
| 44 | #include <sys/cdefs.h> | ||
| 45 | |||
| 46 | #define FSOPT_NOFOLLOW 0x00000001 | ||
| 47 | #define FSOPT_NOINMEMUPDATE 0x00000002 | ||
| 48 | #define FSOPT_REPORT_FULLSIZE 0x00000004 | ||
| 49 | /* The following option only valid when requesting ATTR_CMN_RETURNED_ATTRS */ | ||
| 50 | #define FSOPT_PACK_INVAL_ATTRS 0x00000008 | ||
| 51 | |||
| 52 | |||
| 53 | #define FSOPT_ATTR_CMN_EXTENDED 0x00000020 | ||
| 54 | #define FSOPT_RETURN_REALDEV 0x00000200 | ||
| 55 | #define FSOPT_NOFOLLOW_ANY 0x00000800 | ||
| 56 | |||
| 57 | /* we currently aren't anywhere near this amount for a valid | ||
| 58 | * fssearchblock.sizeofsearchparams1 or fssearchblock.sizeofsearchparams2 | ||
| 59 | * but we put a sanity check in to avoid abuse of the value passed in from | ||
| 60 | * user land. | ||
| 61 | */ | ||
| 62 | #define SEARCHFS_MAX_SEARCHPARMS 4096 | ||
| 63 | |||
| 64 | typedef u_int32_t text_encoding_t; | ||
| 65 | |||
| 66 | typedef u_int32_t fsobj_type_t; | ||
| 67 | |||
| 68 | typedef u_int32_t fsobj_tag_t; | ||
| 69 | |||
| 70 | typedef u_int32_t fsfile_type_t; | ||
| 71 | |||
| 72 | typedef u_int32_t fsvolid_t; | ||
| 73 | |||
| 74 | #include <sys/_types/_fsobj_id_t.h> /* file object id type */ | ||
| 75 | |||
| 76 | typedef u_int32_t attrgroup_t; | ||
| 77 | |||
| 78 | struct attrlist { | ||
| 79 | 	u_short bitmapcount; /* number of attr. bit sets in list (should be 5) */ | ||
| 80 | 	u_int16_t reserved; /* (to maintain 4-byte alignment) */ | ||
| 81 | 	attrgroup_t commonattr; /* common attribute group */ | ||
| 82 | 	attrgroup_t volattr; /* Volume attribute group */ | ||
| 83 | 	attrgroup_t dirattr; /* directory attribute group */ | ||
| 84 | 	attrgroup_t fileattr; /* file attribute group */ | ||
| 85 | 	attrgroup_t forkattr; /* fork attribute group */ | ||
| 86 | }; | ||
| 87 | |||
| 88 | #define ATTR_BIT_MAP_COUNT 5 | ||
| 89 | |||
| 90 | typedef struct attribute_set { | ||
| 91 | 	attrgroup_t commonattr; /* common attribute group */ | ||
| 92 | 	attrgroup_t volattr; /* Volume attribute group */ | ||
| 93 | 	attrgroup_t dirattr; /* directory attribute group */ | ||
| 94 | 	attrgroup_t fileattr; /* file attribute group */ | ||
| 95 | 	attrgroup_t forkattr; /* fork attribute group */ | ||
| 96 | } attribute_set_t; | ||
| 97 | |||
| 98 | #define ATTRIBUTE_SET_INIT(a) do {(a)->commonattr = (a)->volattr = (a)->dirattr = (a)->fileattr = (a)->forkattr = 0; } while(0) | ||
| 99 | |||
| 100 | |||
| 101 | typedef struct attrreference { | ||
| 102 | 	int32_t attr_dataoffset; | ||
| 103 | 	u_int32_t attr_length; | ||
| 104 | } attrreference_t; | ||
| 105 | |||
| 106 | /* XXX PPD This is derived from HFSVolumePriv.h and should perhaps be referenced from there? */ | ||
| 107 | |||
| 108 | struct diskextent { | ||
| 109 | 	u_int32_t startblock; /* first block allocated */ | ||
| 110 | 	u_int32_t blockcount; /* number of blocks allocated */ | ||
| 111 | }; | ||
| 112 | |||
| 113 | typedef struct diskextent extentrecord[8]; | ||
| 114 | |||
| 115 | typedef u_int32_t vol_capabilities_set_t[4]; | ||
| 116 | |||
| 117 | #define VOL_CAPABILITIES_FORMAT 0 | ||
| 118 | #define VOL_CAPABILITIES_INTERFACES 1 | ||
| 119 | #define VOL_CAPABILITIES_RESERVED1 2 | ||
| 120 | #define VOL_CAPABILITIES_RESERVED2 3 | ||
| 121 | |||
| 122 | typedef struct vol_capabilities_attr { | ||
| 123 | 	vol_capabilities_set_t capabilities; | ||
| 124 | 	vol_capabilities_set_t valid; | ||
| 125 | } vol_capabilities_attr_t; | ||
| 126 | |||
| 127 | /* | ||
| 128 | * XXX this value needs to be raised - 3893388 | ||
| 129 | */ | ||
| 130 | #define ATTR_MAX_BUFFER 8192 | ||
| 131 | |||
| 132 | /* | ||
| 133 | * VOL_CAP_FMT_PERSISTENTOBJECTIDS: When set, the volume has object IDs | ||
| 134 | * that are persistent (retain their values even when the volume is | ||
| 135 | * unmounted and remounted), and a file or directory can be looked up | ||
| 136 | * by ID. Volumes that support VolFS and can support Carbon File ID | ||
| 137 | * references should set this bit. | ||
| 138 | * | ||
| 139 | * VOL_CAP_FMT_SYMBOLICLINKS: When set, the volume supports symbolic | ||
| 140 | * links. The symlink(), readlink(), and lstat() calls all use this | ||
| 141 | * symbolic link. | ||
| 142 | * | ||
| 143 | * VOL_CAP_FMT_HARDLINKS: When set, the volume supports hard links. | ||
| 144 | * The link() call creates hard links. | ||
| 145 | * | ||
| 146 | * VOL_CAP_FMT_JOURNAL: When set, the volume is capable of supporting | ||
| 147 | * a journal used to speed recovery in case of unplanned shutdown | ||
| 148 | * (such as a power outage or crash). This bit does not necessarily | ||
| 149 | * mean the volume is actively using a journal for recovery. | ||
| 150 | * | ||
| 151 | * VOL_CAP_FMT_JOURNAL_ACTIVE: When set, the volume is currently using | ||
| 152 | * a journal for use in speeding recovery after an unplanned shutdown. | ||
| 153 | * This bit can be set only if VOL_CAP_FMT_JOURNAL is also set. | ||
| 154 | * | ||
| 155 | * VOL_CAP_FMT_NO_ROOT_TIMES: When set, the volume format does not | ||
| 156 | * store reliable times for the root directory, so you should not | ||
| 157 | * depend on them to detect changes, etc. | ||
| 158 | * | ||
| 159 | * VOL_CAP_FMT_SPARSE_FILES: When set, the volume supports sparse files. | ||
| 160 | * That is, files which can have "holes" that have never been written | ||
| 161 | * to, and are not allocated on disk. Sparse files may have an | ||
| 162 | * allocated size that is less than the file's logical length. | ||
| 163 | * | ||
| 164 | * VOL_CAP_FMT_ZERO_RUNS: For security reasons, parts of a file (runs) | ||
| 165 | * that have never been written to must appear to contain zeroes. When | ||
| 166 | * this bit is set, the volume keeps track of allocated but unwritten | ||
| 167 | * runs of a file so that it can substitute zeroes without actually | ||
| 168 | * writing zeroes to the media. This provides performance similar to | ||
| 169 | * sparse files, but not the space savings. | ||
| 170 | * | ||
| 171 | * VOL_CAP_FMT_CASE_SENSITIVE: When set, file and directory names are | ||
| 172 | * case sensitive (upper and lower case are different). When clear, | ||
| 173 | * an upper case character is equivalent to a lower case character, | ||
| 174 | * and you can't have two names that differ solely in the case of | ||
| 175 | * the characters. | ||
| 176 | * | ||
| 177 | * VOL_CAP_FMT_CASE_PRESERVING: When set, file and directory names | ||
| 178 | * preserve the difference between upper and lower case. If clear, | ||
| 179 | * the volume may change the case of some characters (typically | ||
| 180 | * making them all upper or all lower case). A volume that sets | ||
| 181 | * VOL_CAP_FMT_CASE_SENSITIVE should also set VOL_CAP_FMT_CASE_PRESERVING. | ||
| 182 | * | ||
| 183 | * VOL_CAP_FMT_FAST_STATFS: This bit is used as a hint to upper layers | ||
| 184 | * (especially Carbon) that statfs() is fast enough that its results | ||
| 185 | * need not be cached by those upper layers. A volume that caches | ||
| 186 | * the statfs information in its in-memory structures should set this bit. | ||
| 187 | * A volume that must always read from disk or always perform a network | ||
| 188 | * transaction should not set this bit. | ||
| 189 | * | ||
| 190 | * VOL_CAP_FMT_2TB_FILESIZE: If this bit is set the volume format supports | ||
| 191 | * file sizes larger than 4GB, and potentially up to 2TB; it does not | ||
| 192 | * indicate whether the filesystem supports files larger than that. | ||
| 193 | * | ||
| 194 | * VOL_CAP_FMT_OPENDENYMODES: When set, the volume supports open deny | ||
| 195 | * modes (e.g. "open for read write, deny write"; effectively, mandatory | ||
| 196 | * file locking based on open modes). | ||
| 197 | * | ||
| 198 | * VOL_CAP_FMT_HIDDEN_FILES: When set, the volume supports the UF_HIDDEN | ||
| 199 | * file flag, and the UF_HIDDEN flag is mapped to that volume's native | ||
| 200 | * "hidden" or "invisible" bit (which may be the invisible bit from the | ||
| 201 | * Finder Info extended attribute). | ||
| 202 | * | ||
| 203 | * VOL_CAP_FMT_PATH_FROM_ID: When set, the volume supports the ability | ||
| 204 | * to derive a pathname to the root of the file system given only the | ||
| 205 | * id of an object. This also implies that object ids on this file | ||
| 206 | * system are persistent and not recycled. This is a very specialized | ||
| 207 | * capability and it is assumed that most file systems will not support | ||
| 208 | * it. Its use is for legacy non-posix APIs like ResolveFileIDRef. | ||
| 209 | * | ||
| 210 | * VOL_CAP_FMT_NO_VOLUME_SIZES: When set, the volume does not support | ||
| 211 | * returning values for total data blocks, available blocks, or free blocks | ||
| 212 | * (as in f_blocks, f_bavail, or f_bfree in "struct statfs"). Historically, | ||
| 213 | * those values were set to 0xFFFFFFFF for volumes that did not support them. | ||
| 214 | * | ||
| 215 | * VOL_CAP_FMT_DECMPFS_COMPRESSION: When set, the volume supports transparent | ||
| 216 | * decompression of compressed files using decmpfs. | ||
| 217 | * | ||
| 218 | * VOL_CAP_FMT_64BIT_OBJECT_IDS: When set, the volume uses object IDs that | ||
| 219 | * are 64-bit. This means that ATTR_CMN_FILEID and ATTR_CMN_PARENTID are the | ||
| 220 | * only legitimate attributes for obtaining object IDs from this volume and the | ||
| 221 | * 32-bit fid_objno fields of the fsobj_id_t returned by ATTR_CMN_OBJID, | ||
| 222 | * ATTR_CMN_OBJPERMID, and ATTR_CMN_PAROBJID are undefined. | ||
| 223 | * | ||
| 224 | * VOL_CAP_FMT_DIR_HARDLINKS: When set, the volume supports directory | ||
| 225 | * hard links. | ||
| 226 | * | ||
| 227 | * VOL_CAP_FMT_DOCUMENT_ID: When set, the volume supports document IDs | ||
| 228 | * (an ID which persists across object ID changes) for document revisions. | ||
| 229 | * | ||
| 230 | * VOL_CAP_FMT_WRITE_GENERATION_COUNT: When set, the volume supports write | ||
| 231 | * generation counts (a count of how many times an object has been modified) | ||
| 232 | * | ||
| 233 | * VOL_CAP_FMT_NO_IMMUTABLE_FILES: When set, the volume does not support | ||
| 234 | * setting the UF_IMMUTABLE flag. | ||
| 235 | * | ||
| 236 | * VOL_CAP_FMT_NO_PERMISSIONS: When set, the volume does not support setting | ||
| 237 | * permissions. | ||
| 238 | * | ||
| 239 | * VOL_CAP_FMT_SHARED_SPACE: When set, the volume supports sharing space with | ||
| 240 | * other filesystems i.e. multiple logical filesystems can exist in the same | ||
| 241 | * "partition". An implication of this is that the filesystem which sets | ||
| 242 | * this capability treats waitfor arguments to VFS_SYNC as bit flags. | ||
| 243 | * | ||
| 244 | * VOL_CAP_FMT_VOL_GROUPS: When set, this volume is part of a volume-group | ||
| 245 | * that implies multiple volumes must be mounted in order to boot and root the | ||
| 246 | * operating system. Typically, this means a read-only system volume and a | ||
| 247 | * writable data volume. | ||
| 248 | * | ||
| 249 | * VOL_CAP_FMT_SEALED: When set, this volume is cryptographically sealed. | ||
| 250 | * Any modifications to volume data or metadata will be detected and may | ||
| 251 | * render the volume unusable. | ||
| 252 | */ | ||
| 253 | #define VOL_CAP_FMT_PERSISTENTOBJECTIDS 0x00000001 | ||
| 254 | #define VOL_CAP_FMT_SYMBOLICLINKS 0x00000002 | ||
| 255 | #define VOL_CAP_FMT_HARDLINKS 0x00000004 | ||
| 256 | #define VOL_CAP_FMT_JOURNAL 0x00000008 | ||
| 257 | #define VOL_CAP_FMT_JOURNAL_ACTIVE 0x00000010 | ||
| 258 | #define VOL_CAP_FMT_NO_ROOT_TIMES 0x00000020 | ||
| 259 | #define VOL_CAP_FMT_SPARSE_FILES 0x00000040 | ||
| 260 | #define VOL_CAP_FMT_ZERO_RUNS 0x00000080 | ||
| 261 | #define VOL_CAP_FMT_CASE_SENSITIVE 0x00000100 | ||
| 262 | #define VOL_CAP_FMT_CASE_PRESERVING 0x00000200 | ||
| 263 | #define VOL_CAP_FMT_FAST_STATFS 0x00000400 | ||
| 264 | #define VOL_CAP_FMT_2TB_FILESIZE 0x00000800 | ||
| 265 | #define VOL_CAP_FMT_OPENDENYMODES 0x00001000 | ||
| 266 | #define VOL_CAP_FMT_HIDDEN_FILES 0x00002000 | ||
| 267 | #define VOL_CAP_FMT_PATH_FROM_ID 0x00004000 | ||
| 268 | #define VOL_CAP_FMT_NO_VOLUME_SIZES 0x00008000 | ||
| 269 | #define VOL_CAP_FMT_DECMPFS_COMPRESSION 0x00010000 | ||
| 270 | #define VOL_CAP_FMT_64BIT_OBJECT_IDS 0x00020000 | ||
| 271 | #define VOL_CAP_FMT_DIR_HARDLINKS 0x00040000 | ||
| 272 | #define VOL_CAP_FMT_DOCUMENT_ID 0x00080000 | ||
| 273 | #define VOL_CAP_FMT_WRITE_GENERATION_COUNT 0x00100000 | ||
| 274 | #define VOL_CAP_FMT_NO_IMMUTABLE_FILES 0x00200000 | ||
| 275 | #define VOL_CAP_FMT_NO_PERMISSIONS 0x00400000 | ||
| 276 | #define VOL_CAP_FMT_SHARED_SPACE 0x00800000 | ||
| 277 | #define VOL_CAP_FMT_VOL_GROUPS 0x01000000 | ||
| 278 | #define VOL_CAP_FMT_SEALED 0x02000000 | ||
| 279 | |||
| 280 | /* | ||
| 281 | * VOL_CAP_INT_SEARCHFS: When set, the volume implements the | ||
| 282 | * searchfs() system call (the vnop_searchfs vnode operation). | ||
| 283 | * | ||
| 284 | * VOL_CAP_INT_ATTRLIST: When set, the volume implements the | ||
| 285 | * getattrlist() and setattrlist() system calls (vnop_getattrlist | ||
| 286 | * and vnop_setattrlist vnode operations) for the volume, files, | ||
| 287 | * and directories. The volume may or may not implement the | ||
| 288 | * readdirattr() system call. XXX Is there any minimum set | ||
| 289 | * of attributes that should be supported? To determine the | ||
| 290 | * set of supported attributes, get the ATTR_VOL_ATTRIBUTES | ||
| 291 | * attribute of the volume. | ||
| 292 | * | ||
| 293 | * VOL_CAP_INT_NFSEXPORT: When set, the volume implements exporting | ||
| 294 | * of NFS volumes. | ||
| 295 | * | ||
| 296 | * VOL_CAP_INT_READDIRATTR: When set, the volume implements the | ||
| 297 | * readdirattr() system call (vnop_readdirattr vnode operation). | ||
| 298 | * | ||
| 299 | * VOL_CAP_INT_EXCHANGEDATA: When set, the volume implements the | ||
| 300 | * exchangedata() system call (VNOP_EXCHANGE vnode operation). | ||
| 301 | * | ||
| 302 | * VOL_CAP_INT_COPYFILE: When set, the volume implements the | ||
| 303 | * VOP_COPYFILE vnode operation. (XXX There should be a copyfile() | ||
| 304 | * system call in <unistd.h>.) | ||
| 305 | * | ||
| 306 | * VOL_CAP_INT_ALLOCATE: When set, the volume implements the | ||
| 307 | * VNOP_ALLOCATE vnode operation, which means it implements the | ||
| 308 | * F_PREALLOCATE selector of fcntl(2). | ||
| 309 | * | ||
| 310 | * VOL_CAP_INT_VOL_RENAME: When set, the volume implements the | ||
| 311 | * ATTR_VOL_NAME attribute for both getattrlist() and setattrlist(). | ||
| 312 | * The volume can be renamed by setting ATTR_VOL_NAME with setattrlist(). | ||
| 313 | * | ||
| 314 | * VOL_CAP_INT_ADVLOCK: When set, the volume implements POSIX style | ||
| 315 | * byte range locks via vnop_advlock (accessible from fcntl(2)). | ||
| 316 | * | ||
| 317 | * VOL_CAP_INT_FLOCK: When set, the volume implements whole-file flock(2) | ||
| 318 | * style locks via vnop_advlock. This includes the O_EXLOCK and O_SHLOCK | ||
| 319 | * flags of the open(2) call. | ||
| 320 | * | ||
| 321 | * VOL_CAP_INT_EXTENDED_SECURITY: When set, the volume implements | ||
| 322 | * extended security (ACLs). | ||
| 323 | * | ||
| 324 | * VOL_CAP_INT_USERACCESS: When set, the volume supports the | ||
| 325 | * ATTR_CMN_USERACCESS attribute (used to get the user's access | ||
| 326 | * mode to the file). | ||
| 327 | * | ||
| 328 | * VOL_CAP_INT_MANLOCK: When set, the volume supports AFP-style | ||
| 329 | * mandatory byte range locks via an ioctl(). | ||
| 330 | * | ||
| 331 | * VOL_CAP_INT_EXTENDED_ATTR: When set, the volume implements | ||
| 332 | * native extended attribues. | ||
| 333 | * | ||
| 334 | * VOL_CAP_INT_NAMEDSTREAMS: When set, the volume supports | ||
| 335 | * native named streams. | ||
| 336 | * | ||
| 337 | * VOL_CAP_INT_CLONE: When set, the volume supports clones. | ||
| 338 | * | ||
| 339 | * VOL_CAP_INT_SNAPSHOT: When set, the volume supports snapshots. | ||
| 340 | * | ||
| 341 | * VOL_CAP_INT_RENAME_SWAP: When set, the volume supports swapping | ||
| 342 | * file system objects. | ||
| 343 | * | ||
| 344 | * VOL_CAP_INT_RENAME_EXCL: When set, the volume supports an | ||
| 345 | * exclusive rename operation. | ||
| 346 | * | ||
| 347 | * VOL_CAP_INT_RENAME_OPENFAIL: When set, the volume may fail rename | ||
| 348 | * operations on files that are open. | ||
| 349 | */ | ||
| 350 | #define VOL_CAP_INT_SEARCHFS 0x00000001 | ||
| 351 | #define VOL_CAP_INT_ATTRLIST 0x00000002 | ||
| 352 | #define VOL_CAP_INT_NFSEXPORT 0x00000004 | ||
| 353 | #define VOL_CAP_INT_READDIRATTR 0x00000008 | ||
| 354 | #define VOL_CAP_INT_EXCHANGEDATA 0x00000010 | ||
| 355 | #define VOL_CAP_INT_COPYFILE 0x00000020 | ||
| 356 | #define VOL_CAP_INT_ALLOCATE 0x00000040 | ||
| 357 | #define VOL_CAP_INT_VOL_RENAME 0x00000080 | ||
| 358 | #define VOL_CAP_INT_ADVLOCK 0x00000100 | ||
| 359 | #define VOL_CAP_INT_FLOCK 0x00000200 | ||
| 360 | #define VOL_CAP_INT_EXTENDED_SECURITY 0x00000400 | ||
| 361 | #define VOL_CAP_INT_USERACCESS 0x00000800 | ||
| 362 | #define VOL_CAP_INT_MANLOCK 0x00001000 | ||
| 363 | #define VOL_CAP_INT_NAMEDSTREAMS 0x00002000 | ||
| 364 | #define VOL_CAP_INT_EXTENDED_ATTR 0x00004000 | ||
| 365 | #define VOL_CAP_INT_CLONE 0x00010000 | ||
| 366 | #define VOL_CAP_INT_SNAPSHOT 0x00020000 | ||
| 367 | #define VOL_CAP_INT_RENAME_SWAP 0x00040000 | ||
| 368 | #define VOL_CAP_INT_RENAME_EXCL 0x00080000 | ||
| 369 | #define VOL_CAP_INT_RENAME_OPENFAIL 0x00100000 | ||
| 370 | |||
| 371 | typedef struct vol_attributes_attr { | ||
| 372 | 	attribute_set_t validattr; | ||
| 373 | 	attribute_set_t nativeattr; | ||
| 374 | } vol_attributes_attr_t; | ||
| 375 | |||
| 376 | #define ATTR_CMN_NAME 0x00000001 | ||
| 377 | #define ATTR_CMN_DEVID 0x00000002 | ||
| 378 | #define ATTR_CMN_FSID 0x00000004 | ||
| 379 | #define ATTR_CMN_OBJTYPE 0x00000008 | ||
| 380 | #define ATTR_CMN_OBJTAG 0x00000010 | ||
| 381 | #define ATTR_CMN_OBJID 0x00000020 | ||
| 382 | #define ATTR_CMN_OBJPERMANENTID 0x00000040 | ||
| 383 | #define ATTR_CMN_PAROBJID 0x00000080 | ||
| 384 | #define ATTR_CMN_SCRIPT 0x00000100 | ||
| 385 | #define ATTR_CMN_CRTIME 0x00000200 | ||
| 386 | #define ATTR_CMN_MODTIME 0x00000400 | ||
| 387 | #define ATTR_CMN_CHGTIME 0x00000800 | ||
| 388 | #define ATTR_CMN_ACCTIME 0x00001000 | ||
| 389 | #define ATTR_CMN_BKUPTIME 0x00002000 | ||
| 390 | #define ATTR_CMN_FNDRINFO 0x00004000 | ||
| 391 | #define ATTR_CMN_OWNERID 0x00008000 | ||
| 392 | #define ATTR_CMN_GRPID 0x00010000 | ||
| 393 | #define ATTR_CMN_ACCESSMASK 0x00020000 | ||
| 394 | #define ATTR_CMN_FLAGS 0x00040000 | ||
| 395 | |||
| 396 | /* The following were defined as:				*/ | ||
| 397 | /* #define ATTR_CMN_NAMEDATTRCOUNT		0x00080000	*/ | ||
| 398 | /* #define ATTR_CMN_NAMEDATTRLIST		0x00100000	*/ | ||
| 399 | /* These bits have been salvaged for use as:			*/ | ||
| 400 | /*	#define ATTR_CMN_GEN_COUNT		0x00080000	*/ | ||
| 401 | /*	#define ATTR_CMN_DOCUMENT_ID		0x00100000	*/ | ||
| 402 | /* They can only be used with the FSOPT_ATTR_CMN_EXTENDED	*/ | ||
| 403 | /* option flag. */ | ||
| 404 | |||
| 405 | #define ATTR_CMN_GEN_COUNT 0x00080000 | ||
| 406 | #define ATTR_CMN_DOCUMENT_ID 0x00100000 | ||
| 407 | |||
| 408 | #define ATTR_CMN_USERACCESS 0x00200000 | ||
| 409 | #define ATTR_CMN_EXTENDED_SECURITY 0x00400000 | ||
| 410 | #define ATTR_CMN_UUID 0x00800000 | ||
| 411 | #define ATTR_CMN_GRPUUID 0x01000000 | ||
| 412 | #define ATTR_CMN_FILEID 0x02000000 | ||
| 413 | #define ATTR_CMN_PARENTID 0x04000000 | ||
| 414 | #define ATTR_CMN_FULLPATH 0x08000000 | ||
| 415 | #define ATTR_CMN_ADDEDTIME 0x10000000 | ||
| 416 | #define ATTR_CMN_ERROR 0x20000000 | ||
| 417 | #define ATTR_CMN_DATA_PROTECT_FLAGS 0x40000000 | ||
| 418 | |||
| 419 | /* | ||
| 420 | * ATTR_CMN_RETURNED_ATTRS is only valid with getattrlist(2) and | ||
| 421 | * getattrlistbulk(2). It is always the first attribute in the return buffer. | ||
| 422 | */ | ||
| 423 | #define ATTR_CMN_RETURNED_ATTRS 0x80000000 | ||
| 424 | |||
| 425 | #define ATTR_CMN_VALIDMASK 0xFFFFFFFF | ||
| 426 | /* | ||
| 427 | * The settable ATTR_CMN_* attributes include the following: | ||
| 428 | * ATTR_CMN_SCRIPT | ||
| 429 | * ATTR_CMN_CRTIME | ||
| 430 | * ATTR_CMN_MODTIME | ||
| 431 | * ATTR_CMN_CHGTIME | ||
| 432 | * | ||
| 433 | * ATTR_CMN_ACCTIME | ||
| 434 | * ATTR_CMN_BKUPTIME | ||
| 435 | * ATTR_CMN_FNDRINFO | ||
| 436 | * ATTR_CMN_OWNERID | ||
| 437 | * | ||
| 438 | * ATTR_CMN_GRPID | ||
| 439 | * ATTR_CMN_ACCESSMASK | ||
| 440 | * ATTR_CMN_FLAGS | ||
| 441 | * | ||
| 442 | * ATTR_CMN_EXTENDED_SECURITY | ||
| 443 | * ATTR_CMN_UUID | ||
| 444 | * | ||
| 445 | * ATTR_CMN_GRPUUID | ||
| 446 | * | ||
| 447 | * ATTR_CMN_DATA_PROTECT_FLAGS | ||
| 448 | */ | ||
| 449 | #define ATTR_CMN_SETMASK 0x51C7FF00 | ||
| 450 | #define ATTR_CMN_VOLSETMASK 0x00006700 | ||
| 451 | |||
| 452 | #define ATTR_VOL_FSTYPE 0x00000001 | ||
| 453 | #define ATTR_VOL_SIGNATURE 0x00000002 | ||
| 454 | #define ATTR_VOL_SIZE 0x00000004 | ||
| 455 | #define ATTR_VOL_SPACEFREE 0x00000008 | ||
| 456 | #define ATTR_VOL_SPACEAVAIL 0x00000010 | ||
| 457 | #define ATTR_VOL_MINALLOCATION 0x00000020 | ||
| 458 | #define ATTR_VOL_ALLOCATIONCLUMP 0x00000040 | ||
| 459 | #define ATTR_VOL_IOBLOCKSIZE 0x00000080 | ||
| 460 | #define ATTR_VOL_OBJCOUNT 0x00000100 | ||
| 461 | #define ATTR_VOL_FILECOUNT 0x00000200 | ||
| 462 | #define ATTR_VOL_DIRCOUNT 0x00000400 | ||
| 463 | #define ATTR_VOL_MAXOBJCOUNT 0x00000800 | ||
| 464 | #define ATTR_VOL_MOUNTPOINT 0x00001000 | ||
| 465 | #define ATTR_VOL_NAME 0x00002000 | ||
| 466 | #define ATTR_VOL_MOUNTFLAGS 0x00004000 | ||
| 467 | #define ATTR_VOL_MOUNTEDDEVICE 0x00008000 | ||
| 468 | #define ATTR_VOL_ENCODINGSUSED 0x00010000 | ||
| 469 | #define ATTR_VOL_CAPABILITIES 0x00020000 | ||
| 470 | #define ATTR_VOL_UUID 0x00040000 | ||
| 471 | #define ATTR_VOL_FSTYPENAME 0x00100000 | ||
| 472 | #define ATTR_VOL_FSSUBTYPE 0x00200000 | ||
| 473 | #define ATTR_VOL_SPACEUSED 0x00800000 | ||
| 474 | #define ATTR_VOL_QUOTA_SIZE 0x10000000 | ||
| 475 | #define ATTR_VOL_RESERVED_SIZE 0x20000000 | ||
| 476 | #define ATTR_VOL_ATTRIBUTES 0x40000000 | ||
| 477 | #define ATTR_VOL_INFO 0x80000000 | ||
| 478 | |||
| 479 | #define ATTR_VOL_VALIDMASK 0xF0B7FFFF | ||
| 480 | |||
| 481 | /* | ||
| 482 | * The list of settable ATTR_VOL_* attributes include the following: | ||
| 483 | * ATTR_VOL_NAME | ||
| 484 | * ATTR_VOL_INFO | ||
| 485 | */ | ||
| 486 | #define ATTR_VOL_SETMASK 0x80002000 | ||
| 487 | |||
| 488 | |||
| 489 | /* File/directory attributes: */ | ||
| 490 | #define ATTR_DIR_LINKCOUNT 0x00000001 | ||
| 491 | #define ATTR_DIR_ENTRYCOUNT 0x00000002 | ||
| 492 | #define ATTR_DIR_MOUNTSTATUS 0x00000004 | ||
| 493 | #define ATTR_DIR_ALLOCSIZE 0x00000008 | ||
| 494 | #define ATTR_DIR_IOBLOCKSIZE 0x00000010 | ||
| 495 | #define ATTR_DIR_DATALENGTH 0x00000020 | ||
| 496 | |||
| 497 | /* ATTR_DIR_MOUNTSTATUS Flags: */ | ||
| 498 | #define DIR_MNTSTATUS_MNTPOINT 0x00000001 | ||
| 499 | #define DIR_MNTSTATUS_TRIGGER 0x00000002 | ||
| 500 | |||
| 501 | #define ATTR_DIR_VALIDMASK 0x0000003f | ||
| 502 | #define ATTR_DIR_SETMASK 0x00000000 | ||
| 503 | |||
| 504 | #define ATTR_FILE_LINKCOUNT 0x00000001 | ||
| 505 | #define ATTR_FILE_TOTALSIZE 0x00000002 | ||
| 506 | #define ATTR_FILE_ALLOCSIZE 0x00000004 | ||
| 507 | #define ATTR_FILE_IOBLOCKSIZE 0x00000008 | ||
| 508 | #define ATTR_FILE_DEVTYPE 0x00000020 | ||
| 509 | #define ATTR_FILE_FORKCOUNT 0x00000080 | ||
| 510 | #define ATTR_FILE_FORKLIST 0x00000100 | ||
| 511 | #define ATTR_FILE_DATALENGTH 0x00000200 | ||
| 512 | #define ATTR_FILE_DATAALLOCSIZE 0x00000400 | ||
| 513 | #define ATTR_FILE_RSRCLENGTH 0x00001000 | ||
| 514 | #define ATTR_FILE_RSRCALLOCSIZE 0x00002000 | ||
| 515 | |||
| 516 | #define ATTR_FILE_VALIDMASK 0x000037FF | ||
| 517 | /* | ||
| 518 | * Settable ATTR_FILE_* attributes include: | ||
| 519 | * ATTR_FILE_DEVTYPE | ||
| 520 | */ | ||
| 521 | #define ATTR_FILE_SETMASK 0x00000020 | ||
| 522 | |||
| 523 | /* CMNEXT attributes extend the common attributes, but in the forkattr field */ | ||
| 524 | #define ATTR_CMNEXT_RELPATH 0x00000004 | ||
| 525 | #define ATTR_CMNEXT_PRIVATESIZE 0x00000008 | ||
| 526 | #define ATTR_CMNEXT_LINKID 0x00000010 | ||
| 527 | #define ATTR_CMNEXT_NOFIRMLINKPATH 0x00000020 | ||
| 528 | #define ATTR_CMNEXT_REALDEVID 0x00000040 | ||
| 529 | #define ATTR_CMNEXT_REALFSID 0x00000080 | ||
| 530 | #define ATTR_CMNEXT_CLONEID 0x00000100 | ||
| 531 | #define ATTR_CMNEXT_EXT_FLAGS 0x00000200 | ||
| 532 | #define ATTR_CMNEXT_RECURSIVE_GENCOUNT 0x00000400 | ||
| 533 | |||
| 534 | #define ATTR_CMNEXT_VALIDMASK 0x000007fc | ||
| 535 | #define ATTR_CMNEXT_SETMASK 0x00000000 | ||
| 536 | |||
| 537 | /* Deprecated fork attributes */ | ||
| 538 | #define ATTR_FORK_TOTALSIZE 0x00000001 | ||
| 539 | #define ATTR_FORK_ALLOCSIZE 0x00000002 | ||
| 540 | #define ATTR_FORK_RESERVED 0xffffffff | ||
| 541 | |||
| 542 | #define ATTR_FORK_VALIDMASK 0x00000003 | ||
| 543 | #define ATTR_FORK_SETMASK 0x00000000 | ||
| 544 | |||
| 545 | /* Obsolete, implemented, not supported */ | ||
| 546 | #define ATTR_CMN_NAMEDATTRCOUNT 0x00080000 | ||
| 547 | #define ATTR_CMN_NAMEDATTRLIST 0x00100000 | ||
| 548 | #define ATTR_FILE_CLUMPSIZE 0x00000010 /* obsolete */ | ||
| 549 | #define ATTR_FILE_FILETYPE 0x00000040 /* always zero */ | ||
| 550 | #define ATTR_FILE_DATAEXTENTS 0x00000800 /* obsolete, HFS-specific */ | ||
| 551 | #define ATTR_FILE_RSRCEXTENTS 0x00004000 /* obsolete, HFS-specific */ | ||
| 552 | |||
| 553 | /* Required attributes for getattrlistbulk(2) */ | ||
| 554 | #define ATTR_BULK_REQUIRED (ATTR_CMN_NAME | ATTR_CMN_RETURNED_ATTRS) | ||
| 555 | |||
| 556 | /* | ||
| 557 | * Searchfs | ||
| 558 | */ | ||
| 559 | #define SRCHFS_START 0x00000001 | ||
| 560 | #define SRCHFS_MATCHPARTIALNAMES 0x00000002 | ||
| 561 | #define SRCHFS_MATCHDIRS 0x00000004 | ||
| 562 | #define SRCHFS_MATCHFILES 0x00000008 | ||
| 563 | #define SRCHFS_SKIPLINKS 0x00000010 | ||
| 564 | #define SRCHFS_SKIPINVISIBLE 0x00000020 | ||
| 565 | #define SRCHFS_SKIPPACKAGES 0x00000040 | ||
| 566 | #define SRCHFS_SKIPINAPPROPRIATE 0x00000080 | ||
| 567 | |||
| 568 | #define SRCHFS_NEGATEPARAMS 0x80000000 | ||
| 569 | #define SRCHFS_VALIDOPTIONSMASK 0x800000FF | ||
| 570 | |||
| 571 | struct fssearchblock { | ||
| 572 | 	struct attrlist *returnattrs; | ||
| 573 | 	void *returnbuffer; | ||
| 574 | 	size_t returnbuffersize; | ||
| 575 | 	u_long maxmatches; | ||
| 576 | 	struct timeval timelimit; | ||
| 577 | 	void *searchparams1; | ||
| 578 | 	size_t sizeofsearchparams1; | ||
| 579 | 	void *searchparams2; | ||
| 580 | 	size_t sizeofsearchparams2; | ||
| 581 | 	struct attrlist searchattrs; | ||
| 582 | }; | ||
| 583 | |||
| 584 | |||
| 585 | struct searchstate { | ||
| 586 | 	uint32_t ss_union_flags; // for SRCHFS_START | ||
| 587 | 	uint32_t ss_union_layer; // 0 = top | ||
| 588 | 	u_char ss_fsstate[548]; // fs private | ||
| 589 | } __attribute__((packed)); | ||
| 590 | |||
| 591 | #define FST_EOF (-1) /* end-of-file offset */ | ||
| 592 | |||
| 593 | #endif /* __APPLE_API_UNSTABLE */ | ||
| 594 | #endif /* !_SYS_ATTR_H_ */ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.13-any/sys/mman.h created+265| ... | @@ -0,0 +1,265 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000-2020 Apple Computer, Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. The rights granted to you under the License | ||
| 10 | * may not be used to create, or enable the creation or redistribution of, | ||
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | ||
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | ||
| 13 | * terms of an Apple operating system software license agreement. | ||
| 14 | * | ||
| 15 | * Please obtain a copy of the License at | ||
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | ||
| 17 | * | ||
| 18 | * The Original Code and all software distributed under the License are | ||
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 23 | * Please see the License for the specific language governing rights and | ||
| 24 | * limitations under the License. | ||
| 25 | * | ||
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | ||
| 27 | */ | ||
| 28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | ||
| 29 | /*- | ||
| 30 | * Copyright (c) 1982, 1986, 1993 | ||
| 31 | *	The Regents of the University of California. All rights reserved. | ||
| 32 | * | ||
| 33 | * Redistribution and use in source and binary forms, with or without | ||
| 34 | * modification, are permitted provided that the following conditions | ||
| 35 | * are met: | ||
| 36 | * 1. Redistributions of source code must retain the above copyright | ||
| 37 | * notice, this list of conditions and the following disclaimer. | ||
| 38 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 39 | * notice, this list of conditions and the following disclaimer in the | ||
| 40 | * documentation and/or other materials provided with the distribution. | ||
| 41 | * 3. All advertising materials mentioning features or use of this software | ||
| 42 | * must display the following acknowledgement: | ||
| 43 | *	This product includes software developed by the University of | ||
| 44 | *	California, Berkeley and its contributors. | ||
| 45 | * 4. Neither the name of the University nor the names of its contributors | ||
| 46 | * may be used to endorse or promote products derived from this software | ||
| 47 | * without specific prior written permission. | ||
| 48 | * | ||
| 49 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 50 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 51 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 59 | * SUCH DAMAGE. | ||
| 60 | * | ||
| 61 | *	@(#)mman.h	8.1 (Berkeley) 6/2/93 | ||
| 62 | */ | ||
| 63 | |||
| 64 | /* | ||
| 65 | * Currently unsupported: | ||
| 66 | * | ||
| 67 | * [TYM]	POSIX_TYPED_MEM_ALLOCATE | ||
| 68 | * [TYM]	POSIX_TYPED_MEM_ALLOCATE_CONTIG | ||
| 69 | * [TYM]	POSIX_TYPED_MEM_MAP_ALLOCATABLE | ||
| 70 | * [TYM]	struct posix_typed_mem_info | ||
| 71 | * [TYM]	posix_mem_offset() | ||
| 72 | * [TYM]	posix_typed_mem_get_info() | ||
| 73 | * [TYM]	posix_typed_mem_open() | ||
| 74 | */ | ||
| 75 | |||
| 76 | #ifndef _SYS_MMAN_H_ | ||
| 77 | #define _SYS_MMAN_H_ | ||
| 78 | |||
| 79 | #include <sys/appleapiopts.h> | ||
| 80 | #include <sys/cdefs.h> | ||
| 81 | |||
| 82 | #include <sys/_types.h> | ||
| 83 | |||
| 84 | /* | ||
| 85 | * [various] The mode_t, off_t, and size_t types shall be defined as | ||
| 86 | * described in <sys/types.h> | ||
| 87 | */ | ||
| 88 | #include <sys/_types/_mode_t.h> | ||
| 89 | #include <sys/_types/_off_t.h> | ||
| 90 | #include <sys/_types/_size_t.h> | ||
| 91 | |||
| 92 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 93 | #include <Availability.h> | ||
| 94 | #endif /* __DARWIN_C_LEVEL */ | ||
| 95 | |||
| 96 | /* | ||
| 97 | * Protections are chosen from these bits, or-ed together | ||
| 98 | */ | ||
| 99 | #define PROT_NONE 0x00 /* [MC2] no permissions */ | ||
| 100 | #define PROT_READ 0x01 /* [MC2] pages can be read */ | ||
| 101 | #define PROT_WRITE 0x02 /* [MC2] pages can be written */ | ||
| 102 | #define PROT_EXEC 0x04 /* [MC2] pages can be executed */ | ||
| 103 | |||
| 104 | /* | ||
| 105 | * Flags contain sharing type and options. | ||
| 106 | * Sharing types; choose one. | ||
| 107 | */ | ||
| 108 | #define MAP_SHARED 0x0001 /* [MF|SHM] share changes */ | ||
| 109 | #define MAP_PRIVATE 0x0002 /* [MF|SHM] changes are private */ | ||
| 110 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 111 | #define MAP_COPY MAP_PRIVATE /* Obsolete */ | ||
| 112 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 113 | |||
| 114 | /* | ||
| 115 | * Other flags | ||
| 116 | */ | ||
| 117 | #define MAP_FIXED 0x0010 /* [MF|SHM] interpret addr exactly */ | ||
| 118 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 119 | #define MAP_RENAME 0x0020 /* Sun: rename private pages to file */ | ||
| 120 | #define MAP_NORESERVE 0x0040 /* Sun: don't reserve needed swap area */ | ||
| 121 | #define MAP_RESERVED0080 0x0080 /* previously unimplemented MAP_INHERIT */ | ||
| 122 | #define MAP_NOEXTEND 0x0100 /* for MAP_FILE, don't change file size */ | ||
| 123 | #define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */ | ||
| 124 | #define MAP_NOCACHE 0x0400 /* don't cache pages for this mapping */ | ||
| 125 | #define MAP_JIT 0x0800 /* Allocate a region that will be used for JIT purposes */ | ||
| 126 | |||
| 127 | /* | ||
| 128 | * Mapping type | ||
| 129 | */ | ||
| 130 | #define MAP_FILE 0x0000 /* map from file (default) */ | ||
| 131 | #define MAP_ANON 0x1000 /* allocated from memory, swap space */ | ||
| 132 | #define MAP_ANONYMOUS MAP_ANON | ||
| 133 | |||
| 134 | /* | ||
| 135 | * The MAP_RESILIENT_* flags can be used when the caller wants to map some | ||
| 136 | * possibly unreliable memory and be able to access it safely, possibly | ||
| 137 | * getting the wrong contents rather than raising any exception. | ||
| 138 | * For safety reasons, such mappings have to be read-only (PROT_READ access | ||
| 139 | * only). | ||
| 140 | * | ||
| 141 | * MAP_RESILIENT_CODESIGN: | ||
| 142 | * accessing this mapping will not generate code-signing violations, | ||
| 143 | *	even if the contents are tainted. | ||
| 144 | * MAP_RESILIENT_MEDIA: | ||
| 145 | *	accessing this mapping will not generate an exception if the contents | ||
| 146 | *	are not available (unreachable removable or remote media, access beyond | ||
| 147 | *	end-of-file, ...). Missing contents will be replaced with zeroes. | ||
| 148 | */ | ||
| 149 | #define MAP_RESILIENT_CODESIGN 0x2000 /* no code-signing failures */ | ||
| 150 | #define MAP_RESILIENT_MEDIA 0x4000 /* no backing-store failures */ | ||
| 151 | |||
| 152 | #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 | ||
| 153 | #define MAP_32BIT 0x8000 /* Return virtual addresses <4G only */ | ||
| 154 | #endif /* defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 */ | ||
| 155 | |||
| 156 | |||
| 157 | /* | ||
| 158 | * Flags used to support translated processes. | ||
| 159 | */ | ||
| 160 | #define MAP_TRANSLATED_ALLOW_EXECUTE 0x20000 /* allow execute in translated processes */ | ||
| 161 | |||
| 162 | #define MAP_UNIX03 0x40000 /* UNIX03 compliance */ | ||
| 163 | |||
| 164 | #define MAP_TPRO 0x80000 /* Allocate a region that will be protected by TPRO */ | ||
| 165 | |||
| 166 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 167 | |||
| 168 | /* | ||
| 169 | * Process memory locking | ||
| 170 | */ | ||
| 171 | #define MCL_CURRENT 0x0001 /* [ML] Lock only current memory */ | ||
| 172 | #define MCL_FUTURE 0x0002 /* [ML] Lock all future memory as well */ | ||
| 173 | |||
| 174 | /* | ||
| 175 | * Error return from mmap() | ||
| 176 | */ | ||
| 177 | #define MAP_FAILED ((void *)-1) /* [MF|SHM] mmap failed */ | ||
| 178 | |||
| 179 | /* | ||
| 180 | * msync() flags | ||
| 181 | */ | ||
| 182 | #define MS_ASYNC 0x0001 /* [MF|SIO] return immediately */ | ||
| 183 | #define MS_INVALIDATE 0x0002 /* [MF|SIO] invalidate all cached data */ | ||
| 184 | #define MS_SYNC 0x0010 /* [MF|SIO] msync synchronously */ | ||
| 185 | |||
| 186 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 187 | #define MS_KILLPAGES 0x0004 /* invalidate pages, leave mapped */ | ||
| 188 | #define MS_DEACTIVATE 0x0008 /* deactivate pages, leave mapped */ | ||
| 189 | |||
| 190 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 191 | |||
| 192 | |||
| 193 | /* | ||
| 194 | * Advice to madvise | ||
| 195 | */ | ||
| 196 | #define POSIX_MADV_NORMAL 0 /* [MC1] no further special treatment */ | ||
| 197 | #define POSIX_MADV_RANDOM 1 /* [MC1] expect random page refs */ | ||
| 198 | #define POSIX_MADV_SEQUENTIAL 2 /* [MC1] expect sequential page refs */ | ||
| 199 | #define POSIX_MADV_WILLNEED 3 /* [MC1] will need these pages */ | ||
| 200 | #define POSIX_MADV_DONTNEED 4 /* [MC1] dont need these pages */ | ||
| 201 | |||
| 202 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 203 | #define MADV_NORMAL POSIX_MADV_NORMAL | ||
| 204 | #define MADV_RANDOM POSIX_MADV_RANDOM | ||
| 205 | #define MADV_SEQUENTIAL POSIX_MADV_SEQUENTIAL | ||
| 206 | #define MADV_WILLNEED POSIX_MADV_WILLNEED | ||
| 207 | #define MADV_DONTNEED POSIX_MADV_DONTNEED | ||
| 208 | #define MADV_FREE 5 /* pages unneeded, discard contents */ | ||
| 209 | #define MADV_ZERO_WIRED_PAGES 6 /* zero the wired pages that have not been unwired before the entry is deleted */ | ||
| 210 | #define MADV_FREE_REUSABLE 7 /* pages can be reused (by anyone) */ | ||
| 211 | #define MADV_FREE_REUSE 8 /* caller wants to reuse those pages */ | ||
| 212 | #define MADV_CAN_REUSE 9 | ||
| 213 | #define MADV_PAGEOUT 10 /* page out now (internal only) */ | ||
| 214 | |||
| 215 | /* | ||
| 216 | * Return bits from mincore | ||
| 217 | */ | ||
| 218 | #define MINCORE_INCORE 0x1 /* Page is incore */ | ||
| 219 | #define MINCORE_REFERENCED 0x2 /* Page has been referenced by us */ | ||
| 220 | #define MINCORE_MODIFIED 0x4 /* Page has been modified by us */ | ||
| 221 | #define MINCORE_REFERENCED_OTHER 0x8 /* Page has been referenced */ | ||
| 222 | #define MINCORE_MODIFIED_OTHER 0x10 /* Page has been modified */ | ||
| 223 | #define MINCORE_PAGED_OUT 0x20 /* Page has been paged out */ | ||
| 224 | #define MINCORE_COPIED 0x40 /* Page has been copied */ | ||
| 225 | #define MINCORE_ANONYMOUS 0x80 /* Page belongs to an anonymous object */ | ||
| 226 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | ||
| 227 | |||
| 228 | |||
| 229 | |||
| 230 | |||
| 231 | __BEGIN_DECLS | ||
| 232 | /* [ML] */ | ||
| 233 | int mlockall(int); | ||
| 234 | int munlockall(void); | ||
| 235 | /* [MR] */ | ||
| 236 | int mlock(const void *, size_t); | ||
| 237 | #ifndef _MMAP | ||
| 238 | #define _MMAP | ||
| 239 | /* [MC3]*/ | ||
| 240 | void * mmap(void *, size_t, int, int, int, off_t) __DARWIN_ALIAS(mmap); | ||
| 241 | #endif | ||
| 242 | /* [MPR] */ | ||
| 243 | int mprotect(void *, size_t, int) __DARWIN_ALIAS(mprotect); | ||
| 244 | /* [MF|SIO] */ | ||
| 245 | int msync(void *, size_t, int) __DARWIN_ALIAS_C(msync); | ||
| 246 | /* [MR] */ | ||
| 247 | int munlock(const void *, size_t); | ||
| 248 | /* [MC3]*/ | ||
| 249 | int munmap(void *, size_t) __DARWIN_ALIAS(munmap); | ||
| 250 | /* [SHM] */ | ||
| 251 | int shm_open(const char *, int, ...); | ||
| 252 | int shm_unlink(const char *); | ||
| 253 | /* [ADV] */ | ||
| 254 | int posix_madvise(void *, size_t, int); | ||
| 255 | |||
| 256 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | ||
| 257 | int madvise(void *, size_t, int); | ||
| 258 | int mincore(const void *, size_t, char *); | ||
| 259 | int minherit(void *, size_t, int); | ||
| 260 | #endif | ||
| 261 | |||
| 262 | |||
| 263 | __END_DECLS | ||
| 264 | |||
| 265 | #endif /* !_SYS_MMAN_H_ */ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.13-any/sys/mount.h+18-3| ... | @@ -404,12 +404,27 @@ struct fhandle { | ... | @@ -404,12 +404,27 @@ struct fhandle { |
| 404 | }; | 404 | }; |
| 405 | typedef struct fhandle fhandle_t; | 405 | typedef struct fhandle fhandle_t; |
| 406 | 406 | ||
| 407 | /* | ||
| 408 | * Cryptex authentication | ||
| 409 | * Note: these 2 enums are used in conjunction, graftdmg_type is used for authentication while grafting | ||
| 410 | * cryptexes and cryptex_auth_type is currently used for authentication while mounting generic | ||
| 411 | * cryptexes. We need to make sure we do not use the reserved values in each for a new authentication type. | ||
| 412 | */ | ||
| 413 | |||
| 407 | OS_ENUM(graftdmg_type, uint32_t, | 414 | OS_ENUM(graftdmg_type, uint32_t, |
| 408 | GRAFTDMG_CRYPTEX_BOOT = 1, | 415 | GRAFTDMG_CRYPTEX_BOOT = 1, |
| 409 | GRAFTDMG_CRYPTEX_PREBOOT = 2, | 416 | GRAFTDMG_CRYPTEX_PREBOOT = 2, |
| 410 | GRAFTDMG_CRYPTEX_DOWNLEVEL = 3); | 417 | GRAFTDMG_CRYPTEX_DOWNLEVEL = 3 |
| 411 | 418 | // Reserved: CRYPTEX1_AUTH_ENV_GENERIC = 4, | |
| 412 | 419 | // Reserved: CRYPTEX1_AUTH_ENV_GENERIC_SUPPLEMENTAL = 5 | |
| 420 | ); | ||
| 421 | |||
| 422 | OS_ENUM(cryptex_auth_type, uint32_t, | ||
| 423 | // Reserved: GRAFTDMG_CRYPTEX_BOOT = 1, | ||
| 424 | // Reserved: GRAFTDMG_CRYPTEX_PREBOOT = 2, | ||
| 425 | // Reserved: GRAFTDMG_CRYPTEX_DOWNLEVEL = 3, | ||
| 426 | CRYPTEX1_AUTH_ENV_GENERIC = 4, | ||
| 427 | CRYPTEX1_AUTH_ENV_GENERIC_SUPPLEMENTAL = 5); | ||
| 413 | 428 | ||
| 414 | 429 | ||
| 415 | __BEGIN_DECLS | 430 | __BEGIN_DECLS |
lib/libc/include/any-macos.13-any/tgmath.h created+1381| ... | @@ -0,0 +1,1381 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2009 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * The contents of this file constitute Original Code as defined in and | ||
| 7 | * are subject to the Apple Public Source License Version 1.1 (the | ||
| 8 | * "License"). You may not use this file except in compliance with the | ||
| 9 | * License. Please obtain a copy of the License at | ||
| 10 | * http://www.apple.com/publicsource and read it before using this file. | ||
| 11 | * | ||
| 12 | * This Original Code and all software distributed under the License are | ||
| 13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the | ||
| 17 | * License for the specific language governing rights and limitations | ||
| 18 | * under the License. | ||
| 19 | * | ||
| 20 | * @APPLE_LICENSE_HEADER_END@ | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef __TGMATH_H | ||
| 24 | #define __TGMATH_H | ||
| 25 | |||
| 26 | /* C99 7.22 Type-generic math <tgmath.h>. */ | ||
| 27 | #include <math.h> | ||
| 28 | |||
| 29 | /* C++ handles type genericity with overloading in math.h. */ | ||
| 30 | #ifndef __cplusplus | ||
| 31 | #include <complex.h> | ||
| 32 | |||
| 33 | #if __has_include(<realtime_safety/realtime_safety.h>) | ||
| 34 | #include <realtime_safety/realtime_safety.h> | ||
| 35 | REALTIME_SAFE_BEGIN | ||
| 36 | #endif | ||
| 37 | |||
| 38 | #define _TG_ATTRSp __attribute__((__overloadable__)) | ||
| 39 | #define _TG_ATTRS __attribute__((__overloadable__, __always_inline__)) | ||
| 40 | |||
| 41 | // promotion | ||
| 42 | |||
| 43 | typedef void _Argument_type_is_not_arithmetic; | ||
| 44 | static _Argument_type_is_not_arithmetic __tg_promote(...) | ||
| 45 | __attribute__((__unavailable__,__overloadable__)); | ||
| 46 | static double _TG_ATTRSp __tg_promote(int); | ||
| 47 | static double _TG_ATTRSp __tg_promote(unsigned int); | ||
| 48 | static double _TG_ATTRSp __tg_promote(long); | ||
| 49 | static double _TG_ATTRSp __tg_promote(unsigned long); | ||
| 50 | static double _TG_ATTRSp __tg_promote(long long); | ||
| 51 | static double _TG_ATTRSp __tg_promote(unsigned long long); | ||
| 52 | static float _TG_ATTRSp __tg_promote(float); | ||
| 53 | static double _TG_ATTRSp __tg_promote(double); | ||
| 54 | static long double _TG_ATTRSp __tg_promote(long double); | ||
| 55 | static float _Complex _TG_ATTRSp __tg_promote(float _Complex); | ||
| 56 | static double _Complex _TG_ATTRSp __tg_promote(double _Complex); | ||
| 57 | static long double _Complex _TG_ATTRSp __tg_promote(long double _Complex); | ||
| 58 | |||
| 59 | #define __tg_promote1(__x) (__typeof__(__tg_promote(__x))) | ||
| 60 | #define __tg_promote2(__x, __y) (__typeof__(__tg_promote(__x) + \ | ||
| 61 | __tg_promote(__y))) | ||
| 62 | #define __tg_promote3(__x, __y, __z) (__typeof__(__tg_promote(__x) + \ | ||
| 63 | __tg_promote(__y) + \ | ||
| 64 | __tg_promote(__z))) | ||
| 65 | |||
| 66 | // acos | ||
| 67 | |||
| 68 | static float | ||
| 69 | _TG_ATTRS | ||
| 70 | __tg_acos(float __x) {return acosf(__x);} | ||
| 71 | |||
| 72 | static double | ||
| 73 | _TG_ATTRS | ||
| 74 | __tg_acos(double __x) {return acos(__x);} | ||
| 75 | |||
| 76 | static long double | ||
| 77 | _TG_ATTRS | ||
| 78 | __tg_acos(long double __x) {return acosl(__x);} | ||
| 79 | |||
| 80 | static float _Complex | ||
| 81 | _TG_ATTRS | ||
| 82 | __tg_acos(float _Complex __x) {return cacosf(__x);} | ||
| 83 | |||
| 84 | static double _Complex | ||
| 85 | _TG_ATTRS | ||
| 86 | __tg_acos(double _Complex __x) {return cacos(__x);} | ||
| 87 | |||
| 88 | static long double _Complex | ||
| 89 | _TG_ATTRS | ||
| 90 | __tg_acos(long double _Complex __x) {return cacosl(__x);} | ||
| 91 | |||
| 92 | #undef acos | ||
| 93 | #define acos(__x) __tg_acos(__tg_promote1((__x))(__x)) | ||
| 94 | |||
| 95 | // asin | ||
| 96 | |||
| 97 | static float | ||
| 98 | _TG_ATTRS | ||
| 99 | __tg_asin(float __x) {return asinf(__x);} | ||
| 100 | |||
| 101 | static double | ||
| 102 | _TG_ATTRS | ||
| 103 | __tg_asin(double __x) {return asin(__x);} | ||
| 104 | |||
| 105 | static long double | ||
| 106 | _TG_ATTRS | ||
| 107 | __tg_asin(long double __x) {return asinl(__x);} | ||
| 108 | |||
| 109 | static float _Complex | ||
| 110 | _TG_ATTRS | ||
| 111 | __tg_asin(float _Complex __x) {return casinf(__x);} | ||
| 112 | |||
| 113 | static double _Complex | ||
| 114 | _TG_ATTRS | ||
| 115 | __tg_asin(double _Complex __x) {return casin(__x);} | ||
| 116 | |||
| 117 | static long double _Complex | ||
| 118 | _TG_ATTRS | ||
| 119 | __tg_asin(long double _Complex __x) {return casinl(__x);} | ||
| 120 | |||
| 121 | #undef asin | ||
| 122 | #define asin(__x) __tg_asin(__tg_promote1((__x))(__x)) | ||
| 123 | |||
| 124 | // atan | ||
| 125 | |||
| 126 | static float | ||
| 127 | _TG_ATTRS | ||
| 128 | __tg_atan(float __x) {return atanf(__x);} | ||
| 129 | |||
| 130 | static double | ||
| 131 | _TG_ATTRS | ||
| 132 | __tg_atan(double __x) {return atan(__x);} | ||
| 133 | |||
| 134 | static long double | ||
| 135 | _TG_ATTRS | ||
| 136 | __tg_atan(long double __x) {return atanl(__x);} | ||
| 137 | |||
| 138 | static float _Complex | ||
| 139 | _TG_ATTRS | ||
| 140 | __tg_atan(float _Complex __x) {return catanf(__x);} | ||
| 141 | |||
| 142 | static double _Complex | ||
| 143 | _TG_ATTRS | ||
| 144 | __tg_atan(double _Complex __x) {return catan(__x);} | ||
| 145 | |||
| 146 | static long double _Complex | ||
| 147 | _TG_ATTRS | ||
| 148 | __tg_atan(long double _Complex __x) {return catanl(__x);} | ||
| 149 | |||
| 150 | #undef atan | ||
| 151 | #define atan(__x) __tg_atan(__tg_promote1((__x))(__x)) | ||
| 152 | |||
| 153 | // acosh | ||
| 154 | |||
| 155 | static float | ||
| 156 | _TG_ATTRS | ||
| 157 | __tg_acosh(float __x) {return acoshf(__x);} | ||
| 158 | |||
| 159 | static double | ||
| 160 | _TG_ATTRS | ||
| 161 | __tg_acosh(double __x) {return acosh(__x);} | ||
| 162 | |||
| 163 | static long double | ||
| 164 | _TG_ATTRS | ||
| 165 | __tg_acosh(long double __x) {return acoshl(__x);} | ||
| 166 | |||
| 167 | static float _Complex | ||
| 168 | _TG_ATTRS | ||
| 169 | __tg_acosh(float _Complex __x) {return cacoshf(__x);} | ||
| 170 | |||
| 171 | static double _Complex | ||
| 172 | _TG_ATTRS | ||
| 173 | __tg_acosh(double _Complex __x) {return cacosh(__x);} | ||
| 174 | |||
| 175 | static long double _Complex | ||
| 176 | _TG_ATTRS | ||
| 177 | __tg_acosh(long double _Complex __x) {return cacoshl(__x);} | ||
| 178 | |||
| 179 | #undef acosh | ||
| 180 | #define acosh(__x) __tg_acosh(__tg_promote1((__x))(__x)) | ||
| 181 | |||
| 182 | // asinh | ||
| 183 | |||
| 184 | static float | ||
| 185 | _TG_ATTRS | ||
| 186 | __tg_asinh(float __x) {return asinhf(__x);} | ||
| 187 | |||
| 188 | static double | ||
| 189 | _TG_ATTRS | ||
| 190 | __tg_asinh(double __x) {return asinh(__x);} | ||
| 191 | |||
| 192 | static long double | ||
| 193 | _TG_ATTRS | ||
| 194 | __tg_asinh(long double __x) {return asinhl(__x);} | ||
| 195 | |||
| 196 | static float _Complex | ||
| 197 | _TG_ATTRS | ||
| 198 | __tg_asinh(float _Complex __x) {return casinhf(__x);} | ||
| 199 | |||
| 200 | static double _Complex | ||
| 201 | _TG_ATTRS | ||
| 202 | __tg_asinh(double _Complex __x) {return casinh(__x);} | ||
| 203 | |||
| 204 | static long double _Complex | ||
| 205 | _TG_ATTRS | ||
| 206 | __tg_asinh(long double _Complex __x) {return casinhl(__x);} | ||
| 207 | |||
| 208 | #undef asinh | ||
| 209 | #define asinh(__x) __tg_asinh(__tg_promote1((__x))(__x)) | ||
| 210 | |||
| 211 | // atanh | ||
| 212 | |||
| 213 | static float | ||
| 214 | _TG_ATTRS | ||
| 215 | __tg_atanh(float __x) {return atanhf(__x);} | ||
| 216 | |||
| 217 | static double | ||
| 218 | _TG_ATTRS | ||
| 219 | __tg_atanh(double __x) {return atanh(__x);} | ||
| 220 | |||
| 221 | static long double | ||
| 222 | _TG_ATTRS | ||
| 223 | __tg_atanh(long double __x) {return atanhl(__x);} | ||
| 224 | |||
| 225 | static float _Complex | ||
| 226 | _TG_ATTRS | ||
| 227 | __tg_atanh(float _Complex __x) {return catanhf(__x);} | ||
| 228 | |||
| 229 | static double _Complex | ||
| 230 | _TG_ATTRS | ||
| 231 | __tg_atanh(double _Complex __x) {return catanh(__x);} | ||
| 232 | |||
| 233 | static long double _Complex | ||
| 234 | _TG_ATTRS | ||
| 235 | __tg_atanh(long double _Complex __x) {return catanhl(__x);} | ||
| 236 | |||
| 237 | #undef atanh | ||
| 238 | #define atanh(__x) __tg_atanh(__tg_promote1((__x))(__x)) | ||
| 239 | |||
| 240 | // cos | ||
| 241 | |||
| 242 | static float | ||
| 243 | _TG_ATTRS | ||
| 244 | __tg_cos(float __x) {return cosf(__x);} | ||
| 245 | |||
| 246 | static double | ||
| 247 | _TG_ATTRS | ||
| 248 | __tg_cos(double __x) {return cos(__x);} | ||
| 249 | |||
| 250 | static long double | ||
| 251 | _TG_ATTRS | ||
| 252 | __tg_cos(long double __x) {return cosl(__x);} | ||
| 253 | |||
| 254 | static float _Complex | ||
| 255 | _TG_ATTRS | ||
| 256 | __tg_cos(float _Complex __x) {return ccosf(__x);} | ||
| 257 | |||
| 258 | static double _Complex | ||
| 259 | _TG_ATTRS | ||
| 260 | __tg_cos(double _Complex __x) {return ccos(__x);} | ||
| 261 | |||
| 262 | static long double _Complex | ||
| 263 | _TG_ATTRS | ||
| 264 | __tg_cos(long double _Complex __x) {return ccosl(__x);} | ||
| 265 | |||
| 266 | #undef cos | ||
| 267 | #define cos(__x) __tg_cos(__tg_promote1((__x))(__x)) | ||
| 268 | |||
| 269 | // sin | ||
| 270 | |||
| 271 | static float | ||
| 272 | _TG_ATTRS | ||
| 273 | __tg_sin(float __x) {return sinf(__x);} | ||
| 274 | |||
| 275 | static double | ||
| 276 | _TG_ATTRS | ||
| 277 | __tg_sin(double __x) {return sin(__x);} | ||
| 278 | |||
| 279 | static long double | ||
| 280 | _TG_ATTRS | ||
| 281 | __tg_sin(long double __x) {return sinl(__x);} | ||
| 282 | |||
| 283 | static float _Complex | ||
| 284 | _TG_ATTRS | ||
| 285 | __tg_sin(float _Complex __x) {return csinf(__x);} | ||
| 286 | |||
| 287 | static double _Complex | ||
| 288 | _TG_ATTRS | ||
| 289 | __tg_sin(double _Complex __x) {return csin(__x);} | ||
| 290 | |||
| 291 | static long double _Complex | ||
| 292 | _TG_ATTRS | ||
| 293 | __tg_sin(long double _Complex __x) {return csinl(__x);} | ||
| 294 | |||
| 295 | #undef sin | ||
| 296 | #define sin(__x) __tg_sin(__tg_promote1((__x))(__x)) | ||
| 297 | |||
| 298 | // tan | ||
| 299 | |||
| 300 | static float | ||
| 301 | _TG_ATTRS | ||
| 302 | __tg_tan(float __x) {return tanf(__x);} | ||
| 303 | |||
| 304 | static double | ||
| 305 | _TG_ATTRS | ||
| 306 | __tg_tan(double __x) {return tan(__x);} | ||
| 307 | |||
| 308 | static long double | ||
| 309 | _TG_ATTRS | ||
| 310 | __tg_tan(long double __x) {return tanl(__x);} | ||
| 311 | |||
| 312 | static float _Complex | ||
| 313 | _TG_ATTRS | ||
| 314 | __tg_tan(float _Complex __x) {return ctanf(__x);} | ||
| 315 | |||
| 316 | static double _Complex | ||
| 317 | _TG_ATTRS | ||
| 318 | __tg_tan(double _Complex __x) {return ctan(__x);} | ||
| 319 | |||
| 320 | static long double _Complex | ||
| 321 | _TG_ATTRS | ||
| 322 | __tg_tan(long double _Complex __x) {return ctanl(__x);} | ||
| 323 | |||
| 324 | #undef tan | ||
| 325 | #define tan(__x) __tg_tan(__tg_promote1((__x))(__x)) | ||
| 326 | |||
| 327 | // cosh | ||
| 328 | |||
| 329 | static float | ||
| 330 | _TG_ATTRS | ||
| 331 | __tg_cosh(float __x) {return coshf(__x);} | ||
| 332 | |||
| 333 | static double | ||
| 334 | _TG_ATTRS | ||
| 335 | __tg_cosh(double __x) {return cosh(__x);} | ||
| 336 | |||
| 337 | static long double | ||
| 338 | _TG_ATTRS | ||
| 339 | __tg_cosh(long double __x) {return coshl(__x);} | ||
| 340 | |||
| 341 | static float _Complex | ||
| 342 | _TG_ATTRS | ||
| 343 | __tg_cosh(float _Complex __x) {return ccoshf(__x);} | ||
| 344 | |||
| 345 | static double _Complex | ||
| 346 | _TG_ATTRS | ||
| 347 | __tg_cosh(double _Complex __x) {return ccosh(__x);} | ||
| 348 | |||
| 349 | static long double _Complex | ||
| 350 | _TG_ATTRS | ||
| 351 | __tg_cosh(long double _Complex __x) {return ccoshl(__x);} | ||
| 352 | |||
| 353 | #undef cosh | ||
| 354 | #define cosh(__x) __tg_cosh(__tg_promote1((__x))(__x)) | ||
| 355 | |||
| 356 | // sinh | ||
| 357 | |||
| 358 | static float | ||
| 359 | _TG_ATTRS | ||
| 360 | __tg_sinh(float __x) {return sinhf(__x);} | ||
| 361 | |||
| 362 | static double | ||
| 363 | _TG_ATTRS | ||
| 364 | __tg_sinh(double __x) {return sinh(__x);} | ||
| 365 | |||
| 366 | static long double | ||
| 367 | _TG_ATTRS | ||
| 368 | __tg_sinh(long double __x) {return sinhl(__x);} | ||
| 369 | |||
| 370 | static float _Complex | ||
| 371 | _TG_ATTRS | ||
| 372 | __tg_sinh(float _Complex __x) {return csinhf(__x);} | ||
| 373 | |||
| 374 | static double _Complex | ||
| 375 | _TG_ATTRS | ||
| 376 | __tg_sinh(double _Complex __x) {return csinh(__x);} | ||
| 377 | |||
| 378 | static long double _Complex | ||
| 379 | _TG_ATTRS | ||
| 380 | __tg_sinh(long double _Complex __x) {return csinhl(__x);} | ||
| 381 | |||
| 382 | #undef sinh | ||
| 383 | #define sinh(__x) __tg_sinh(__tg_promote1((__x))(__x)) | ||
| 384 | |||
| 385 | // tanh | ||
| 386 | |||
| 387 | static float | ||
| 388 | _TG_ATTRS | ||
| 389 | __tg_tanh(float __x) {return tanhf(__x);} | ||
| 390 | |||
| 391 | static double | ||
| 392 | _TG_ATTRS | ||
| 393 | __tg_tanh(double __x) {return tanh(__x);} | ||
| 394 | |||
| 395 | static long double | ||
| 396 | _TG_ATTRS | ||
| 397 | __tg_tanh(long double __x) {return tanhl(__x);} | ||
| 398 | |||
| 399 | static float _Complex | ||
| 400 | _TG_ATTRS | ||
| 401 | __tg_tanh(float _Complex __x) {return ctanhf(__x);} | ||
| 402 | |||
| 403 | static double _Complex | ||
| 404 | _TG_ATTRS | ||
| 405 | __tg_tanh(double _Complex __x) {return ctanh(__x);} | ||
| 406 | |||
| 407 | static long double _Complex | ||
| 408 | _TG_ATTRS | ||
| 409 | __tg_tanh(long double _Complex __x) {return ctanhl(__x);} | ||
| 410 | |||
| 411 | #undef tanh | ||
| 412 | #define tanh(__x) __tg_tanh(__tg_promote1((__x))(__x)) | ||
| 413 | |||
| 414 | // exp | ||
| 415 | |||
| 416 | static float | ||
| 417 | _TG_ATTRS | ||
| 418 | __tg_exp(float __x) {return expf(__x);} | ||
| 419 | |||
| 420 | static double | ||
| 421 | _TG_ATTRS | ||
| 422 | __tg_exp(double __x) {return exp(__x);} | ||
| 423 | |||
| 424 | static long double | ||
| 425 | _TG_ATTRS | ||
| 426 | __tg_exp(long double __x) {return expl(__x);} | ||
| 427 | |||
| 428 | static float _Complex | ||
| 429 | _TG_ATTRS | ||
| 430 | __tg_exp(float _Complex __x) {return cexpf(__x);} | ||
| 431 | |||
| 432 | static double _Complex | ||
| 433 | _TG_ATTRS | ||
| 434 | __tg_exp(double _Complex __x) {return cexp(__x);} | ||
| 435 | |||
| 436 | static long double _Complex | ||
| 437 | _TG_ATTRS | ||
| 438 | __tg_exp(long double _Complex __x) {return cexpl(__x);} | ||
| 439 | |||
| 440 | #undef exp | ||
| 441 | #define exp(__x) __tg_exp(__tg_promote1((__x))(__x)) | ||
| 442 | |||
| 443 | // log | ||
| 444 | |||
| 445 | static float | ||
| 446 | _TG_ATTRS | ||
| 447 | __tg_log(float __x) {return logf(__x);} | ||
| 448 | |||
| 449 | static double | ||
| 450 | _TG_ATTRS | ||
| 451 | __tg_log(double __x) {return log(__x);} | ||
| 452 | |||
| 453 | static long double | ||
| 454 | _TG_ATTRS | ||
| 455 | __tg_log(long double __x) {return logl(__x);} | ||
| 456 | |||
| 457 | static float _Complex | ||
| 458 | _TG_ATTRS | ||
| 459 | __tg_log(float _Complex __x) {return clogf(__x);} | ||
| 460 | |||
| 461 | static double _Complex | ||
| 462 | _TG_ATTRS | ||
| 463 | __tg_log(double _Complex __x) {return clog(__x);} | ||
| 464 | |||
| 465 | static long double _Complex | ||
| 466 | _TG_ATTRS | ||
| 467 | __tg_log(long double _Complex __x) {return clogl(__x);} | ||
| 468 | |||
| 469 | #undef log | ||
| 470 | #define log(__x) __tg_log(__tg_promote1((__x))(__x)) | ||
| 471 | |||
| 472 | // pow | ||
| 473 | |||
| 474 | static float | ||
| 475 | _TG_ATTRS | ||
| 476 | __tg_pow(float __x, float __y) {return powf(__x, __y);} | ||
| 477 | |||
| 478 | static double | ||
| 479 | _TG_ATTRS | ||
| 480 | __tg_pow(double __x, double __y) {return pow(__x, __y);} | ||
| 481 | |||
| 482 | static long double | ||
| 483 | _TG_ATTRS | ||
| 484 | __tg_pow(long double __x, long double __y) {return powl(__x, __y);} | ||
| 485 | |||
| 486 | static float _Complex | ||
| 487 | _TG_ATTRS | ||
| 488 | __tg_pow(float _Complex __x, float _Complex __y) {return cpowf(__x, __y);} | ||
| 489 | |||
| 490 | static double _Complex | ||
| 491 | _TG_ATTRS | ||
| 492 | __tg_pow(double _Complex __x, double _Complex __y) {return cpow(__x, __y);} | ||
| 493 | |||
| 494 | static long double _Complex | ||
| 495 | _TG_ATTRS | ||
| 496 | __tg_pow(long double _Complex __x, long double _Complex __y) | ||
| 497 | {return cpowl(__x, __y);} | ||
| 498 | |||
| 499 | #undef pow | ||
| 500 | #define pow(__x, __y) __tg_pow(__tg_promote2((__x), (__y))(__x), \ | ||
| 501 | __tg_promote2((__x), (__y))(__y)) | ||
| 502 | |||
| 503 | // sqrt | ||
| 504 | |||
| 505 | static float | ||
| 506 | _TG_ATTRS | ||
| 507 | __tg_sqrt(float __x) {return sqrtf(__x);} | ||
| 508 | |||
| 509 | static double | ||
| 510 | _TG_ATTRS | ||
| 511 | __tg_sqrt(double __x) {return sqrt(__x);} | ||
| 512 | |||
| 513 | static long double | ||
| 514 | _TG_ATTRS | ||
| 515 | __tg_sqrt(long double __x) {return sqrtl(__x);} | ||
| 516 | |||
| 517 | static float _Complex | ||
| 518 | _TG_ATTRS | ||
| 519 | __tg_sqrt(float _Complex __x) {return csqrtf(__x);} | ||
| 520 | |||
| 521 | static double _Complex | ||
| 522 | _TG_ATTRS | ||
| 523 | __tg_sqrt(double _Complex __x) {return csqrt(__x);} | ||
| 524 | |||
| 525 | static long double _Complex | ||
| 526 | _TG_ATTRS | ||
| 527 | __tg_sqrt(long double _Complex __x) {return csqrtl(__x);} | ||
| 528 | |||
| 529 | #undef sqrt | ||
| 530 | #define sqrt(__x) __tg_sqrt(__tg_promote1((__x))(__x)) | ||
| 531 | |||
| 532 | // fabs | ||
| 533 | |||
| 534 | static float | ||
| 535 | _TG_ATTRS | ||
| 536 | __tg_fabs(float __x) {return fabsf(__x);} | ||
| 537 | |||
| 538 | static double | ||
| 539 | _TG_ATTRS | ||
| 540 | __tg_fabs(double __x) {return fabs(__x);} | ||
| 541 | |||
| 542 | static long double | ||
| 543 | _TG_ATTRS | ||
| 544 | __tg_fabs(long double __x) {return fabsl(__x);} | ||
| 545 | |||
| 546 | static float | ||
| 547 | _TG_ATTRS | ||
| 548 | __tg_fabs(float _Complex __x) {return cabsf(__x);} | ||
| 549 | |||
| 550 | static double | ||
| 551 | _TG_ATTRS | ||
| 552 | __tg_fabs(double _Complex __x) {return cabs(__x);} | ||
| 553 | |||
| 554 | static long double | ||
| 555 | _TG_ATTRS | ||
| 556 | __tg_fabs(long double _Complex __x) {return cabsl(__x);} | ||
| 557 | |||
| 558 | #undef fabs | ||
| 559 | #define fabs(__x) __tg_fabs(__tg_promote1((__x))(__x)) | ||
| 560 | |||
| 561 | // atan2 | ||
| 562 | |||
| 563 | static float | ||
| 564 | _TG_ATTRS | ||
| 565 | __tg_atan2(float __x, float __y) {return atan2f(__x, __y);} | ||
| 566 | |||
| 567 | static double | ||
| 568 | _TG_ATTRS | ||
| 569 | __tg_atan2(double __x, double __y) {return atan2(__x, __y);} | ||
| 570 | |||
| 571 | static long double | ||
| 572 | _TG_ATTRS | ||
| 573 | __tg_atan2(long double __x, long double __y) {return atan2l(__x, __y);} | ||
| 574 | |||
| 575 | #undef atan2 | ||
| 576 | #define atan2(__x, __y) __tg_atan2(__tg_promote2((__x), (__y))(__x), \ | ||
| 577 | __tg_promote2((__x), (__y))(__y)) | ||
| 578 | |||
| 579 | // cbrt | ||
| 580 | |||
| 581 | static float | ||
| 582 | _TG_ATTRS | ||
| 583 | __tg_cbrt(float __x) {return cbrtf(__x);} | ||
| 584 | |||
| 585 | static double | ||
| 586 | _TG_ATTRS | ||
| 587 | __tg_cbrt(double __x) {return cbrt(__x);} | ||
| 588 | |||
| 589 | static long double | ||
| 590 | _TG_ATTRS | ||
| 591 | __tg_cbrt(long double __x) {return cbrtl(__x);} | ||
| 592 | |||
| 593 | #undef cbrt | ||
| 594 | #define cbrt(__x) __tg_cbrt(__tg_promote1((__x))(__x)) | ||
| 595 | |||
| 596 | // ceil | ||
| 597 | |||
| 598 | static float | ||
| 599 | _TG_ATTRS | ||
| 600 | __tg_ceil(float __x) {return ceilf(__x);} | ||
| 601 | |||
| 602 | static double | ||
| 603 | _TG_ATTRS | ||
| 604 | __tg_ceil(double __x) {return ceil(__x);} | ||
| 605 | |||
| 606 | static long double | ||
| 607 | _TG_ATTRS | ||
| 608 | __tg_ceil(long double __x) {return ceill(__x);} | ||
| 609 | |||
| 610 | #undef ceil | ||
| 611 | #define ceil(__x) __tg_ceil(__tg_promote1((__x))(__x)) | ||
| 612 | |||
| 613 | // copysign | ||
| 614 | |||
| 615 | static float | ||
| 616 | _TG_ATTRS | ||
| 617 | __tg_copysign(float __x, float __y) {return copysignf(__x, __y);} | ||
| 618 | |||
| 619 | static double | ||
| 620 | _TG_ATTRS | ||
| 621 | __tg_copysign(double __x, double __y) {return copysign(__x, __y);} | ||
| 622 | |||
| 623 | static long double | ||
| 624 | _TG_ATTRS | ||
| 625 | __tg_copysign(long double __x, long double __y) {return copysignl(__x, __y);} | ||
| 626 | |||
| 627 | #undef copysign | ||
| 628 | #define copysign(__x, __y) __tg_copysign(__tg_promote2((__x), (__y))(__x), \ | ||
| 629 | __tg_promote2((__x), (__y))(__y)) | ||
| 630 | |||
| 631 | // erf | ||
| 632 | |||
| 633 | static float | ||
| 634 | _TG_ATTRS | ||
| 635 | __tg_erf(float __x) {return erff(__x);} | ||
| 636 | |||
| 637 | static double | ||
| 638 | _TG_ATTRS | ||
| 639 | __tg_erf(double __x) {return erf(__x);} | ||
| 640 | |||
| 641 | static long double | ||
| 642 | _TG_ATTRS | ||
| 643 | __tg_erf(long double __x) {return erfl(__x);} | ||
| 644 | |||
| 645 | #undef erf | ||
| 646 | #define erf(__x) __tg_erf(__tg_promote1((__x))(__x)) | ||
| 647 | |||
| 648 | // erfc | ||
| 649 | |||
| 650 | static float | ||
| 651 | _TG_ATTRS | ||
| 652 | __tg_erfc(float __x) {return erfcf(__x);} | ||
| 653 | |||
| 654 | static double | ||
| 655 | _TG_ATTRS | ||
| 656 | __tg_erfc(double __x) {return erfc(__x);} | ||
| 657 | |||
| 658 | static long double | ||
| 659 | _TG_ATTRS | ||
| 660 | __tg_erfc(long double __x) {return erfcl(__x);} | ||
| 661 | |||
| 662 | #undef erfc | ||
| 663 | #define erfc(__x) __tg_erfc(__tg_promote1((__x))(__x)) | ||
| 664 | |||
| 665 | // exp2 | ||
| 666 | |||
| 667 | static float | ||
| 668 | _TG_ATTRS | ||
| 669 | __tg_exp2(float __x) {return exp2f(__x);} | ||
| 670 | |||
| 671 | static double | ||
| 672 | _TG_ATTRS | ||
| 673 | __tg_exp2(double __x) {return exp2(__x);} | ||
| 674 | |||
| 675 | static long double | ||
| 676 | _TG_ATTRS | ||
| 677 | __tg_exp2(long double __x) {return exp2l(__x);} | ||
| 678 | |||
| 679 | #undef exp2 | ||
| 680 | #define exp2(__x) __tg_exp2(__tg_promote1((__x))(__x)) | ||
| 681 | |||
| 682 | // expm1 | ||
| 683 | |||
| 684 | static float | ||
| 685 | _TG_ATTRS | ||
| 686 | __tg_expm1(float __x) {return expm1f(__x);} | ||
| 687 | |||
| 688 | static double | ||
| 689 | _TG_ATTRS | ||
| 690 | __tg_expm1(double __x) {return expm1(__x);} | ||
| 691 | |||
| 692 | static long double | ||
| 693 | _TG_ATTRS | ||
| 694 | __tg_expm1(long double __x) {return expm1l(__x);} | ||
| 695 | |||
| 696 | #undef expm1 | ||
| 697 | #define expm1(__x) __tg_expm1(__tg_promote1((__x))(__x)) | ||
| 698 | |||
| 699 | // fdim | ||
| 700 | |||
| 701 | static float | ||
| 702 | _TG_ATTRS | ||
| 703 | __tg_fdim(float __x, float __y) {return fdimf(__x, __y);} | ||
| 704 | |||
| 705 | static double | ||
| 706 | _TG_ATTRS | ||
| 707 | __tg_fdim(double __x, double __y) {return fdim(__x, __y);} | ||
| 708 | |||
| 709 | static long double | ||
| 710 | _TG_ATTRS | ||
| 711 | __tg_fdim(long double __x, long double __y) {return fdiml(__x, __y);} | ||
| 712 | |||
| 713 | #undef fdim | ||
| 714 | #define fdim(__x, __y) __tg_fdim(__tg_promote2((__x), (__y))(__x), \ | ||
| 715 | __tg_promote2((__x), (__y))(__y)) | ||
| 716 | |||
| 717 | // floor | ||
| 718 | |||
| 719 | static float | ||
| 720 | _TG_ATTRS | ||
| 721 | __tg_floor(float __x) {return floorf(__x);} | ||
| 722 | |||
| 723 | static double | ||
| 724 | _TG_ATTRS | ||
| 725 | __tg_floor(double __x) {return floor(__x);} | ||
| 726 | |||
| 727 | static long double | ||
| 728 | _TG_ATTRS | ||
| 729 | __tg_floor(long double __x) {return floorl(__x);} | ||
| 730 | |||
| 731 | #undef floor | ||
| 732 | #define floor(__x) __tg_floor(__tg_promote1((__x))(__x)) | ||
| 733 | |||
| 734 | // fma | ||
| 735 | |||
| 736 | static float | ||
| 737 | _TG_ATTRS | ||
| 738 | __tg_fma(float __x, float __y, float __z) | ||
| 739 | {return fmaf(__x, __y, __z);} | ||
| 740 | |||
| 741 | static double | ||
| 742 | _TG_ATTRS | ||
| 743 | __tg_fma(double __x, double __y, double __z) | ||
| 744 | {return fma(__x, __y, __z);} | ||
| 745 | |||
| 746 | static long double | ||
| 747 | _TG_ATTRS | ||
| 748 | __tg_fma(long double __x,long double __y, long double __z) | ||
| 749 | {return fmal(__x, __y, __z);} | ||
| 750 | |||
| 751 | #undef fma | ||
| 752 | #define fma(__x, __y, __z) \ | ||
| 753 | __tg_fma(__tg_promote3((__x), (__y), (__z))(__x), \ | ||
| 754 | __tg_promote3((__x), (__y), (__z))(__y), \ | ||
| 755 | __tg_promote3((__x), (__y), (__z))(__z)) | ||
| 756 | |||
| 757 | // fmax | ||
| 758 | |||
| 759 | static float | ||
| 760 | _TG_ATTRS | ||
| 761 | __tg_fmax(float __x, float __y) {return fmaxf(__x, __y);} | ||
| 762 | |||
| 763 | static double | ||
| 764 | _TG_ATTRS | ||
| 765 | __tg_fmax(double __x, double __y) {return fmax(__x, __y);} | ||
| 766 | |||
| 767 | static long double | ||
| 768 | _TG_ATTRS | ||
| 769 | __tg_fmax(long double __x, long double __y) {return fmaxl(__x, __y);} | ||
| 770 | |||
| 771 | #undef fmax | ||
| 772 | #define fmax(__x, __y) __tg_fmax(__tg_promote2((__x), (__y))(__x), \ | ||
| 773 | __tg_promote2((__x), (__y))(__y)) | ||
| 774 | |||
| 775 | // fmin | ||
| 776 | |||
| 777 | static float | ||
| 778 | _TG_ATTRS | ||
| 779 | __tg_fmin(float __x, float __y) {return fminf(__x, __y);} | ||
| 780 | |||
| 781 | static double | ||
| 782 | _TG_ATTRS | ||
| 783 | __tg_fmin(double __x, double __y) {return fmin(__x, __y);} | ||
| 784 | |||
| 785 | static long double | ||
| 786 | _TG_ATTRS | ||
| 787 | __tg_fmin(long double __x, long double __y) {return fminl(__x, __y);} | ||
| 788 | |||
| 789 | #undef fmin | ||
| 790 | #define fmin(__x, __y) __tg_fmin(__tg_promote2((__x), (__y))(__x), \ | ||
| 791 | __tg_promote2((__x), (__y))(__y)) | ||
| 792 | |||
| 793 | // fmod | ||
| 794 | |||
| 795 | static float | ||
| 796 | _TG_ATTRS | ||
| 797 | __tg_fmod(float __x, float __y) {return fmodf(__x, __y);} | ||
| 798 | |||
| 799 | static double | ||
| 800 | _TG_ATTRS | ||
| 801 | __tg_fmod(double __x, double __y) {return fmod(__x, __y);} | ||
| 802 | |||
| 803 | static long double | ||
| 804 | _TG_ATTRS | ||
| 805 | __tg_fmod(long double __x, long double __y) {return fmodl(__x, __y);} | ||
| 806 | |||
| 807 | #undef fmod | ||
| 808 | #define fmod(__x, __y) __tg_fmod(__tg_promote2((__x), (__y))(__x), \ | ||
| 809 | __tg_promote2((__x), (__y))(__y)) | ||
| 810 | |||
| 811 | // frexp | ||
| 812 | |||
| 813 | static float | ||
| 814 | _TG_ATTRS | ||
| 815 | __tg_frexp(float __x, int* __y) {return frexpf(__x, __y);} | ||
| 816 | |||
| 817 | static double | ||
| 818 | _TG_ATTRS | ||
| 819 | __tg_frexp(double __x, int* __y) {return frexp(__x, __y);} | ||
| 820 | |||
| 821 | static long double | ||
| 822 | _TG_ATTRS | ||
| 823 | __tg_frexp(long double __x, int* __y) {return frexpl(__x, __y);} | ||
| 824 | |||
| 825 | #undef frexp | ||
| 826 | #define frexp(__x, __y) __tg_frexp(__tg_promote1((__x))(__x), __y) | ||
| 827 | |||
| 828 | // hypot | ||
| 829 | |||
| 830 | static float | ||
| 831 | _TG_ATTRS | ||
| 832 | __tg_hypot(float __x, float __y) {return hypotf(__x, __y);} | ||
| 833 | |||
| 834 | static double | ||
| 835 | _TG_ATTRS | ||
| 836 | __tg_hypot(double __x, double __y) {return hypot(__x, __y);} | ||
| 837 | |||
| 838 | static long double | ||
| 839 | _TG_ATTRS | ||
| 840 | __tg_hypot(long double __x, long double __y) {return hypotl(__x, __y);} | ||
| 841 | |||
| 842 | #undef hypot | ||
| 843 | #define hypot(__x, __y) __tg_hypot(__tg_promote2((__x), (__y))(__x), \ | ||
| 844 | __tg_promote2((__x), (__y))(__y)) | ||
| 845 | |||
| 846 | // ilogb | ||
| 847 | |||
| 848 | static int | ||
| 849 | _TG_ATTRS | ||
| 850 | __tg_ilogb(float __x) {return ilogbf(__x);} | ||
| 851 | |||
| 852 | static int | ||
| 853 | _TG_ATTRS | ||
| 854 | __tg_ilogb(double __x) {return ilogb(__x);} | ||
| 855 | |||
| 856 | static int | ||
| 857 | _TG_ATTRS | ||
| 858 | __tg_ilogb(long double __x) {return ilogbl(__x);} | ||
| 859 | |||
| 860 | #undef ilogb | ||
| 861 | #define ilogb(__x) __tg_ilogb(__tg_promote1((__x))(__x)) | ||
| 862 | |||
| 863 | // ldexp | ||
| 864 | |||
| 865 | static float | ||
| 866 | _TG_ATTRS | ||
| 867 | __tg_ldexp(float __x, int __y) {return ldexpf(__x, __y);} | ||
| 868 | |||
| 869 | static double | ||
| 870 | _TG_ATTRS | ||
| 871 | __tg_ldexp(double __x, int __y) {return ldexp(__x, __y);} | ||
| 872 | |||
| 873 | static long double | ||
| 874 | _TG_ATTRS | ||
| 875 | __tg_ldexp(long double __x, int __y) {return ldexpl(__x, __y);} | ||
| 876 | |||
| 877 | #undef ldexp | ||
| 878 | #define ldexp(__x, __y) __tg_ldexp(__tg_promote1((__x))(__x), __y) | ||
| 879 | |||
| 880 | // lgamma | ||
| 881 | |||
| 882 | static float | ||
| 883 | _TG_ATTRS | ||
| 884 | __tg_lgamma(float __x) {return lgammaf(__x);} | ||
| 885 | |||
| 886 | static double | ||
| 887 | _TG_ATTRS | ||
| 888 | __tg_lgamma(double __x) {return lgamma(__x);} | ||
| 889 | |||
| 890 | static long double | ||
| 891 | _TG_ATTRS | ||
| 892 | __tg_lgamma(long double __x) {return lgammal(__x);} | ||
| 893 | |||
| 894 | #undef lgamma | ||
| 895 | #define lgamma(__x) __tg_lgamma(__tg_promote1((__x))(__x)) | ||
| 896 | |||
| 897 | // llrint | ||
| 898 | |||
| 899 | static long long | ||
| 900 | _TG_ATTRS | ||
| 901 | __tg_llrint(float __x) {return llrintf(__x);} | ||
| 902 | |||
| 903 | static long long | ||
| 904 | _TG_ATTRS | ||
| 905 | __tg_llrint(double __x) {return llrint(__x);} | ||
| 906 | |||
| 907 | static long long | ||
| 908 | _TG_ATTRS | ||
| 909 | __tg_llrint(long double __x) {return llrintl(__x);} | ||
| 910 | |||
| 911 | #undef llrint | ||
| 912 | #define llrint(__x) __tg_llrint(__tg_promote1((__x))(__x)) | ||
| 913 | |||
| 914 | // llround | ||
| 915 | |||
| 916 | static long long | ||
| 917 | _TG_ATTRS | ||
| 918 | __tg_llround(float __x) {return llroundf(__x);} | ||
| 919 | |||
| 920 | static long long | ||
| 921 | _TG_ATTRS | ||
| 922 | __tg_llround(double __x) {return llround(__x);} | ||
| 923 | |||
| 924 | static long long | ||
| 925 | _TG_ATTRS | ||
| 926 | __tg_llround(long double __x) {return llroundl(__x);} | ||
| 927 | |||
| 928 | #undef llround | ||
| 929 | #define llround(__x) __tg_llround(__tg_promote1((__x))(__x)) | ||
| 930 | |||
| 931 | // log10 | ||
| 932 | |||
| 933 | static float | ||
| 934 | _TG_ATTRS | ||
| 935 | __tg_log10(float __x) {return log10f(__x);} | ||
| 936 | |||
| 937 | static double | ||
| 938 | _TG_ATTRS | ||
| 939 | __tg_log10(double __x) {return log10(__x);} | ||
| 940 | |||
| 941 | static long double | ||
| 942 | _TG_ATTRS | ||
| 943 | __tg_log10(long double __x) {return log10l(__x);} | ||
| 944 | |||
| 945 | #undef log10 | ||
| 946 | #define log10(__x) __tg_log10(__tg_promote1((__x))(__x)) | ||
| 947 | |||
| 948 | // log1p | ||
| 949 | |||
| 950 | static float | ||
| 951 | _TG_ATTRS | ||
| 952 | __tg_log1p(float __x) {return log1pf(__x);} | ||
| 953 | |||
| 954 | static double | ||
| 955 | _TG_ATTRS | ||
| 956 | __tg_log1p(double __x) {return log1p(__x);} | ||
| 957 | |||
| 958 | static long double | ||
| 959 | _TG_ATTRS | ||
| 960 | __tg_log1p(long double __x) {return log1pl(__x);} | ||
| 961 | |||
| 962 | #undef log1p | ||
| 963 | #define log1p(__x) __tg_log1p(__tg_promote1((__x))(__x)) | ||
| 964 | |||
| 965 | // log2 | ||
| 966 | |||
| 967 | static float | ||
| 968 | _TG_ATTRS | ||
| 969 | __tg_log2(float __x) {return log2f(__x);} | ||
| 970 | |||
| 971 | static double | ||
| 972 | _TG_ATTRS | ||
| 973 | __tg_log2(double __x) {return log2(__x);} | ||
| 974 | |||
| 975 | static long double | ||
| 976 | _TG_ATTRS | ||
| 977 | __tg_log2(long double __x) {return log2l(__x);} | ||
| 978 | |||
| 979 | #undef log2 | ||
| 980 | #define log2(__x) __tg_log2(__tg_promote1((__x))(__x)) | ||
| 981 | |||
| 982 | // logb | ||
| 983 | |||
| 984 | static float | ||
| 985 | _TG_ATTRS | ||
| 986 | __tg_logb(float __x) {return logbf(__x);} | ||
| 987 | |||
| 988 | static double | ||
| 989 | _TG_ATTRS | ||
| 990 | __tg_logb(double __x) {return logb(__x);} | ||
| 991 | |||
| 992 | static long double | ||
| 993 | _TG_ATTRS | ||
| 994 | __tg_logb(long double __x) {return logbl(__x);} | ||
| 995 | |||
| 996 | #undef logb | ||
| 997 | #define logb(__x) __tg_logb(__tg_promote1((__x))(__x)) | ||
| 998 | |||
| 999 | // lrint | ||
| 1000 | |||
| 1001 | static long | ||
| 1002 | _TG_ATTRS | ||
| 1003 | __tg_lrint(float __x) {return lrintf(__x);} | ||
| 1004 | |||
| 1005 | static long | ||
| 1006 | _TG_ATTRS | ||
| 1007 | __tg_lrint(double __x) {return lrint(__x);} | ||
| 1008 | |||
| 1009 | static long | ||
| 1010 | _TG_ATTRS | ||
| 1011 | __tg_lrint(long double __x) {return lrintl(__x);} | ||
| 1012 | |||
| 1013 | #undef lrint | ||
| 1014 | #define lrint(__x) __tg_lrint(__tg_promote1((__x))(__x)) | ||
| 1015 | |||
| 1016 | // lround | ||
| 1017 | |||
| 1018 | static long | ||
| 1019 | _TG_ATTRS | ||
| 1020 | __tg_lround(float __x) {return lroundf(__x);} | ||
| 1021 | |||
| 1022 | static long | ||
| 1023 | _TG_ATTRS | ||
| 1024 | __tg_lround(double __x) {return lround(__x);} | ||
| 1025 | |||
| 1026 | static long | ||
| 1027 | _TG_ATTRS | ||
| 1028 | __tg_lround(long double __x) {return lroundl(__x);} | ||
| 1029 | |||
| 1030 | #undef lround | ||
| 1031 | #define lround(__x) __tg_lround(__tg_promote1((__x))(__x)) | ||
| 1032 | |||
| 1033 | // nearbyint | ||
| 1034 | |||
| 1035 | static float | ||
| 1036 | _TG_ATTRS | ||
| 1037 | __tg_nearbyint(float __x) {return nearbyintf(__x);} | ||
| 1038 | |||
| 1039 | static double | ||
| 1040 | _TG_ATTRS | ||
| 1041 | __tg_nearbyint(double __x) {return nearbyint(__x);} | ||
| 1042 | |||
| 1043 | static long double | ||
| 1044 | _TG_ATTRS | ||
| 1045 | __tg_nearbyint(long double __x) {return nearbyintl(__x);} | ||
| 1046 | |||
| 1047 | #undef nearbyint | ||
| 1048 | #define nearbyint(__x) __tg_nearbyint(__tg_promote1((__x))(__x)) | ||
| 1049 | |||
| 1050 | // nextafter | ||
| 1051 | |||
| 1052 | static float | ||
| 1053 | _TG_ATTRS | ||
| 1054 | __tg_nextafter(float __x, float __y) {return nextafterf(__x, __y);} | ||
| 1055 | |||
| 1056 | static double | ||
| 1057 | _TG_ATTRS | ||
| 1058 | __tg_nextafter(double __x, double __y) {return nextafter(__x, __y);} | ||
| 1059 | |||
| 1060 | static long double | ||
| 1061 | _TG_ATTRS | ||
| 1062 | __tg_nextafter(long double __x, long double __y) {return nextafterl(__x, __y);} | ||
| 1063 | |||
| 1064 | #undef nextafter | ||
| 1065 | #define nextafter(__x, __y) __tg_nextafter(__tg_promote2((__x), (__y))(__x), \ | ||
| 1066 | __tg_promote2((__x), (__y))(__y)) | ||
| 1067 | |||
| 1068 | // nexttoward | ||
| 1069 | |||
| 1070 | static float | ||
| 1071 | _TG_ATTRS | ||
| 1072 | __tg_nexttoward(float __x, long double __y) {return nexttowardf(__x, __y);} | ||
| 1073 | |||
| 1074 | static double | ||
| 1075 | _TG_ATTRS | ||
| 1076 | __tg_nexttoward(double __x, long double __y) {return nexttoward(__x, __y);} | ||
| 1077 | |||
| 1078 | static long double | ||
| 1079 | _TG_ATTRS | ||
| 1080 | __tg_nexttoward(long double __x, long double __y) {return nexttowardl(__x, __y);} | ||
| 1081 | |||
| 1082 | #undef nexttoward | ||
| 1083 | #define nexttoward(__x, __y) __tg_nexttoward(__tg_promote1((__x))(__x), (__y)) | ||
| 1084 | |||
| 1085 | // remainder | ||
| 1086 | |||
| 1087 | static float | ||
| 1088 | _TG_ATTRS | ||
| 1089 | __tg_remainder(float __x, float __y) {return remainderf(__x, __y);} | ||
| 1090 | |||
| 1091 | static double | ||
| 1092 | _TG_ATTRS | ||
| 1093 | __tg_remainder(double __x, double __y) {return remainder(__x, __y);} | ||
| 1094 | |||
| 1095 | static long double | ||
| 1096 | _TG_ATTRS | ||
| 1097 | __tg_remainder(long double __x, long double __y) {return remainderl(__x, __y);} | ||
| 1098 | |||
| 1099 | #undef remainder | ||
| 1100 | #define remainder(__x, __y) __tg_remainder(__tg_promote2((__x), (__y))(__x), \ | ||
| 1101 | __tg_promote2((__x), (__y))(__y)) | ||
| 1102 | |||
| 1103 | // remquo | ||
| 1104 | |||
| 1105 | static float | ||
| 1106 | _TG_ATTRS | ||
| 1107 | __tg_remquo(float __x, float __y, int* __z) | ||
| 1108 | {return remquof(__x, __y, __z);} | ||
| 1109 | |||
| 1110 | static double | ||
| 1111 | _TG_ATTRS | ||
| 1112 | __tg_remquo(double __x, double __y, int* __z) | ||
| 1113 | {return remquo(__x, __y, __z);} | ||
| 1114 | |||
| 1115 | static long double | ||
| 1116 | _TG_ATTRS | ||
| 1117 | __tg_remquo(long double __x,long double __y, int* __z) | ||
| 1118 | {return remquol(__x, __y, __z);} | ||
| 1119 | |||
| 1120 | #undef remquo | ||
| 1121 | #define remquo(__x, __y, __z) \ | ||
| 1122 | __tg_remquo(__tg_promote2((__x), (__y))(__x), \ | ||
| 1123 | __tg_promote2((__x), (__y))(__y), \ | ||
| 1124 | (__z)) | ||
| 1125 | |||
| 1126 | // rint | ||
| 1127 | |||
| 1128 | static float | ||
| 1129 | _TG_ATTRS | ||
| 1130 | __tg_rint(float __x) {return rintf(__x);} | ||
| 1131 | |||
| 1132 | static double | ||
| 1133 | _TG_ATTRS | ||
| 1134 | __tg_rint(double __x) {return rint(__x);} | ||
| 1135 | |||
| 1136 | static long double | ||
| 1137 | _TG_ATTRS | ||
| 1138 | __tg_rint(long double __x) {return rintl(__x);} | ||
| 1139 | |||
| 1140 | #undef rint | ||
| 1141 | #define rint(__x) __tg_rint(__tg_promote1((__x))(__x)) | ||
| 1142 | |||
| 1143 | // round | ||
| 1144 | |||
| 1145 | static float | ||
| 1146 | _TG_ATTRS | ||
| 1147 | __tg_round(float __x) {return roundf(__x);} | ||
| 1148 | |||
| 1149 | static double | ||
| 1150 | _TG_ATTRS | ||
| 1151 | __tg_round(double __x) {return round(__x);} | ||
| 1152 | |||
| 1153 | static long double | ||
| 1154 | _TG_ATTRS | ||
| 1155 | __tg_round(long double __x) {return roundl(__x);} | ||
| 1156 | |||
| 1157 | #undef round | ||
| 1158 | #define round(__x) __tg_round(__tg_promote1((__x))(__x)) | ||
| 1159 | |||
| 1160 | // scalbn | ||
| 1161 | |||
| 1162 | static float | ||
| 1163 | _TG_ATTRS | ||
| 1164 | __tg_scalbn(float __x, int __y) {return scalbnf(__x, __y);} | ||
| 1165 | |||
| 1166 | static double | ||
| 1167 | _TG_ATTRS | ||
| 1168 | __tg_scalbn(double __x, int __y) {return scalbn(__x, __y);} | ||
| 1169 | |||
| 1170 | static long double | ||
| 1171 | _TG_ATTRS | ||
| 1172 | __tg_scalbn(long double __x, int __y) {return scalbnl(__x, __y);} | ||
| 1173 | |||
| 1174 | #undef scalbn | ||
| 1175 | #define scalbn(__x, __y) __tg_scalbn(__tg_promote1((__x))(__x), __y) | ||
| 1176 | |||
| 1177 | // scalbln | ||
| 1178 | |||
| 1179 | static float | ||
| 1180 | _TG_ATTRS | ||
| 1181 | __tg_scalbln(float __x, long __y) {return scalblnf(__x, __y);} | ||
| 1182 | |||
| 1183 | static double | ||
| 1184 | _TG_ATTRS | ||
| 1185 | __tg_scalbln(double __x, long __y) {return scalbln(__x, __y);} | ||
| 1186 | |||
| 1187 | static long double | ||
| 1188 | _TG_ATTRS | ||
| 1189 | __tg_scalbln(long double __x, long __y) {return scalblnl(__x, __y);} | ||
| 1190 | |||
| 1191 | #undef scalbln | ||
| 1192 | #define scalbln(__x, __y) __tg_scalbln(__tg_promote1((__x))(__x), __y) | ||
| 1193 | |||
| 1194 | // tgamma | ||
| 1195 | |||
| 1196 | static float | ||
| 1197 | _TG_ATTRS | ||
| 1198 | __tg_tgamma(float __x) {return tgammaf(__x);} | ||
| 1199 | |||
| 1200 | static double | ||
| 1201 | _TG_ATTRS | ||
| 1202 | __tg_tgamma(double __x) {return tgamma(__x);} | ||
| 1203 | |||
| 1204 | static long double | ||
| 1205 | _TG_ATTRS | ||
| 1206 | __tg_tgamma(long double __x) {return tgammal(__x);} | ||
| 1207 | |||
| 1208 | #undef tgamma | ||
| 1209 | #define tgamma(__x) __tg_tgamma(__tg_promote1((__x))(__x)) | ||
| 1210 | |||
| 1211 | // trunc | ||
| 1212 | |||
| 1213 | static float | ||
| 1214 | _TG_ATTRS | ||
| 1215 | __tg_trunc(float __x) {return truncf(__x);} | ||
| 1216 | |||
| 1217 | static double | ||
| 1218 | _TG_ATTRS | ||
| 1219 | __tg_trunc(double __x) {return trunc(__x);} | ||
| 1220 | |||
| 1221 | static long double | ||
| 1222 | _TG_ATTRS | ||
| 1223 | __tg_trunc(long double __x) {return truncl(__x);} | ||
| 1224 | |||
| 1225 | #undef trunc | ||
| 1226 | #define trunc(__x) __tg_trunc(__tg_promote1((__x))(__x)) | ||
| 1227 | |||
| 1228 | // carg | ||
| 1229 | |||
| 1230 | static float | ||
| 1231 | _TG_ATTRS | ||
| 1232 | __tg_carg(float __x) {return atan2f(0.F, __x);} | ||
| 1233 | |||
| 1234 | static double | ||
| 1235 | _TG_ATTRS | ||
| 1236 | __tg_carg(double __x) {return atan2(0., __x);} | ||
| 1237 | |||
| 1238 | static long double | ||
| 1239 | _TG_ATTRS | ||
| 1240 | __tg_carg(long double __x) {return atan2l(0.L, __x);} | ||
| 1241 | |||
| 1242 | static float | ||
| 1243 | _TG_ATTRS | ||
| 1244 | __tg_carg(float _Complex __x) {return cargf(__x);} | ||
| 1245 | |||
| 1246 | static double | ||
| 1247 | _TG_ATTRS | ||
| 1248 | __tg_carg(double _Complex __x) {return carg(__x);} | ||
| 1249 | |||
| 1250 | static long double | ||
| 1251 | _TG_ATTRS | ||
| 1252 | __tg_carg(long double _Complex __x) {return cargl(__x);} | ||
| 1253 | |||
| 1254 | #undef carg | ||
| 1255 | #define carg(__x) __tg_carg(__tg_promote1((__x))(__x)) | ||
| 1256 | |||
| 1257 | // cimag | ||
| 1258 | |||
| 1259 | static float | ||
| 1260 | _TG_ATTRS | ||
| 1261 | __tg_cimag(float __x) {return 0;} | ||
| 1262 | |||
| 1263 | static double | ||
| 1264 | _TG_ATTRS | ||
| 1265 | __tg_cimag(double __x) {return 0;} | ||
| 1266 | |||
| 1267 | static long double | ||
| 1268 | _TG_ATTRS | ||
| 1269 | __tg_cimag(long double __x) {return 0;} | ||
| 1270 | |||
| 1271 | static float | ||
| 1272 | _TG_ATTRS | ||
| 1273 | __tg_cimag(float _Complex __x) {return cimagf(__x);} | ||
| 1274 | |||
| 1275 | static double | ||
| 1276 | _TG_ATTRS | ||
| 1277 | __tg_cimag(double _Complex __x) {return cimag(__x);} | ||
| 1278 | |||
| 1279 | static long double | ||
| 1280 | _TG_ATTRS | ||
| 1281 | __tg_cimag(long double _Complex __x) {return cimagl(__x);} | ||
| 1282 | |||
| 1283 | #undef cimag | ||
| 1284 | #define cimag(__x) __tg_cimag(__tg_promote1((__x))(__x)) | ||
| 1285 | |||
| 1286 | // conj | ||
| 1287 | |||
| 1288 | static float _Complex | ||
| 1289 | _TG_ATTRS | ||
| 1290 | __tg_conj(float __x) {return __x;} | ||
| 1291 | |||
| 1292 | static double _Complex | ||
| 1293 | _TG_ATTRS | ||
| 1294 | __tg_conj(double __x) {return __x;} | ||
| 1295 | |||
| 1296 | static long double _Complex | ||
| 1297 | _TG_ATTRS | ||
| 1298 | __tg_conj(long double __x) {return __x;} | ||
| 1299 | |||
| 1300 | static float _Complex | ||
| 1301 | _TG_ATTRS | ||
| 1302 | __tg_conj(float _Complex __x) {return conjf(__x);} | ||
| 1303 | |||
| 1304 | static double _Complex | ||
| 1305 | _TG_ATTRS | ||
| 1306 | __tg_conj(double _Complex __x) {return conj(__x);} | ||
| 1307 | |||
| 1308 | static long double _Complex | ||
| 1309 | _TG_ATTRS | ||
| 1310 | __tg_conj(long double _Complex __x) {return conjl(__x);} | ||
| 1311 | |||
| 1312 | #undef conj | ||
| 1313 | #define conj(__x) __tg_conj(__tg_promote1((__x))(__x)) | ||
| 1314 | |||
| 1315 | // cproj | ||
| 1316 | |||
| 1317 | static float _Complex | ||
| 1318 | _TG_ATTRS | ||
| 1319 | __tg_cproj(float __x) {return cprojf(__x);} | ||
| 1320 | |||
| 1321 | static double _Complex | ||
| 1322 | _TG_ATTRS | ||
| 1323 | __tg_cproj(double __x) {return cproj(__x);} | ||
| 1324 | |||
| 1325 | static long double _Complex | ||
| 1326 | _TG_ATTRS | ||
| 1327 | __tg_cproj(long double __x) {return cprojl(__x);} | ||
| 1328 | |||
| 1329 | static float _Complex | ||
| 1330 | _TG_ATTRS | ||
| 1331 | __tg_cproj(float _Complex __x) {return cprojf(__x);} | ||
| 1332 | |||
| 1333 | static double _Complex | ||
| 1334 | _TG_ATTRS | ||
| 1335 | __tg_cproj(double _Complex __x) {return cproj(__x);} | ||
| 1336 | |||
| 1337 | static long double _Complex | ||
| 1338 | _TG_ATTRS | ||
| 1339 | __tg_cproj(long double _Complex __x) {return cprojl(__x);} | ||
| 1340 | |||
| 1341 | #undef cproj | ||
| 1342 | #define cproj(__x) __tg_cproj(__tg_promote1((__x))(__x)) | ||
| 1343 | |||
| 1344 | // creal | ||
| 1345 | |||
| 1346 | static float | ||
| 1347 | _TG_ATTRS | ||
| 1348 | __tg_creal(float __x) {return __x;} | ||
| 1349 | |||
| 1350 | static double | ||
| 1351 | _TG_ATTRS | ||
| 1352 | __tg_creal(double __x) {return __x;} | ||
| 1353 | |||
| 1354 | static long double | ||
| 1355 | _TG_ATTRS | ||
| 1356 | __tg_creal(long double __x) {return __x;} | ||
| 1357 | |||
| 1358 | static float | ||
| 1359 | _TG_ATTRS | ||
| 1360 | __tg_creal(float _Complex __x) {return crealf(__x);} | ||
| 1361 | |||
| 1362 | static double | ||
| 1363 | _TG_ATTRS | ||
| 1364 | __tg_creal(double _Complex __x) {return creal(__x);} | ||
| 1365 | |||
| 1366 | static long double | ||
| 1367 | _TG_ATTRS | ||
| 1368 | __tg_creal(long double _Complex __x) {return creall(__x);} | ||
| 1369 | |||
| 1370 | #undef creal | ||
| 1371 | #define creal(__x) __tg_creal(__tg_promote1((__x))(__x)) | ||
| 1372 | |||
| 1373 | #undef _TG_ATTRSp | ||
| 1374 | #undef _TG_ATTRS | ||
| 1375 | |||
| 1376 | #if __has_include(<realtime_safety/realtime_safety.h>) | ||
| 1377 | REALTIME_SAFE_END | ||
| 1378 | #endif | ||
| 1379 | |||
| 1380 | #endif /* __cplusplus */ | ||
| 1381 | #endif /* __TGMATH_H */ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.13-any/unistd.h created+791| ... | @@ -0,0 +1,791 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2000, 2002-2006, 2008-2010, 2012 Apple Inc. All rights reserved. | ||
| 3 | * | ||
| 4 | * @APPLE_LICENSE_HEADER_START@ | ||
| 5 | * | ||
| 6 | * This file contains Original Code and/or Modifications of Original Code | ||
| 7 | * as defined in and that are subject to the Apple Public Source License | ||
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | ||
| 9 | * compliance with the License. Please obtain a copy of the License at | ||
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | ||
| 11 | * file. | ||
| 12 | * | ||
| 13 | * The Original Code and all software distributed under the License are | ||
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | ||
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | ||
| 18 | * Please see the License for the specific language governing rights and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | * @APPLE_LICENSE_HEADER_END@ | ||
| 22 | */ | ||
| 23 | /*- | ||
| 24 | * Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved | ||
| 25 | * Copyright (c) 1991, 1993, 1994 | ||
| 26 | *	The Regents of the University of California. All rights reserved. | ||
| 27 | * | ||
| 28 | * Redistribution and use in source and binary forms, with or without | ||
| 29 | * modification, are permitted provided that the following conditions | ||
| 30 | * are met: | ||
| 31 | * 1. Redistributions of source code must retain the above copyright | ||
| 32 | * notice, this list of conditions and the following disclaimer. | ||
| 33 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 34 | * notice, this list of conditions and the following disclaimer in the | ||
| 35 | * documentation and/or other materials provided with the distribution. | ||
| 36 | * 3. All advertising materials mentioning features or use of this software | ||
| 37 | * must display the following acknowledgement: | ||
| 38 | *	This product includes software developed by the University of | ||
| 39 | *	California, Berkeley and its contributors. | ||
| 40 | * 4. Neither the name of the University nor the names of its contributors | ||
| 41 | * may be used to endorse or promote products derived from this software | ||
| 42 | * without specific prior written permission. | ||
| 43 | * | ||
| 44 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 45 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 46 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 47 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 48 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 49 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 50 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 51 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 52 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 53 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 54 | * SUCH DAMAGE. | ||
| 55 | * | ||
| 56 | *	@(#)unistd.h	8.12 (Berkeley) 4/27/95 | ||
| 57 | * | ||
| 58 | * Copyright (c) 1998 Apple Compter, Inc. | ||
| 59 | * All Rights Reserved | ||
| 60 | */ | ||
| 61 | |||
| 62 | /* History: | ||
| 63 | 7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr | ||
| 64 | 3/26/98 CHW at Apple added real interface to searchfs call | ||
| 65 | 	3/5/98 CHW at Apple added hfs semantic system calls headers | ||
| 66 | */ | ||
| 67 | |||
| 68 | #ifndef _UNISTD_H_ | ||
| 69 | #define	_UNISTD_H_ | ||
| 70 | |||
| 71 | #include <_types.h> | ||
| 72 | #include <sys/unistd.h> | ||
| 73 | #include <Availability.h> | ||
| 74 | #include <sys/_types/_gid_t.h> | ||
| 75 | #include <sys/_types/_intptr_t.h> | ||
| 76 | #include <sys/_types/_off_t.h> | ||
| 77 | #include <sys/_types/_pid_t.h> | ||
| 78 | /* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: | ||
| 79 | * _GCC_SIZE_T */ | ||
| 80 | #include <sys/_types/_size_t.h> | ||
| 81 | #include <sys/_types/_ssize_t.h> | ||
| 82 | #include <sys/_types/_uid_t.h> | ||
| 83 | #include <sys/_types/_useconds_t.h> | ||
| 84 | #include <sys/_types/_null.h> | ||
| 85 | |||
| 86 | #define	 STDIN_FILENO	0	/* standard input file descriptor */ | ||
| 87 | #define	STDOUT_FILENO	1	/* standard output file descriptor */ | ||
| 88 | #define	STDERR_FILENO	2	/* standard error file descriptor */ | ||
| 89 | |||
| 90 | |||
| 91 | /* Version test macros */ | ||
| 92 | /* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */ | ||
| 93 | #define	_XOPEN_VERSION			600		/* [XSI] */ | ||
| 94 | #define	_XOPEN_XCU_VERSION		4		/* Older standard */ | ||
| 95 | |||
| 96 | |||
| 97 | /* Please keep this list in the same order as the applicable standard */ | ||
| 98 | #define	_POSIX_ADVISORY_INFO		(-1)		/* [ADV] */ | ||
| 99 | #define	_POSIX_ASYNCHRONOUS_IO		(-1)		/* [AIO] */ | ||
| 100 | #define	_POSIX_BARRIERS			(-1)		/* [BAR] */ | ||
| 101 | #define	_POSIX_CHOWN_RESTRICTED		200112L | ||
| 102 | #define	_POSIX_CLOCK_SELECTION		(-1)		/* [CS] */ | ||
| 103 | #define	_POSIX_CPUTIME			(-1)		/* [CPT] */ | ||
| 104 | #define	_POSIX_FSYNC			200112L		/* [FSC] */ | ||
| 105 | #define	_POSIX_IPV6			200112L | ||
| 106 | #define	_POSIX_JOB_CONTROL		200112L | ||
| 107 | #define	_POSIX_MAPPED_FILES		200112L		/* [MF] */ | ||
| 108 | #define	_POSIX_MEMLOCK			(-1)		/* [ML] */ | ||
| 109 | #define	_POSIX_MEMLOCK_RANGE		(-1)		/* [MR] */ | ||
| 110 | #define	_POSIX_MEMORY_PROTECTION	200112L		/* [MPR] */ | ||
| 111 | #define	_POSIX_MESSAGE_PASSING		(-1)		/* [MSG] */ | ||
| 112 | #define	_POSIX_MONOTONIC_CLOCK		(-1)		/* [MON] */ | ||
| 113 | #define	_POSIX_NO_TRUNC			200112L | ||
| 114 | #define	_POSIX_PRIORITIZED_IO		(-1)		/* [PIO] */ | ||
| 115 | #define	_POSIX_PRIORITY_SCHEDULING	(-1)		/* [PS] */ | ||
| 116 | #define	_POSIX_RAW_SOCKETS		(-1)		/* [RS] */ | ||
| 117 | #define	_POSIX_READER_WRITER_LOCKS	200112L		/* [THR] */ | ||
| 118 | #define	_POSIX_REALTIME_SIGNALS		(-1)		/* [RTS] */ | ||
| 119 | #define	_POSIX_REGEXP			200112L | ||
| 120 | #define	_POSIX_SAVED_IDS		200112L		/* XXX required */ | ||
| 121 | #define	_POSIX_SEMAPHORES		(-1)		/* [SEM] */ | ||
| 122 | #define	_POSIX_SHARED_MEMORY_OBJECTS	(-1)		/* [SHM] */ | ||
| 123 | #define	_POSIX_SHELL			200112L | ||
| 124 | #define	_POSIX_SPAWN			200112L		/* [SPN] */ | ||
| 125 | #define	_POSIX_SPIN_LOCKS		(-1)		/* [SPI] */ | ||
| 126 | #define	_POSIX_SPORADIC_SERVER		(-1)		/* [SS] */ | ||
| 127 | #define	_POSIX_SYNCHRONIZED_IO		(-1)		/* [SIO] */ | ||
| 128 | #define	_POSIX_THREAD_ATTR_STACKADDR	200112L		/* [TSA] */ | ||
| 129 | #define	_POSIX_THREAD_ATTR_STACKSIZE	200112L		/* [TSS] */ | ||
| 130 | #define	_POSIX_THREAD_CPUTIME		(-1)		/* [TCT] */ | ||
| 131 | #define	_POSIX_THREAD_PRIO_INHERIT	(-1)		/* [TPI] */ | ||
| 132 | #define	_POSIX_THREAD_PRIO_PROTECT	(-1)		/* [TPP] */ | ||
| 133 | #define	_POSIX_THREAD_PRIORITY_SCHEDULING	(-1)	/* [TPS] */ | ||
| 134 | #define	_POSIX_THREAD_PROCESS_SHARED	200112L		/* [TSH] */ | ||
| 135 | #define	_POSIX_THREAD_SAFE_FUNCTIONS	200112L		/* [TSF] */ | ||
| 136 | #define	_POSIX_THREAD_SPORADIC_SERVER	(-1)		/* [TSP] */ | ||
| 137 | #define	_POSIX_THREADS			200112L		/* [THR] */ | ||
| 138 | #define	_POSIX_TIMEOUTS			(-1)		/* [TMO] */ | ||
| 139 | #define	_POSIX_TIMERS			(-1)		/* [TMR] */ | ||
| 140 | #define	_POSIX_TRACE			(-1)		/* [TRC] */ | ||
| 141 | #define	_POSIX_TRACE_EVENT_FILTER	(-1)		/* [TEF] */ | ||
| 142 | #define	_POSIX_TRACE_INHERIT		(-1)		/* [TRI] */ | ||
| 143 | #define	_POSIX_TRACE_LOG		(-1)		/* [TRL] */ | ||
| 144 | #define	_POSIX_TYPED_MEMORY_OBJECTS	(-1)		/* [TYM] */ | ||
| 145 | #ifndef _POSIX_VDISABLE | ||
| 146 | #define	_POSIX_VDISABLE			0xff		/* same as sys/termios.h */ | ||
| 147 | #endif /* _POSIX_VDISABLE */ | ||
| 148 | |||
| 149 | #if __DARWIN_C_LEVEL >= 199209L | ||
| 150 | #define	_POSIX2_C_BIND			200112L | ||
| 151 | #define	_POSIX2_C_DEV			200112L		/* c99 command */ | ||
| 152 | #define	_POSIX2_CHAR_TERM		200112L | ||
| 153 | #define	_POSIX2_FORT_DEV		(-1)		/* fort77 command */ | ||
| 154 | #define	_POSIX2_FORT_RUN		200112L | ||
| 155 | #define	_POSIX2_LOCALEDEF		200112L		/* localedef command */ | ||
| 156 | #define	_POSIX2_PBS			(-1) | ||
| 157 | #define	_POSIX2_PBS_ACCOUNTING		(-1) | ||
| 158 | #define	_POSIX2_PBS_CHECKPOINT		(-1) | ||
| 159 | #define	_POSIX2_PBS_LOCATE		(-1) | ||
| 160 | #define	_POSIX2_PBS_MESSAGE		(-1) | ||
| 161 | #define	_POSIX2_PBS_TRACK		(-1) | ||
| 162 | #define	_POSIX2_SW_DEV			200112L | ||
| 163 | #define	_POSIX2_UPE			200112L	/* XXXX no fc, newgrp, tabs */ | ||
| 164 | #endif /* __DARWIN_C_LEVEL */ | ||
| 165 | |||
| 166 | #define	__ILP32_OFF32 (-1) | ||
| 167 | #define	__ILP32_OFFBIG (-1) | ||
| 168 | |||
| 169 | #define	__LP64_OFF64 (1) | ||
| 170 | #define	__LPBIG_OFFBIG (1) | ||
| 171 | |||
| 172 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 173 | #define	_POSIX_V6_ILP32_OFF32		__ILP32_OFF32 | ||
| 174 | #define	_POSIX_V6_ILP32_OFFBIG		__ILP32_OFFBIG | ||
| 175 | #define	_POSIX_V6_LP64_OFF64		__LP64_OFF64 | ||
| 176 | #define	_POSIX_V6_LPBIG_OFFBIG		__LPBIG_OFFBIG | ||
| 177 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 178 | |||
| 179 | #if __DARWIN_C_LEVEL >= 200809L | ||
| 180 | #define	_POSIX_V7_ILP32_OFF32		__ILP32_OFF32 | ||
| 181 | #define	_POSIX_V7_ILP32_OFFBIG		__ILP32_OFFBIG | ||
| 182 | #define	_POSIX_V7_LP64_OFF64		__LP64_OFF64 | ||
| 183 | #define	_POSIX_V7_LPBIG_OFFBIG		__LPBIG_OFFBIG | ||
| 184 | #endif /* __DARWIN_C_LEVEL >= 200809L */ | ||
| 185 | |||
| 186 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 187 | #define	_V6_ILP32_OFF32 __ILP32_OFF32 | ||
| 188 | #define	_V6_ILP32_OFFBIG __ILP32_OFFBIG | ||
| 189 | #define	_V6_LP64_OFF64 __LP64_OFF64 | ||
| 190 | #define	_V6_LPBIG_OFFBIG __LPBIG_OFFBIG | ||
| 191 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 192 | |||
| 193 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 194 | /* Removed in Issue 7 */ | ||
| 195 | #define	_XBS5_ILP32_OFF32		 __ILP32_OFF32 | ||
| 196 | #define	_XBS5_ILP32_OFFBIG		 __ILP32_OFFBIG | ||
| 197 | #define	_XBS5_LP64_OFF64		 __LP64_OFF64 | ||
| 198 | #define	_XBS5_LPBIG_OFFBIG		 __LPBIG_OFFBIG | ||
| 199 | #endif /* __DARWIN_C_LEVEL < 200809L */ | ||
| 200 | |||
| 201 | #if __DARWIN_C_LEVEL >= 199506L /* This really should be XSI */ | ||
| 202 | #define	_XOPEN_CRYPT			(1) | ||
| 203 | #define	_XOPEN_ENH_I18N			(1)		/* XXX required */ | ||
| 204 | #define	_XOPEN_LEGACY			(-1)	/* no ftime gcvt, wcswcs */ | ||
| 205 | #define	_XOPEN_REALTIME			(-1)	/* no q'ed signals, mq_* */ | ||
| 206 | #define	_XOPEN_REALTIME_THREADS		(-1)	/* no posix_spawn, et. al. */ | ||
| 207 | #define	_XOPEN_SHM			(1) | ||
| 208 | #define	_XOPEN_STREAMS			(-1) /* Issue 6 */ | ||
| 209 | #define	_XOPEN_UNIX			(1) | ||
| 210 | #endif /* XSI */ | ||
| 211 | |||
| 212 | /* configurable system variables */ | ||
| 213 | #define	_SC_ARG_MAX			 1 | ||
| 214 | #define	_SC_CHILD_MAX			 2 | ||
| 215 | #define	_SC_CLK_TCK			 3 | ||
| 216 | #define	_SC_NGROUPS_MAX			 4 | ||
| 217 | #define	_SC_OPEN_MAX			 5 | ||
| 218 | #define	_SC_JOB_CONTROL			 6 | ||
| 219 | #define	_SC_SAVED_IDS			 7 | ||
| 220 | #define	_SC_VERSION			 8 | ||
| 221 | #define	_SC_BC_BASE_MAX			 9 | ||
| 222 | #define	_SC_BC_DIM_MAX			10 | ||
| 223 | #define	_SC_BC_SCALE_MAX		11 | ||
| 224 | #define	_SC_BC_STRING_MAX		12 | ||
| 225 | #define	_SC_COLL_WEIGHTS_MAX		13 | ||
| 226 | #define	_SC_EXPR_NEST_MAX		14 | ||
| 227 | #define	_SC_LINE_MAX			15 | ||
| 228 | #define	_SC_RE_DUP_MAX			16 | ||
| 229 | #define	_SC_2_VERSION			17 | ||
| 230 | #define	_SC_2_C_BIND			18 | ||
| 231 | #define	_SC_2_C_DEV			19 | ||
| 232 | #define	_SC_2_CHAR_TERM			20 | ||
| 233 | #define	_SC_2_FORT_DEV			21 | ||
| 234 | #define	_SC_2_FORT_RUN			22 | ||
| 235 | #define	_SC_2_LOCALEDEF			23 | ||
| 236 | #define	_SC_2_SW_DEV			24 | ||
| 237 | #define	_SC_2_UPE			25 | ||
| 238 | #define	_SC_STREAM_MAX			26 | ||
| 239 | #define	_SC_TZNAME_MAX			27 | ||
| 240 | |||
| 241 | #if __DARWIN_C_LEVEL >= 199309L | ||
| 242 | #define	_SC_ASYNCHRONOUS_IO		28 | ||
| 243 | #define	_SC_PAGESIZE			29 | ||
| 244 | #define	_SC_MEMLOCK			30 | ||
| 245 | #define	_SC_MEMLOCK_RANGE		31 | ||
| 246 | #define	_SC_MEMORY_PROTECTION		32 | ||
| 247 | #define	_SC_MESSAGE_PASSING		33 | ||
| 248 | #define	_SC_PRIORITIZED_IO		34 | ||
| 249 | #define	_SC_PRIORITY_SCHEDULING		35 | ||
| 250 | #define	_SC_REALTIME_SIGNALS		36 | ||
| 251 | #define	_SC_SEMAPHORES			37 | ||
| 252 | #define	_SC_FSYNC			38 | ||
| 253 | #define	_SC_SHARED_MEMORY_OBJECTS 	39 | ||
| 254 | #define	_SC_SYNCHRONIZED_IO		40 | ||
| 255 | #define	_SC_TIMERS			41 | ||
| 256 | #define	_SC_AIO_LISTIO_MAX		42 | ||
| 257 | #define	_SC_AIO_MAX			43 | ||
| 258 | #define	_SC_AIO_PRIO_DELTA_MAX		44 | ||
| 259 | #define	_SC_DELAYTIMER_MAX		45 | ||
| 260 | #define	_SC_MQ_OPEN_MAX			46 | ||
| 261 | #define	_SC_MAPPED_FILES		47	/* swap _SC_PAGESIZE vs. BSD */ | ||
| 262 | #define	_SC_RTSIG_MAX			48 | ||
| 263 | #define	_SC_SEM_NSEMS_MAX		49 | ||
| 264 | #define	_SC_SEM_VALUE_MAX		50 | ||
| 265 | #define	_SC_SIGQUEUE_MAX		51 | ||
| 266 | #define	_SC_TIMER_MAX			52 | ||
| 267 | #endif /* __DARWIN_C_LEVEL >= 199309L */ | ||
| 268 | |||
| 269 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 270 | #define	_SC_NPROCESSORS_CONF		57 | ||
| 271 | #define	_SC_NPROCESSORS_ONLN		58 | ||
| 272 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 273 | |||
| 274 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 275 | #define	_SC_2_PBS			59 | ||
| 276 | #define	_SC_2_PBS_ACCOUNTING		60 | ||
| 277 | #define	_SC_2_PBS_CHECKPOINT		61 | ||
| 278 | #define	_SC_2_PBS_LOCATE		62 | ||
| 279 | #define	_SC_2_PBS_MESSAGE		63 | ||
| 280 | #define	_SC_2_PBS_TRACK			64 | ||
| 281 | #define	_SC_ADVISORY_INFO		65 | ||
| 282 | #define	_SC_BARRIERS			66 | ||
| 283 | #define	_SC_CLOCK_SELECTION		67 | ||
| 284 | #define	_SC_CPUTIME			68 | ||
| 285 | #define	_SC_FILE_LOCKING		69 | ||
| 286 | #define	_SC_GETGR_R_SIZE_MAX		70 | ||
| 287 | #define	_SC_GETPW_R_SIZE_MAX		71 | ||
| 288 | #define	_SC_HOST_NAME_MAX		72 | ||
| 289 | #define	_SC_LOGIN_NAME_MAX		73 | ||
| 290 | #define	_SC_MONOTONIC_CLOCK		74 | ||
| 291 | #define	_SC_MQ_PRIO_MAX			75 | ||
| 292 | #define	_SC_READER_WRITER_LOCKS		76 | ||
| 293 | #define	_SC_REGEXP			77 | ||
| 294 | #define	_SC_SHELL			78 | ||
| 295 | #define	_SC_SPAWN			79 | ||
| 296 | #define	_SC_SPIN_LOCKS			80 | ||
| 297 | #define	_SC_SPORADIC_SERVER		81 | ||
| 298 | #define	_SC_THREAD_ATTR_STACKADDR	82 | ||
| 299 | #define	_SC_THREAD_ATTR_STACKSIZE	83 | ||
| 300 | #define	_SC_THREAD_CPUTIME		84 | ||
| 301 | #define	_SC_THREAD_DESTRUCTOR_ITERATIONS 85 | ||
| 302 | #define	_SC_THREAD_KEYS_MAX		86 | ||
| 303 | #define	_SC_THREAD_PRIO_INHERIT		87 | ||
| 304 | #define	_SC_THREAD_PRIO_PROTECT		88 | ||
| 305 | #define	_SC_THREAD_PRIORITY_SCHEDULING	89 | ||
| 306 | #define	_SC_THREAD_PROCESS_SHARED	90 | ||
| 307 | #define	_SC_THREAD_SAFE_FUNCTIONS	91 | ||
| 308 | #define	_SC_THREAD_SPORADIC_SERVER	92 | ||
| 309 | #define	_SC_THREAD_STACK_MIN		93 | ||
| 310 | #define	_SC_THREAD_THREADS_MAX		94 | ||
| 311 | #define	_SC_TIMEOUTS			95 | ||
| 312 | #define	_SC_THREADS			96 | ||
| 313 | #define	_SC_TRACE			97 | ||
| 314 | #define	_SC_TRACE_EVENT_FILTER		98 | ||
| 315 | #define	_SC_TRACE_INHERIT		99 | ||
| 316 | #define	_SC_TRACE_LOG			100 | ||
| 317 | #define	_SC_TTY_NAME_MAX		101 | ||
| 318 | #define	_SC_TYPED_MEMORY_OBJECTS	102 | ||
| 319 | #define	_SC_V6_ILP32_OFF32		103 | ||
| 320 | #define	_SC_V6_ILP32_OFFBIG		104 | ||
| 321 | #define	_SC_V6_LP64_OFF64		105 | ||
| 322 | #define	_SC_V6_LPBIG_OFFBIG		106 | ||
| 323 | #define	_SC_IPV6			118 | ||
| 324 | #define	_SC_RAW_SOCKETS			119 | ||
| 325 | #define	_SC_SYMLOOP_MAX			120 | ||
| 326 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 327 | |||
| 328 | #if __DARWIN_C_LEVEL >= 199506L /* Really XSI */ | ||
| 329 | #define	_SC_ATEXIT_MAX			107 | ||
| 330 | #define	_SC_IOV_MAX			56 | ||
| 331 | #define	_SC_PAGE_SIZE			_SC_PAGESIZE | ||
| 332 | #define	_SC_XOPEN_CRYPT			108 | ||
| 333 | #define	_SC_XOPEN_ENH_I18N		109 | ||
| 334 | #define	_SC_XOPEN_LEGACY		110 /* Issue 6 */ | ||
| 335 | #define	_SC_XOPEN_REALTIME		111 /* Issue 6 */ | ||
| 336 | #define	_SC_XOPEN_REALTIME_THREADS	112 /* Issue 6 */ | ||
| 337 | #define	_SC_XOPEN_SHM			113 | ||
| 338 | #define	_SC_XOPEN_STREAMS		114 /* Issue 6 */ | ||
| 339 | #define	_SC_XOPEN_UNIX			115 | ||
| 340 | #define	_SC_XOPEN_VERSION		116 | ||
| 341 | #define	_SC_XOPEN_XCU_VERSION		121 | ||
| 342 | #endif /* XSI */ | ||
| 343 | |||
| 344 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 345 | /* Removed in Issue 7 */ | ||
| 346 | #define	_SC_XBS5_ILP32_OFF32		122 | ||
| 347 | #define	_SC_XBS5_ILP32_OFFBIG		123 | ||
| 348 | #define	_SC_XBS5_LP64_OFF64		124 | ||
| 349 | #define	_SC_XBS5_LPBIG_OFFBIG		125 | ||
| 350 | #endif /* __DARWIN_C_LEVEL <= 200809L */ | ||
| 351 | |||
| 352 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 353 | #define	_SC_SS_REPL_MAX			126 | ||
| 354 | #define	_SC_TRACE_EVENT_NAME_MAX	127 | ||
| 355 | #define	_SC_TRACE_NAME_MAX		128 | ||
| 356 | #define	_SC_TRACE_SYS_MAX		129 | ||
| 357 | #define	_SC_TRACE_USER_EVENT_MAX	130 | ||
| 358 | #endif | ||
| 359 | |||
| 360 | #if __DARWIN_C_LEVEL < 200112L || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 361 | /* Removed in Issue 6 */ | ||
| 362 | #define	_SC_PASS_MAX			131 | ||
| 363 | #endif | ||
| 364 | |||
| 365 | /* 132-199 available for future use */ | ||
| 366 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 367 | #define	_SC_PHYS_PAGES			200 | ||
| 368 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 369 | |||
| 370 | #if __DARWIN_C_LEVEL >= 199209L | ||
| 371 | #ifndef _CS_PATH /* Defined in <sys/unistd.h> */ | ||
| 372 | #define	_CS_PATH				1 | ||
| 373 | #endif | ||
| 374 | #endif | ||
| 375 | |||
| 376 | #if __DARWIN_C_LEVEL >= 200112 | ||
| 377 | #define	_CS_POSIX_V6_ILP32_OFF32_CFLAGS		2 | ||
| 378 | #define	_CS_POSIX_V6_ILP32_OFF32_LDFLAGS	3 | ||
| 379 | #define	_CS_POSIX_V6_ILP32_OFF32_LIBS		4 | ||
| 380 | #define	_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS	5 | ||
| 381 | #define	_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS	6 | ||
| 382 | #define	_CS_POSIX_V6_ILP32_OFFBIG_LIBS		7 | ||
| 383 | #define	_CS_POSIX_V6_LP64_OFF64_CFLAGS		8 | ||
| 384 | #define	_CS_POSIX_V6_LP64_OFF64_LDFLAGS		9 | ||
| 385 | #define	_CS_POSIX_V6_LP64_OFF64_LIBS		10 | ||
| 386 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS	11 | ||
| 387 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS	12 | ||
| 388 | #define	_CS_POSIX_V6_LPBIG_OFFBIG_LIBS		13 | ||
| 389 | #define	_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS	14 | ||
| 390 | #endif | ||
| 391 | |||
| 392 | #if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 393 | /* Removed in Issue 7 */ | ||
| 394 | #define	_CS_XBS5_ILP32_OFF32_CFLAGS		20 | ||
| 395 | #define	_CS_XBS5_ILP32_OFF32_LDFLAGS		21 | ||
| 396 | #define	_CS_XBS5_ILP32_OFF32_LIBS		22 | ||
| 397 | #define	_CS_XBS5_ILP32_OFF32_LINTFLAGS		23 | ||
| 398 | #define	_CS_XBS5_ILP32_OFFBIG_CFLAGS		24 | ||
| 399 | #define	_CS_XBS5_ILP32_OFFBIG_LDFLAGS		25 | ||
| 400 | #define	_CS_XBS5_ILP32_OFFBIG_LIBS		26 | ||
| 401 | #define	_CS_XBS5_ILP32_OFFBIG_LINTFLAGS		27 | ||
| 402 | #define	_CS_XBS5_LP64_OFF64_CFLAGS		28 | ||
| 403 | #define	_CS_XBS5_LP64_OFF64_LDFLAGS		29 | ||
| 404 | #define	_CS_XBS5_LP64_OFF64_LIBS		30 | ||
| 405 | #define	_CS_XBS5_LP64_OFF64_LINTFLAGS		31 | ||
| 406 | #define	_CS_XBS5_LPBIG_OFFBIG_CFLAGS		32 | ||
| 407 | #define	_CS_XBS5_LPBIG_OFFBIG_LDFLAGS		33 | ||
| 408 | #define	_CS_XBS5_LPBIG_OFFBIG_LIBS		34 | ||
| 409 | #define	_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS		35 | ||
| 410 | #endif | ||
| 411 | |||
| 412 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 413 | #define	_CS_DARWIN_USER_DIR			65536 | ||
| 414 | #define	_CS_DARWIN_USER_TEMP_DIR		65537 | ||
| 415 | #define	_CS_DARWIN_USER_CACHE_DIR		65538 | ||
| 416 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 417 | |||
| 418 | |||
| 419 | #ifdef _DARWIN_UNLIMITED_GETGROUPS | ||
| 420 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2 | ||
| 421 | #error "_DARWIN_UNLIMITED_GETGROUPS specified, but -miphoneos-version-min version does not support it." | ||
| 422 | #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6 | ||
| 423 | #error "_DARWIN_UNLIMITED_GETGROUPS specified, but -mmacosx-version-min version does not support it." | ||
| 424 | #endif | ||
| 425 | #endif | ||
| 426 | |||
| 427 | /* POSIX.1-1990 */ | ||
| 428 | |||
| 429 | __BEGIN_DECLS | ||
| 430 | void	 _exit(int) __dead2; | ||
| 431 | int	 access(const char *, int); | ||
| 432 | unsigned int | ||
| 433 | 	 alarm(unsigned int); | ||
| 434 | int	 chdir(const char *); | ||
| 435 | int	 chown(const char *, uid_t, gid_t); | ||
| 436 | |||
| 437 | int	 close(int) __DARWIN_ALIAS_C(close); | ||
| 438 | |||
| 439 | int	 dup(int); | ||
| 440 | int	 dup2(int, int); | ||
| 441 | int	 execl(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 442 | int	 execle(const char * __path, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 443 | int	 execlp(const char * __file, const char * __arg0, ...) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 444 | int	 execv(const char * __path, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 445 | int	 execve(const char * __file, char * const * __argv, char * const * __envp) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 446 | int	 execvp(const char * __file, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 447 | pid_t	 fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 448 | long	 fpathconf(int, int); | ||
| 449 | char	*getcwd(char *, size_t); | ||
| 450 | gid_t	 getegid(void); | ||
| 451 | uid_t	 geteuid(void); | ||
| 452 | gid_t	 getgid(void); | ||
| 453 | #if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE) | ||
| 454 | int	 getgroups(int, gid_t []) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(getgroups)); | ||
| 455 | #else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */ | ||
| 456 | int	 getgroups(int, gid_t []); | ||
| 457 | #endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */ | ||
| 458 | char	*getlogin(void); | ||
| 459 | pid_t	 getpgrp(void); | ||
| 460 | pid_t	 getpid(void); | ||
| 461 | pid_t	 getppid(void); | ||
| 462 | uid_t	 getuid(void); | ||
| 463 | int	 isatty(int); | ||
| 464 | int	 link(const char *, const char *); | ||
| 465 | off_t	 lseek(int, off_t, int); | ||
| 466 | long	 pathconf(const char *, int); | ||
| 467 | |||
| 468 | int	 pause(void) __DARWIN_ALIAS_C(pause); | ||
| 469 | |||
| 470 | int	 pipe(int [2]); | ||
| 471 | |||
| 472 | ssize_t	 read(int, void *, size_t) __DARWIN_ALIAS_C(read); | ||
| 473 | |||
| 474 | int	 rmdir(const char *); | ||
| 475 | int	 setgid(gid_t); | ||
| 476 | int	 setpgid(pid_t, pid_t); | ||
| 477 | pid_t	 setsid(void); | ||
| 478 | int	 setuid(uid_t); | ||
| 479 | |||
| 480 | unsigned int | ||
| 481 | 	 sleep(unsigned int) __DARWIN_ALIAS_C(sleep); | ||
| 482 | |||
| 483 | long	 sysconf(int); | ||
| 484 | pid_t	 tcgetpgrp(int); | ||
| 485 | int	 tcsetpgrp(int, pid_t); | ||
| 486 | char	*ttyname(int); | ||
| 487 | |||
| 488 | #if __DARWIN_UNIX03 | ||
| 489 | int	 ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r); | ||
| 490 | #else /* !__DARWIN_UNIX03 */ | ||
| 491 | char	*ttyname_r(int, char *, size_t); | ||
| 492 | #endif /* __DARWIN_UNIX03 */ | ||
| 493 | |||
| 494 | int	 unlink(const char *); | ||
| 495 | |||
| 496 | ssize_t	 write(int __fd, const void * __buf, size_t __nbyte) __DARWIN_ALIAS_C(write); | ||
| 497 | __END_DECLS | ||
| 498 | |||
| 499 | |||
| 500 | |||
| 501 | /* Additional functionality provided by: | ||
| 502 | * POSIX.2-1992 C Language Binding Option | ||
| 503 | */ | ||
| 504 | |||
| 505 | #if __DARWIN_C_LEVEL >= 199209L | ||
| 506 | __BEGIN_DECLS | ||
| 507 | size_t	 confstr(int, char *, size_t) __DARWIN_ALIAS(confstr); | ||
| 508 | |||
| 509 | int	 getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt); | ||
| 510 | |||
| 511 | extern char *optarg;			/* getopt(3) external variables */ | ||
| 512 | extern int optind, opterr, optopt; | ||
| 513 | __END_DECLS | ||
| 514 | #endif /* __DARWIN_C_LEVEL >= 199209L */ | ||
| 515 | |||
| 516 | |||
| 517 | |||
| 518 | /* Additional functionality provided by: | ||
| 519 | * POSIX.1c-1995, | ||
| 520 | * POSIX.1i-1995, | ||
| 521 | * and the omnibus ISO/IEC 9945-1: 1996 | ||
| 522 | */ | ||
| 523 | |||
| 524 | #if __DARWIN_C_LEVEL >= 199506L | ||
| 525 | #include <_ctermid.h> | ||
| 526 | /* These F_* are really XSI or Issue 6 */ | ||
| 527 | #define F_ULOCK 0 /* unlock locked section */ | ||
| 528 | #define	F_LOCK 1 /* lock a section for exclusive use */ | ||
| 529 | #define	F_TLOCK 2 /* test and lock a section for exclusive use */ | ||
| 530 | #define	F_TEST 3 /* test a section for locks by other procs */ | ||
| 531 | |||
| 532 | __BEGIN_DECLS | ||
| 533 | |||
| 534 | /* Begin XSI */ | ||
| 535 | /* Removed in Issue 6 */ | ||
| 536 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | ||
| 537 | #if !defined(_POSIX_C_SOURCE) | ||
| 538 | __deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 539 | #endif | ||
| 540 | void	*brk(const void *); | ||
| 541 | int	 chroot(const char *) __POSIX_C_DEPRECATED(199506L); | ||
| 542 | #endif | ||
| 543 | |||
| 544 | char	*crypt(const char *, const char *); | ||
| 545 | #if __DARWIN_UNIX03 | ||
| 546 | void	 encrypt(char *, int) __DARWIN_ALIAS(encrypt); | ||
| 547 | #else /* !__DARWIN_UNIX03 */ | ||
| 548 | int	 encrypt(char *, int); | ||
| 549 | #endif /* __DARWIN_UNIX03 */ | ||
| 550 | int	 fchdir(int); | ||
| 551 | long	 gethostid(void); | ||
| 552 | pid_t	 getpgid(pid_t); | ||
| 553 | pid_t	 getsid(pid_t); | ||
| 554 | |||
| 555 | /* Removed in Issue 6 */ | ||
| 556 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | ||
| 557 | int	 getdtablesize(void) __POSIX_C_DEPRECATED(199506L); | ||
| 558 | int	 getpagesize(void) __pure2 __POSIX_C_DEPRECATED(199506L); | ||
| 559 | char	*getpass(const char *) __POSIX_C_DEPRECATED(199506L); | ||
| 560 | #endif | ||
| 561 | |||
| 562 | /* Removed in Issue 7 */ | ||
| 563 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L | ||
| 564 | char	*getwd(char *) __POSIX_C_DEPRECATED(200112L); /* obsoleted by getcwd() */ | ||
| 565 | #endif | ||
| 566 | |||
| 567 | int	 lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown); | ||
| 568 | |||
| 569 | int	 lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf); | ||
| 570 | |||
| 571 | int	 nice(int) __DARWIN_ALIAS(nice); | ||
| 572 | |||
| 573 | ssize_t	 pread(int __fd, void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pread); | ||
| 574 | |||
| 575 | ssize_t	 pwrite(int __fd, const void * __buf, size_t __nbyte, off_t __offset) __DARWIN_ALIAS_C(pwrite); | ||
| 576 | |||
| 577 | /* Removed in Issue 6 */ | ||
| 578 | #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L | ||
| 579 | /* Note that Issue 5 changed the argument as intprt_t, | ||
| 580 | * but we keep it as int for binary compatability. */ | ||
| 581 | #if !defined(_POSIX_C_SOURCE) | ||
| 582 | __deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 583 | #endif | ||
| 584 | void	*sbrk(int); | ||
| 585 | #endif | ||
| 586 | |||
| 587 | #if __DARWIN_UNIX03 | ||
| 588 | pid_t	 setpgrp(void) __DARWIN_ALIAS(setpgrp); | ||
| 589 | #else /* !__DARWIN_UNIX03 */ | ||
| 590 | int	 setpgrp(pid_t pid, pid_t pgrp);	/* obsoleted by setpgid() */ | ||
| 591 | #endif /* __DARWIN_UNIX03 */ | ||
| 592 | |||
| 593 | int	 setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid); | ||
| 594 | |||
| 595 | int	 setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid); | ||
| 596 | |||
| 597 | void swab(const void * __restrict, void * __restrict, ssize_t); | ||
| 598 | void	 sync(void); | ||
| 599 | int	 truncate(const char *, off_t); | ||
| 600 | useconds_t	 ualarm(useconds_t, useconds_t); | ||
| 601 | int	 usleep(useconds_t) __DARWIN_ALIAS_C(usleep); | ||
| 602 | |||
| 603 | #if !defined(_POSIX_C_SOURCE) | ||
| 604 | __deprecated_msg("Use posix_spawn or fork") | ||
| 605 | #endif | ||
| 606 | pid_t	 vfork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 607 | /* End XSI */ | ||
| 608 | |||
| 609 | int	 fsync(int) __DARWIN_ALIAS_C(fsync); | ||
| 610 | |||
| 611 | int	 ftruncate(int, off_t); | ||
| 612 | int	 getlogin_r(char *, size_t); | ||
| 613 | __END_DECLS | ||
| 614 | #endif /* __DARWIN_C_LEVEL >= 199506L */ | ||
| 615 | |||
| 616 | |||
| 617 | |||
| 618 | /* Additional functionality provided by: | ||
| 619 | * POSIX.1-2001 | ||
| 620 | * ISO C99 | ||
| 621 | */ | ||
| 622 | |||
| 623 | #if __DARWIN_C_LEVEL >= 200112L | ||
| 624 | __BEGIN_DECLS | ||
| 625 | int	 fchown(int, uid_t, gid_t); | ||
| 626 | int	 gethostname(char *, size_t); | ||
| 627 | ssize_t readlink(const char * __restrict, char * __restrict, size_t); | ||
| 628 | int	 setegid(gid_t); | ||
| 629 | int	 seteuid(uid_t); | ||
| 630 | int	 symlink(const char *, const char *); | ||
| 631 | __END_DECLS | ||
| 632 | #endif /* __DARWIN_C_LEVEL >= 200112L */ | ||
| 633 | |||
| 634 | |||
| 635 | |||
| 636 | /* Darwin extensions */ | ||
| 637 | |||
| 638 | #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL | ||
| 639 | #include <sys/select.h> | ||
| 640 | |||
| 641 | #include <sys/_types/_dev_t.h> | ||
| 642 | #include <sys/_types/_mode_t.h> | ||
| 643 | #include <sys/_types/_uuid_t.h> | ||
| 644 | |||
| 645 | __BEGIN_DECLS | ||
| 646 | void	 _Exit(int) __dead2; | ||
| 647 | int	 accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t); | ||
| 648 | int	 acct(const char *); | ||
| 649 | int	 add_profil(char *, size_t, unsigned long, unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 650 | void	 endusershell(void); | ||
| 651 | int	 execvP(const char * __file, const char * __searchpath, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 652 | char	*fflagstostr(unsigned long); | ||
| 653 | int	 getdomainname(char *, int); | ||
| 654 | int	 getgrouplist(const char *, int, int *, int *); | ||
| 655 | #if defined(__has_include) | ||
| 656 | #if __has_include(<gethostuuid_private.h>) | ||
| 657 | #include <gethostuuid_private.h> | ||
| 658 | #else | ||
| 659 | #include <gethostuuid.h> | ||
| 660 | #endif | ||
| 661 | #else | ||
| 662 | #include <gethostuuid.h> | ||
| 663 | #endif | ||
| 664 | mode_t	 getmode(const void *, mode_t); | ||
| 665 | int	 getpeereid(int, uid_t *, gid_t *); | ||
| 666 | int	 getsgroups_np(int *, uuid_t); | ||
| 667 | char	*getusershell(void); | ||
| 668 | int	 getwgroups_np(int *, uuid_t); | ||
| 669 | int	 initgroups(const char *, int); | ||
| 670 | int	 issetugid(void); | ||
| 671 | char	*mkdtemp(char *); | ||
| 672 | int	 mknod(const char *, mode_t, dev_t); | ||
| 673 | int	 mkpath_np(const char *path, mode_t omode) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_0); /* returns errno */ | ||
| 674 | int	 mkpathat_np(int dfd, const char *path, mode_t omode) /* returns errno */ | ||
| 675 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 676 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 677 | int	 mkstemp(char *); | ||
| 678 | int	 mkstemps(char *, int); | ||
| 679 | char	*mktemp(char *); | ||
| 680 | int	 mkostemp(char *path, int oflags) | ||
| 681 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 682 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 683 | int	 mkostemps(char *path, int slen, int oflags) | ||
| 684 | 		__OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) | ||
| 685 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 686 | /* Non-portable mkstemp that uses open_dprotected_np */ | ||
| 687 | int	 mkstemp_dprotected_np(char *path, int dpclass, int dpflags) | ||
| 688 | 		__OSX_UNAVAILABLE __IOS_AVAILABLE(10.0) | ||
| 689 | 		__TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0); | ||
| 690 | char *mkdtempat_np(int dfd, char *path) | ||
| 691 | 		__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 692 | 		__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 693 | int mkstempsat_np(int dfd, char *path, int slen) | ||
| 694 | 		__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 695 | 		__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 696 | int mkostempsat_np(int dfd, char *path, int slen, int oflags) | ||
| 697 | 		__OSX_AVAILABLE(10.13) __IOS_AVAILABLE(11.0) | ||
| 698 | 		__TVOS_AVAILABLE(11.0) __WATCHOS_AVAILABLE(4.0); | ||
| 699 | int	 nfssvc(int, void *); | ||
| 700 | int	 profil(char *, size_t, unsigned long, unsigned int); | ||
| 701 | |||
| 702 | __deprecated_msg("Use of per-thread security contexts is error-prone and discouraged.") | ||
| 703 | int	 pthread_setugid_np(uid_t, gid_t); | ||
| 704 | int	 pthread_getugid_np( uid_t *, gid_t *); | ||
| 705 | |||
| 706 | int	 reboot(int); | ||
| 707 | int	 revoke(const char *); | ||
| 708 | |||
| 709 | __deprecated int	 rcmd(char **, int, const char *, const char *, const char *, int *); | ||
| 710 | __deprecated int	 rcmd_af(char **, int, const char *, const char *, const char *, int *, | ||
| 711 | 		int); | ||
| 712 | __deprecated int	 rresvport(int *); | ||
| 713 | __deprecated int	 rresvport_af(int *, int); | ||
| 714 | __deprecated int	 iruserok(unsigned long, int, const char *, const char *); | ||
| 715 | __deprecated int	 iruserok_sa(const void *, int, int, const char *, const char *); | ||
| 716 | __deprecated int	 ruserok(const char *, int, const char *, const char *); | ||
| 717 | |||
| 718 | int	 setdomainname(const char *, int); | ||
| 719 | int	 setgroups(int, const gid_t *); | ||
| 720 | void	 sethostid(long); | ||
| 721 | int	 sethostname(const char *, int); | ||
| 722 | #if __DARWIN_UNIX03 | ||
| 723 | void	 setkey(const char *) __DARWIN_ALIAS(setkey); | ||
| 724 | #else /* !__DARWIN_UNIX03 */ | ||
| 725 | int	 setkey(const char *); | ||
| 726 | #endif /* __DARWIN_UNIX03 */ | ||
| 727 | int	 setlogin(const char *); | ||
| 728 | void	*setmode(const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(setmode)); | ||
| 729 | int	 setrgid(gid_t); | ||
| 730 | int	 setruid(uid_t); | ||
| 731 | int	 setsgroups_np(int, const uuid_t); | ||
| 732 | void	 setusershell(void); | ||
| 733 | int	 setwgroups_np(int, const uuid_t); | ||
| 734 | int	 strtofflags(char **, unsigned long *, unsigned long *); | ||
| 735 | int	 swapon(const char *); | ||
| 736 | int	 ttyslot(void); | ||
| 737 | int	 undelete(const char *); | ||
| 738 | int	 unwhiteout(const char *); | ||
| 739 | void	*valloc(size_t);			 | ||
| 740 | |||
| 741 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | ||
| 742 | __OS_AVAILABILITY_MSG(ios,deprecated=10.0,"syscall(2) is unsupported; " | ||
| 743 | "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().") | ||
| 744 | __OS_AVAILABILITY_MSG(macosx,deprecated=10.12,"syscall(2) is unsupported; " | ||
| 745 | "please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost().") | ||
| 746 | int	 syscall(int, ...); | ||
| 747 | |||
| 748 | extern char *suboptarg;			/* getsubopt(3) external variable */ | ||
| 749 | int	 getsubopt(char **, char * const *, char **); | ||
| 750 | |||
| 751 | /* HFS & HFS Plus semantics system calls go here */ | ||
| 752 | #ifdef __LP64__ | ||
| 753 | int fgetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 754 | int fsetattrlist(int,void*,void*,size_t,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 755 | int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist); | ||
| 756 | int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist); | ||
| 757 | int exchangedata(const char*,const char*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 758 | int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 759 | |||
| 760 | #else /* __LP64__ */ | ||
| 761 | int	fgetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 762 | int	fsetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 763 | int	getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist); | ||
| 764 | int	setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist); | ||
| 765 | int exchangedata(const char*,const char*,unsigned long) | ||
| 766 | 		__OSX_DEPRECATED(10.0, 10.13, "use renamex_np with the RENAME_SWAP flag") | ||
| 767 | 		__IOS_DEPRECATED(2.0, 11.0, "use renamex_np with the RENAME_SWAP flag") | ||
| 768 | 		__WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 769 | int	getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 770 | |||
| 771 | #endif /* __LP64__ */ | ||
| 772 | |||
| 773 | struct fssearchblock; | ||
| 774 | struct searchstate; | ||
| 775 | |||
| 776 | int	 searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *) __WATCHOS_PROHIBITED __TVOS_PROHIBITED; | ||
| 777 | int	 fsctl(const char *,unsigned long,void*,unsigned int); | ||
| 778 | int	 ffsctl(int,unsigned long,void*,unsigned int) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0); | ||
| 779 | |||
| 780 | #define	SYNC_VOLUME_FULLSYNC	0x01	/* Flush data and metadata to platter, not just to disk cache */ | ||
| 781 | #define SYNC_VOLUME_WAIT	0x02	/* Wait for sync to complete */ | ||
| 782 | |||
| 783 | int	fsync_volume_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 784 | int	sync_volume_np(const char *, int) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); | ||
| 785 | |||
| 786 | extern int optreset; | ||
| 787 | |||
| 788 | __END_DECLS | ||
| 789 | #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ | ||
| 790 | |||
| 791 | #endif /* _UNISTD_H_ */ | ||
| \ No newline at end of file | |||
lib/libc/include/any-macos.13-any/xpc/availability.h created+134| ... | @@ -0,0 +1,134 @@ | ||
| 1 | #ifndef __XPC_AVAILABILITY_H__ | ||
| 2 | #define __XPC_AVAILABILITY_H__ | ||
| 3 | |||
| 4 | #include <Availability.h> | ||
| 5 | |||
| 6 | // Certain parts of the project use all the project's headers but have to build | ||
| 7 | // against newer OSX SDKs than ebuild uses -- liblaunch_host being the example. | ||
| 8 | // So we need to define these. | ||
| 9 | #ifndef __MAC_10_16 | ||
| 10 | #define __MAC_10_16 101600 | ||
| 11 | #endif // __MAC_10_16 | ||
| 12 | |||
| 13 | #ifndef __MAC_10_15 | ||
| 14 | #define __MAC_10_15 101500 | ||
| 15 | #define __AVAILABILITY_INTERNAL__MAC_10_15 \ | ||
| 16 | __attribute__((availability(macosx, introduced=10.15))) | ||
| 17 | #endif // __MAC_10_15 | ||
| 18 | |||
| 19 | #ifndef __MAC_10_14 | ||
| 20 | #define __MAC_10_14 101400 | ||
| 21 | #define __AVAILABILITY_INTERNAL__MAC_10_14 \ | ||
| 22 | __attribute__((availability(macosx, introduced=10.14))) | ||
| 23 | #endif // __MAC_10_14 | ||
| 24 | |||
| 25 | #ifndef __MAC_10_13 | ||
| 26 | #define __MAC_10_13 101300 | ||
| 27 | #define __AVAILABILITY_INTERNAL__MAC_10_13 \ | ||
| 28 | 	__attribute__((availability(macosx, introduced=10.13))) | ||
| 29 | #endif // __MAC_10_13 | ||
| 30 | |||
| 31 | #ifndef __MAC_10_12 | ||
| 32 | #define __MAC_10_12 101200 | ||
| 33 | #define __AVAILABILITY_INTERNAL__MAC_10_12 \ | ||
| 34 | 	__attribute__((availability(macosx, introduced=10.12))) | ||
| 35 | #endif // __MAC_10_12 | ||
| 36 | |||
| 37 | #ifndef __MAC_10_11 | ||
| 38 | #define __MAC_10_11 101100 | ||
| 39 | #define __AVAILABILITY_INTERNAL__MAC_10_11 \ | ||
| 40 | 	__attribute__((availability(macosx, introduced=10.11))) | ||
| 41 | #endif // __MAC_10_11 | ||
| 42 | |||
| 43 | #ifndef __MAC_12_0 | ||
| 44 | #define __MAC_12_0 120000 | ||
| 45 | #define __AVAILABILITY_INTERNAL__MAC_12_0 \ | ||
| 46 | 	__attribute__((availability(macosx, introduced=12.0))) | ||
| 47 | #endif // __MAC_12_0 | ||
| 48 | |||
| 49 | #ifndef __MAC_13_3 | ||
| 50 | #define __MAC_13_3 130300 | ||
| 51 | #endif // __MAC_13_3 | ||
| 52 | |||
| 53 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 | ||
| 54 | #define __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 | ||
| 55 | #endif // __AVAILABILITY_INTERNAL__MAC_10_2_DEP__MAC_10_11 | ||
| 56 | |||
| 57 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 | ||
| 58 | #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 | ||
| 59 | #endif // __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_11 | ||
| 60 | |||
| 61 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 | ||
| 62 | #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 | ||
| 63 | #endif // __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_11 | ||
| 64 | |||
| 65 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 | ||
| 66 | #define __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 | ||
| 67 | #endif // __AVAILABILITY_INTERNAL__MAC_10_5_DEP__MAC_10_11 | ||
| 68 | |||
| 69 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 | ||
| 70 | #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 | ||
| 71 | #endif // __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_11 | ||
| 72 | |||
| 73 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 | ||
| 74 | #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 | ||
| 75 | #endif // __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_11 | ||
| 76 | |||
| 77 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 | ||
| 78 | #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 | ||
| 79 | #endif // __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_11 | ||
| 80 | |||
| 81 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 | ||
| 82 | #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 | ||
| 83 | #endif // __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_11 | ||
| 84 | |||
| 85 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 | ||
| 86 | #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 | ||
| 87 | #endif // __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_11 | ||
| 88 | |||
| 89 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 | ||
| 90 | #define __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 | ||
| 91 | #endif // __AVAILABILITY_INTERNAL__MAC_10_11_DEP__MAC_10_11 | ||
| 92 | |||
| 93 | #ifndef __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 | ||
| 94 | #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 | ||
| 95 | #endif // __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_13 | ||
| 96 | |||
| 97 | #if __has_include(<simulator_host.h>) | ||
| 98 | #include <simulator_host.h> | ||
| 99 | #else // __has_include(<simulator_host.h>) | ||
| 100 | #ifndef IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED | ||
| 101 | #define IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED 999999 | ||
| 102 | #endif // IPHONE_SIMULATOR_HOST_MIN_VERSION_REQUIRED | ||
| 103 | #endif // __has_include(<simulator_host.h>) | ||
| 104 | |||
| 105 | #ifndef __WATCHOS_UNAVAILABLE | ||
| 106 | #define __WATCHOS_UNAVAILABLE | ||
| 107 | #endif | ||
| 108 | |||
| 109 | #ifndef __TVOS_UNAVAILABLE | ||
| 110 | #define __TVOS_UNAVAILABLE | ||
| 111 | #endif | ||
| 112 | |||
| 113 | // simulator host-side bits build against SDKs not having __*_AVAILABLE() yet | ||
| 114 | #ifndef __OSX_AVAILABLE | ||
| 115 | #define __OSX_AVAILABLE(...) | ||
| 116 | #endif | ||
| 117 | |||
| 118 | #ifndef __IOS_AVAILABLE | ||
| 119 | #define __IOS_AVAILABLE(...) | ||
| 120 | #endif | ||
| 121 | |||
| 122 | #ifndef __TVOS_AVAILABLE | ||
| 123 | #define __TVOS_AVAILABLE(...) | ||
| 124 | #endif | ||
| 125 | |||
| 126 | #ifndef __WATCHOS_AVAILABLE | ||
| 127 | #define __WATCHOS_AVAILABLE(...) | ||
| 128 | #endif | ||
| 129 | |||
| 130 | #ifndef __API_AVAILABLE | ||
| 131 | #define __API_AVAILABLE(...) | ||
| 132 | #endif | ||
| 133 | |||
| 134 | #endif // __XPC_AVAILABILITY_H__ | ||
| \ No newline at end of file | |||
lib/libc/include/x86_64-macos.13-none/mach/i386/thread_status.h+6| ... | @@ -132,6 +132,12 @@ | ... | @@ -132,6 +132,12 @@ |
| 132 | */ | 132 | */ |
| 133 | #define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX | 133 | #define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX |
| 134 | 134 | ||
| 135 | #define FLAVOR_MODIFIES_CORE_CPU_REGISTERS(x) \ | ||
| 136 | ((x == x86_THREAD_STATE) || \ | ||
| 137 | (x == x86_THREAD_STATE32) || \ | ||
| 138 | (x == x86_THREAD_STATE64) || \ | ||
| 139 | (x == x86_THREAD_FULL_STATE64)) | ||
| 140 | |||
| 135 | /* | 141 | /* |
| 136 | * VALID_THREAD_STATE_FLAVOR is a platform specific macro that when passed | 142 | * VALID_THREAD_STATE_FLAVOR is a platform specific macro that when passed |
| 137 | * an exception flavor will return if that is a defined flavor for that | 143 | * an exception flavor will return if that is a defined flavor for that |
lib/std/target.zig+2-2| ... | @@ -280,13 +280,13 @@ pub const Target = struct { | ... | @@ -280,13 +280,13 @@ pub const Target = struct { |
| 280 | .aarch64 => VersionRange{ | 280 | .aarch64 => VersionRange{ |
| 281 | .semver = .{ | 281 | .semver = .{ |
| 282 | .min = .{ .major = 11, .minor = 7, .patch = 1 }, | 282 | .min = .{ .major = 11, .minor = 7, .patch = 1 }, |
| 283 | .max = .{ .major = 13, .minor = 0 }, | 283 | .max = .{ .major = 13, .minor = 3 }, |
| 284 | }, | 284 | }, |
| 285 | }, | 285 | }, |
| 286 | .x86_64 => VersionRange{ | 286 | .x86_64 => VersionRange{ |
| 287 | .semver = .{ | 287 | .semver = .{ |
| 288 | .min = .{ .major = 11, .minor = 7, .patch = 1 }, | 288 | .min = .{ .major = 11, .minor = 7, .patch = 1 }, |
| 289 | .max = .{ .major = 13, .minor = 0 }, | 289 | .max = .{ .major = 13, .minor = 3 }, |
| 290 | }, | 290 | }, |
| 291 | }, | 291 | }, |
| 292 | else => unreachable, | 292 | else => unreachable, |