1 /* 2 * Hunt - A refined core library for D programming language. 3 * 4 * Copyright (C) 2018-2019 HuntLabs 5 * 6 * Website: https://www.huntlabs.net/ 7 * 8 * Licensed under the Apache-2.0 License. 9 * 10 */ 11 12 module hunt.system.syscall.os.OSX; 13 14 version(OSX): 15 16 enum SYS_syscall = 0; 17 enum SYS_exit = 1; 18 enum SYS_fork = 2; 19 enum SYS_read = 3; 20 enum SYS_write = 4; 21 enum SYS_open = 5; 22 enum SYS_close = 6; 23 enum SYS_wait4 = 7; 24 /* 8 old creat */ 25 enum SYS_link = 9; 26 enum SYS_unlink = 10; 27 /* 11 old execv */ 28 enum SYS_chdir = 12; 29 enum SYS_fchdir = 13; 30 enum SYS_mknod = 14; 31 enum SYS_chmod = 15; 32 enum SYS_chown = 16; 33 /* 17 old break */ 34 enum SYS_getfsstat = 18; 35 /* 19 old lseek */ 36 enum SYS_getpid = 20; 37 /* 21 old mount */ 38 /* 22 old umount */ 39 enum SYS_setuid = 23; 40 enum SYS_getuid = 24; 41 enum SYS_geteuid = 25; 42 enum SYS_ptrace = 26; 43 enum SYS_recvmsg = 27; 44 enum SYS_sendmsg = 28; 45 enum SYS_recvfrom = 29; 46 enum SYS_accept = 30; 47 enum SYS_getpeername = 31; 48 enum SYS_getsockname = 32; 49 enum SYS_access = 33; 50 enum SYS_chflags = 34; 51 enum SYS_fchflags = 35; 52 enum SYS_sync = 36; 53 enum SYS_kill = 37; 54 /* 38 old stat */ 55 enum SYS_getppid = 39; 56 /* 40 old lstat */ 57 enum SYS_dup = 41; 58 enum SYS_pipe = 42; 59 enum SYS_getegid = 43; 60 /* 44 old profil */ 61 /* 45 old ktrace */ 62 enum SYS_sigaction = 46; 63 enum SYS_getgid = 47; 64 enum SYS_sigprocmask = 48; 65 enum SYS_getlogin = 49; 66 enum SYS_setlogin = 50; 67 enum SYS_acct = 51; 68 enum SYS_sigpending = 52; 69 enum SYS_sigaltstack = 53; 70 enum SYS_ioctl = 54; 71 enum SYS_reboot = 55; 72 enum SYS_revoke = 56; 73 enum SYS_symlink = 57; 74 enum SYS_readlink = 58; 75 enum SYS_execve = 59; 76 enum SYS_umask = 60; 77 enum SYS_chroot = 61; 78 /* 62 old fstat */ 79 /* 63 used internally and reserved */ 80 /* 64 old getpagesize */ 81 enum SYS_msync = 65; 82 enum SYS_vfork = 66; 83 /* 67 old vread */ 84 /* 68 old vwrite */ 85 /* 69 old sbrk */ 86 /* 70 old sstk */ 87 /* 71 old mmap */ 88 /* 72 old vadvise */ 89 enum SYS_munmap = 73; 90 enum SYS_mprotect = 74; 91 enum SYS_madvise = 75; 92 /* 76 old vhangup */ 93 /* 77 old vlimit */ 94 enum SYS_mincore = 78; 95 enum SYS_getgroups = 79; 96 enum SYS_setgroups = 80; 97 enum SYS_getpgrp = 81; 98 enum SYS_setpgid = 82; 99 enum SYS_setitimer = 83; 100 /* 84 old wait */ 101 enum SYS_swapon = 85; 102 enum SYS_getitimer = 86; 103 /* 87 old gethostname */ 104 /* 88 old sethostname */ 105 enum SYS_getdtablesize = 89; 106 enum SYS_dup2 = 90; 107 /* 91 old getdopt */ 108 enum SYS_fcntl = 92; 109 enum SYS_select = 93; 110 /* 94 old setdopt */ 111 enum SYS_fsync = 95; 112 enum SYS_setpriority = 96; 113 enum SYS_socket = 97; 114 enum SYS_connect = 98; 115 /* 99 old accept */ 116 enum SYS_getpriority = 100; 117 /* 101 old send */ 118 /* 102 old recv */ 119 /* 103 old sigreturn */ 120 enum SYS_bind = 104; 121 enum SYS_setsockopt = 105; 122 enum SYS_listen = 106; 123 /* 107 old vtimes */ 124 /* 108 old sigvec */ 125 /* 109 old sigblock */ 126 /* 110 old sigsetmask */ 127 enum SYS_sigsuspend = 111; 128 /* 112 old sigstack */ 129 /* 113 old recvmsg */ 130 /* 114 old sendmsg */ 131 /* 115 old vtrace */ 132 enum SYS_gettimeofday = 116; 133 enum SYS_getrusage = 117; 134 enum SYS_getsockopt = 118; 135 /* 119 old resuba */ 136 enum SYS_readv = 120; 137 enum SYS_writev = 121; 138 enum SYS_settimeofday = 122; 139 enum SYS_fchown = 123; 140 enum SYS_fchmod = 124; 141 /* 125 old recvfrom */ 142 enum SYS_setreuid = 126; 143 enum SYS_setregid = 127; 144 enum SYS_rename = 128; 145 /* 129 old truncate */ 146 /* 130 old ftruncate */ 147 enum SYS_flock = 131; 148 enum SYS_mkfifo = 132; 149 enum SYS_sendto = 133; 150 enum SYS_shutdown = 134; 151 enum SYS_socketpair = 135; 152 enum SYS_mkdir = 136; 153 enum SYS_rmdir = 137; 154 enum SYS_utimes = 138; 155 enum SYS_futimes = 139; 156 enum SYS_adjtime = 140; 157 /* 141 old getpeername */ 158 enum SYS_gethostuuid = 142; 159 /* 143 old sethostid */ 160 /* 144 old getrlimit */ 161 /* 145 old setrlimit */ 162 /* 146 old killpg */ 163 enum SYS_setsid = 147; 164 /* 148 old setquota */ 165 /* 149 old qquota */ 166 /* 150 old getsockname */ 167 enum SYS_getpgid = 151; 168 enum SYS_setprivexec = 152; 169 enum SYS_pread = 153; 170 enum SYS_pwrite = 154; 171 enum SYS_nfssvc = 155; 172 /* 156 old getdirentries */ 173 enum SYS_statfs = 157; 174 enum SYS_fstatfs = 158; 175 enum SYS_unmount = 159; 176 /* 160 old async_daemon */ 177 enum SYS_getfh = 161; 178 /* 162 old getdomainname */ 179 /* 163 old setdomainname */ 180 /* 164 */ 181 enum SYS_quotactl = 165; 182 /* 166 old exportfs */ 183 enum SYS_mount = 167; 184 /* 168 old ustat */ 185 enum SYS_csops = 169; 186 enum SYS_csops_audittoken = 170; 187 /* 171 old wait3 */ 188 /* 172 old rpause */ 189 enum SYS_waitid = 173; 190 /* 174 old getdents */ 191 /* 175 old gc_control */ 192 /* 176 old add_profil */ 193 enum SYS_kdebug_typefilter = 177; 194 enum SYS_kdebug_trace_string = 178; 195 enum SYS_kdebug_trace64 = 179; 196 enum SYS_kdebug_trace = 180; 197 enum SYS_setgid = 181; 198 enum SYS_setegid = 182; 199 enum SYS_seteuid = 183; 200 enum SYS_sigreturn = 184; 201 /* 185 old chud */ 202 enum SYS_thread_selfcounts = 186; 203 enum SYS_fdatasync = 187; 204 enum SYS_stat = 188; 205 enum SYS_fstat = 189; 206 enum SYS_lstat = 190; 207 enum SYS_pathconf = 191; 208 enum SYS_fpathconf = 192; 209 /* 193 old getfsstat */ 210 enum SYS_getrlimit = 194; 211 enum SYS_setrlimit = 195; 212 enum SYS_getdirentries = 196; 213 enum SYS_mmap = 197; 214 /* 198 old __syscall */ 215 enum SYS_lseek = 199; 216 enum SYS_truncate = 200; 217 enum SYS_ftruncate = 201; 218 enum SYS_sysctl = 202; 219 enum SYS_mlock = 203; 220 enum SYS_munlock = 204; 221 enum SYS_undelete = 205; 222 /* 206 old ATsocket */ 223 /* 207 old ATgetmsg */ 224 /* 208 old ATputmsg */ 225 /* 209 old ATsndreq */ 226 /* 210 old ATsndrsp */ 227 /* 211 old ATgetreq */ 228 /* 212 old ATgetrsp */ 229 /* 213 Reserved for AppleTalk */ 230 /* 214 */ 231 /* 215 */ 232 enum SYS_open_dprotected_np = 216; 233 /* 217 old statv */ 234 /* 218 old lstatv */ 235 /* 219 old fstatv */ 236 enum SYS_getattrlist = 220; 237 enum SYS_setattrlist = 221; 238 enum SYS_getdirentriesattr = 222; 239 enum SYS_exchangedata = 223; 240 /* 224 old checkuseraccess or fsgetpath */ 241 enum SYS_searchfs = 225; 242 enum SYS_delete = 226; 243 enum SYS_copyfile = 227; 244 enum SYS_fgetattrlist = 228; 245 enum SYS_fsetattrlist = 229; 246 enum SYS_poll = 230; 247 enum SYS_watchevent = 231; 248 enum SYS_waitevent = 232; 249 enum SYS_modwatch = 233; 250 enum SYS_getxattr = 234; 251 enum SYS_fgetxattr = 235; 252 enum SYS_setxattr = 236; 253 enum SYS_fsetxattr = 237; 254 enum SYS_removexattr = 238; 255 enum SYS_fremovexattr = 239; 256 enum SYS_listxattr = 240; 257 enum SYS_flistxattr = 241; 258 enum SYS_fsctl = 242; 259 enum SYS_initgroups = 243; 260 enum SYS_posix_spawn = 244; 261 enum SYS_ffsctl = 245; 262 /* 246 */ 263 enum SYS_nfsclnt = 247; 264 enum SYS_fhopen = 248; 265 /* 249 */ 266 enum SYS_minherit = 250; 267 enum SYS_semsys = 251; 268 enum SYS_msgsys = 252; 269 enum SYS_shmsys = 253; 270 enum SYS_semctl = 254; 271 enum SYS_semget = 255; 272 enum SYS_semop = 256; 273 /* 257 old semconfig */ 274 enum SYS_msgctl = 258; 275 enum SYS_msgget = 259; 276 enum SYS_msgsnd = 260; 277 enum SYS_msgrcv = 261; 278 enum SYS_shmat = 262; 279 enum SYS_shmctl = 263; 280 enum SYS_shmdt = 264; 281 enum SYS_shmget = 265; 282 enum SYS_shm_open = 266; 283 enum SYS_shm_unlink = 267; 284 enum SYS_sem_open = 268; 285 enum SYS_sem_close = 269; 286 enum SYS_sem_unlink = 270; 287 enum SYS_sem_wait = 271; 288 enum SYS_sem_trywait = 272; 289 enum SYS_sem_post = 273; 290 enum SYS_sysctlbyname = 274; 291 /* 275 old sem_init */ 292 /* 276 old sem_destroy */ 293 enum SYS_open_extended = 277; 294 enum SYS_umask_extended = 278; 295 enum SYS_stat_extended = 279; 296 enum SYS_lstat_extended = 280; 297 enum SYS_fstat_extended = 281; 298 enum SYS_chmod_extended = 282; 299 enum SYS_fchmod_extended = 283; 300 enum SYS_access_extended = 284; 301 enum SYS_settid = 285; 302 enum SYS_gettid = 286; 303 enum SYS_setsgroups = 287; 304 enum SYS_getsgroups = 288; 305 enum SYS_setwgroups = 289; 306 enum SYS_getwgroups = 290; 307 enum SYS_mkfifo_extended = 291; 308 enum SYS_mkdir_extended = 292; 309 enum SYS_identitysvc = 293; 310 enum SYS_shared_region_check_np = 294; 311 /* 295 old shared_region_map_np */ 312 enum SYS_vm_pressure_monitor = 296; 313 enum SYS_psynch_rw_longrdlock = 297; 314 enum SYS_psynch_rw_yieldwrlock = 298; 315 enum SYS_psynch_rw_downgrade = 299; 316 enum SYS_psynch_rw_upgrade = 300; 317 enum SYS_psynch_mutexwait = 301; 318 enum SYS_psynch_mutexdrop = 302; 319 enum SYS_psynch_cvbroad = 303; 320 enum SYS_psynch_cvsignal = 304; 321 enum SYS_psynch_cvwait = 305; 322 enum SYS_psynch_rw_rdlock = 306; 323 enum SYS_psynch_rw_wrlock = 307; 324 enum SYS_psynch_rw_unlock = 308; 325 enum SYS_psynch_rw_unlock2 = 309; 326 enum SYS_getsid = 310; 327 enum SYS_settid_with_pid = 311; 328 enum SYS_psynch_cvclrprepost = 312; 329 enum SYS_aio_fsync = 313; 330 enum SYS_aio_return = 314; 331 enum SYS_aio_suspend = 315; 332 enum SYS_aio_cancel = 316; 333 enum SYS_aio_error = 317; 334 enum SYS_aio_read = 318; 335 enum SYS_aio_write = 319; 336 enum SYS_lio_listio = 320; 337 /* 321 old __pthread_cond_wait */ 338 enum SYS_iopolicysys = 322; 339 enum SYS_process_policy = 323; 340 enum SYS_mlockall = 324; 341 enum SYS_munlockall = 325; 342 /* 326 */ 343 enum SYS_issetugid = 327; 344 enum SYS___pthread_kill = 328; 345 enum SYS___pthread_sigmask = 329; 346 enum SYS___sigwait = 330; 347 enum SYS___disable_threadsignal = 331; 348 enum SYS___pthread_markcancel = 332; 349 enum SYS___pthread_canceled = 333; 350 enum SYS___semwait_signal = 334; 351 /* 335 old utrace */ 352 enum SYS_proc_info = 336; 353 enum SYS_sendfile = 337; 354 enum SYS_stat64 = 338; 355 enum SYS_fstat64 = 339; 356 enum SYS_lstat64 = 340; 357 enum SYS_stat64_extended = 341; 358 enum SYS_lstat64_extended = 342; 359 enum SYS_fstat64_extended = 343; 360 enum SYS_getdirentries64 = 344; 361 enum SYS_statfs64 = 345; 362 enum SYS_fstatfs64 = 346; 363 enum SYS_getfsstat64 = 347; 364 enum SYS___pthread_chdir = 348; 365 enum SYS___pthread_fchdir = 349; 366 enum SYS_audit = 350; 367 enum SYS_auditon = 351; 368 /* 352 */ 369 enum SYS_getauid = 353; 370 enum SYS_setauid = 354; 371 /* 355 old getaudit */ 372 /* 356 old setaudit */ 373 enum SYS_getaudit_addr = 357; 374 enum SYS_setaudit_addr = 358; 375 enum SYS_auditctl = 359; 376 enum SYS_bsdthread_create = 360; 377 enum SYS_bsdthread_terminate = 361; 378 enum SYS_kqueue = 362; 379 enum SYS_kevent = 363; 380 enum SYS_lchown = 364; 381 /* 365 old stack_snapshot */ 382 enum SYS_bsdthread_register = 366; 383 enum SYS_workq_open = 367; 384 enum SYS_workq_kernreturn = 368; 385 enum SYS_kevent64 = 369; 386 enum SYS___old_semwait_signal = 370; 387 enum SYS___old_semwait_signal_nocancel = 371; 388 enum SYS_thread_selfid = 372; 389 enum SYS_ledger = 373; 390 enum SYS_kevent_qos = 374; 391 enum SYS_kevent_id = 375; 392 /* 376 */ 393 /* 377 */ 394 /* 378 */ 395 /* 379 */ 396 enum SYS___mac_execve = 380; 397 enum SYS___mac_syscall = 381; 398 enum SYS___mac_get_file = 382; 399 enum SYS___mac_set_file = 383; 400 enum SYS___mac_get_link = 384; 401 enum SYS___mac_set_link = 385; 402 enum SYS___mac_get_proc = 386; 403 enum SYS___mac_set_proc = 387; 404 enum SYS___mac_get_fd = 388; 405 enum SYS___mac_set_fd = 389; 406 enum SYS___mac_get_pid = 390; 407 /* 391 */ 408 /* 392 */ 409 /* 393 */ 410 enum SYS_pselect = 394; 411 enum SYS_pselect_nocancel = 395; 412 enum SYS_read_nocancel = 396; 413 enum SYS_write_nocancel = 397; 414 enum SYS_open_nocancel = 398; 415 enum SYS_close_nocancel = 399; 416 enum SYS_wait4_nocancel = 400; 417 enum SYS_recvmsg_nocancel = 401; 418 enum SYS_sendmsg_nocancel = 402; 419 enum SYS_recvfrom_nocancel = 403; 420 enum SYS_accept_nocancel = 404; 421 enum SYS_msync_nocancel = 405; 422 enum SYS_fcntl_nocancel = 406; 423 enum SYS_select_nocancel = 407; 424 enum SYS_fsync_nocancel = 408; 425 enum SYS_connect_nocancel = 409; 426 enum SYS_sigsuspend_nocancel = 410; 427 enum SYS_readv_nocancel = 411; 428 enum SYS_writev_nocancel = 412; 429 enum SYS_sendto_nocancel = 413; 430 enum SYS_pread_nocancel = 414; 431 enum SYS_pwrite_nocancel = 415; 432 enum SYS_waitid_nocancel = 416; 433 enum SYS_poll_nocancel = 417; 434 enum SYS_msgsnd_nocancel = 418; 435 enum SYS_msgrcv_nocancel = 419; 436 enum SYS_sem_wait_nocancel = 420; 437 enum SYS_aio_suspend_nocancel = 421; 438 enum SYS___sigwait_nocancel = 422; 439 enum SYS___semwait_signal_nocancel = 423; 440 enum SYS___mac_mount = 424; 441 enum SYS___mac_get_mount = 425; 442 enum SYS___mac_getfsstat = 426; 443 enum SYS_fsgetpath = 427; 444 enum SYS_audit_session_self = 428; 445 enum SYS_audit_session_join = 429; 446 enum SYS_fileport_makeport = 430; 447 enum SYS_fileport_makefd = 431; 448 enum SYS_audit_session_port = 432; 449 enum SYS_pid_suspend = 433; 450 enum SYS_pid_resume = 434; 451 enum SYS_pid_hibernate = 435; 452 enum SYS_pid_shutdown_sockets = 436; 453 /* 437 old shared_region_slide_np */ 454 enum SYS_shared_region_map_and_slide_np = 438; 455 enum SYS_kas_info = 439; 456 enum SYS_memorystatus_control = 440; 457 enum SYS_guarded_open_np = 441; 458 enum SYS_guarded_close_np = 442; 459 enum SYS_guarded_kqueue_np = 443; 460 enum SYS_change_fdguard_np = 444; 461 enum SYS_usrctl = 445; 462 enum SYS_proc_rlimit_control = 446; 463 enum SYS_connectx = 447; 464 enum SYS_disconnectx = 448; 465 enum SYS_peeloff = 449; 466 enum SYS_socket_delegate = 450; 467 enum SYS_telemetry = 451; 468 enum SYS_proc_uuid_policy = 452; 469 enum SYS_memorystatus_get_level = 453; 470 enum SYS_system_override = 454; 471 enum SYS_vfs_purge = 455; 472 enum SYS_sfi_ctl = 456; 473 enum SYS_sfi_pidctl = 457; 474 enum SYS_coalition = 458; 475 enum SYS_coalition_info = 459; 476 enum SYS_necp_match_policy = 460; 477 enum SYS_getattrlistbulk = 461; 478 enum SYS_clonefileat = 462; 479 enum SYS_openat = 463; 480 enum SYS_openat_nocancel = 464; 481 enum SYS_renameat = 465; 482 enum SYS_faccessat = 466; 483 enum SYS_fchmodat = 467; 484 enum SYS_fchownat = 468; 485 enum SYS_fstatat = 469; 486 enum SYS_fstatat64 = 470; 487 enum SYS_linkat = 471; 488 enum SYS_unlinkat = 472; 489 enum SYS_readlinkat = 473; 490 enum SYS_symlinkat = 474; 491 enum SYS_mkdirat = 475; 492 enum SYS_getattrlistat = 476; 493 enum SYS_proc_trace_log = 477; 494 enum SYS_bsdthread_ctl = 478; 495 enum SYS_openbyid_np = 479; 496 enum SYS_recvmsg_x = 480; 497 enum SYS_sendmsg_x = 481; 498 enum SYS_thread_selfusage = 482; 499 enum SYS_csrctl = 483; 500 enum SYS_guarded_open_dprotected_np = 484; 501 enum SYS_guarded_write_np = 485; 502 enum SYS_guarded_pwrite_np = 486; 503 enum SYS_guarded_writev_np = 487; 504 enum SYS_renameatx_np = 488; 505 enum SYS_mremap_encrypted = 489; 506 enum SYS_netagent_trigger = 490; 507 enum SYS_stack_snapshot_with_config = 491; 508 enum SYS_microstackshot = 492; 509 enum SYS_grab_pgo_data = 493; 510 enum SYS_persona = 494; 511 /* 495 */ 512 /* 496 */ 513 /* 497 */ 514 /* 498 */ 515 enum SYS_work_interval_ctl = 499; 516 enum SYS_getentropy = 500; 517 enum SYS_necp_open = 501; 518 enum SYS_necp_client_action = 502; 519 enum SYS___nexus_open = 503; 520 enum SYS___nexus_register = 504; 521 enum SYS___nexus_deregister = 505; 522 enum SYS___nexus_create = 506; 523 enum SYS___nexus_destroy = 507; 524 enum SYS___nexus_get_opt = 508; 525 enum SYS___nexus_set_opt = 509; 526 enum SYS___channel_open = 510; 527 enum SYS___channel_get_info = 511; 528 enum SYS___channel_sync = 512; 529 enum SYS___channel_get_opt = 513; 530 enum SYS___channel_set_opt = 514; 531 enum SYS_ulock_wait = 515; 532 enum SYS_ulock_wake = 516; 533 enum SYS_fclonefileat = 517; 534 enum SYS_fs_snapshot = 518; 535 /* 519 */ 536 enum SYS_terminate_with_payload = 520; 537 enum SYS_abort_with_payload = 521; 538 enum SYS_necp_session_open = 522; 539 enum SYS_necp_session_action = 523; 540 enum SYS_setattrlistat = 524; 541 enum SYS_net_qos_guideline = 525; 542 enum SYS_fmount = 526; 543 enum SYS_ntp_adjtime = 527; 544 enum SYS_ntp_gettime = 528; 545 enum SYS_os_fault_with_payload = 529; 546 enum SYS_MAXSYSCALL = 530; 547 enum SYS_invalid = 63; 548