package core:sys/darwin

Warning: This was generated for -target:darwin_arm64 and might not represet every target this package supports.

⌘K
Ctrl+K
or
/

    Index

    Constants (92)
    Variables (0)

    This section is empty.

    Procedures (72)
    Procedure Groups (0)

    This section is empty.

    Types

    Bool ¶

    Bool :: b8

    Offset_From ¶

    Offset_From :: enum i32 {
    	SEEK_SET  = 0, // the offset is set to offset bytes.
    	SEEK_CUR  = 1, // the offset is set to its current location plus offset bytes.
    	SEEK_END  = 2, // the offset is set to the size of the file plus offset bytes.
    	SEEK_HOLE = 3, //  the offset is set to the start of the next hole greater than or equal to the supplied offset.
    	SEEK_DATA = 4, //  the offset is set to the start of the next non-hole file region greater than or equal to the supplied offset.
    }
    Related Procedures With Parameters

    Open_Flags ¶

    Open_Flags :: bit_set[Open_Flags_Enum; u16]

    Open_Flags_Enum ¶

    Open_Flags_Enum :: enum u8 {
    	RDONLY,       // open for reading only
    	WRONLY,       // open for writing only
    	RDWR,         // open for reading and writing
    	NONBLOCK,     // no delay
    	APPEND,       // set append mode
    	CREAT,        // create if nonexistant
    	TRUNC,        // truncate to zero length
    	EXCL,         // error if already exists
    	SHLOCK,       // open with shared file lock
    	EXLOCK,       // open with exclusive file lock
    	DIRECTORY,    // restrict open to only directories
    	NOFOLLOW,     // don't follow symlinks
    	SYMLINK,      // allow open of a symlink
    	EVTONLY,      // descriptor requested for event notifications only
    	CLOEXEC,      // causes the descriptor to be closed if you use any of the exec like functions
    	NOFOLLOW_ANY, // no symlinks allowed in path
    }

    Permission_Enum ¶

    Permission_Enum :: enum u8 {
    	// For owner 
    	PERMISSION_OWNER_READ,             // R for owner
    	PERMISSION_OWNER_WRITE,            // W for owner
    	PERMISSION_OWNER_EXECUTE,          // X for owner
    	// For group 
    	PERMISSION_GROUP_READ,             // R for group
    	PERMISSION_GROUP_WRITE,            // W for group
    	PERMISSION_GROUP_EXECUTE,          // X for group
    	// For other 
    	PERMISSION_OTHER_READ,             // R for other
    	PERMISSION_OTHER_WRITE,            // W for other
    	PERMISSION_OTHER_EXECUTE,          // X for other
    	// Special 
    	PERMISSION_SET_USER_ON_EXECUTION,  // set user id on execution
    	PERMISSION_SET_GROUP_ON_EXECUTION, // set group id on execution
    	// ?? 
    	PERMISSION_ISVTX,                  // save swapped text even after use
    }

    RUsage ¶

    RUsage :: struct {
    	ru_utime:    _STRUCT_TIMEVAL,
    	ru_stime:    _STRUCT_TIMEVAL,
    	ru_maxrss:   i64,
    	ru_ixrss:    i64,
    	ru_idrss:    i64,
    	ru_isrss:    i64,
    	ru_minflt:   i64,
    	ru_majflt:   i64,
    	ru_nswap:    i64,
    	ru_inblock:  i64,
    	ru_oublock:  i64,
    	ru_msgsnd:   i64,
    	ru_msgrcv:   i64,
    	ru_nsignals: i64,
    	ru_nvcsw:    i64,
    	ru_nivcsw:   i64,
    }
    Related Procedures With Parameters

    System_Call_Number ¶

    System_Call_Number :: enum uintptr {
    	// 0 syscall 
    	exit                             = 1, 
    	fork                             = 2, 
    	read                             = 3, 
    	write                            = 4, 
    	open                             = 5, 
    	close                            = 6, 
    	wait4                            = 7, 
    	// 8  old creat 
    	link                             = 9, 
    	unlink                           = 10, 
    	// 11  old execv 
    	chdir                            = 12, 
    	fchdir                           = 13, 
    	mknod                            = 14, 
    	chmod                            = 15, 
    	chown                            = 16, 
    	// 17  old break 
    	getfsstat                        = 18, 
    	// 19  old lseek 
    	getpid                           = 20, 
    	// 21  old mount 
    	// 22  old umount 
    	setuid                           = 23, 
    	getuid                           = 24, 
    	geteuid                          = 25, 
    	ptrace                           = 26, 
    	recvmsg                          = 27, 
    	sendmsg                          = 28, 
    	recvfrom                         = 29, 
    	accept                           = 30, 
    	getpeername                      = 31, 
    	getsockname                      = 32, 
    	access                           = 33, 
    	chflags                          = 34, 
    	fchflags                         = 35, 
    	sync                             = 36, 
    	kill                             = 37, 
    	// 38  old stat 
    	getppid                          = 39, 
    	// 40  old lstat 
    	dup                              = 41, 
    	pipe                             = 42, 
    	getegid                          = 43, 
    	// 44  old profil 
    	// 45  old ktrace 
    	sigaction                        = 46, 
    	getgid                           = 47, 
    	sigprocmask                      = 48, 
    	getlogin                         = 49, 
    	setlogin                         = 50, 
    	acct                             = 51, 
    	sigpending                       = 52, 
    	sigaltstack                      = 53, 
    	ioctl                            = 54, 
    	reboot                           = 55, 
    	revoke                           = 56, 
    	symlink                          = 57, 
    	readlink                         = 58, 
    	execve                           = 59, 
    	umask                            = 60, 
    	chroot                           = 61, 
    	// 62  old fstat 
    	// 63  used internally and reserved 
    	// getpagesize = 64, invalid 
    	msync                            = 65, 
    	vfork                            = 66, 
    	// 67  old vread 
    	// 68  old vwrite 
    	// 69  old sbrk 
    	// 70  old sstk 
    	// 71  old mmap 
    	// 72  old vadvise 
    	munmap                           = 73, 
    	mprotect                         = 74, 
    	madvise                          = 75, 
    	// 76  old vhangup 
    	// 77  old vlimit 
    	mincore                          = 78, 
    	getgroups                        = 79, 
    	setgroups                        = 80, 
    	getpgrp                          = 81, 
    	setpgid                          = 82, 
    	setitimer                        = 83, 
    	// 84  old wait 
    	swapon                           = 85, 
    	getitimer                        = 86, 
    	// 87  old gethostname 
    	// 88  old sethostname 
    	getdtablesize                    = 89, 
    	dup2                             = 90, 
    	// 91  old getdopt 
    	fcntl                            = 92, 
    	select                           = 93, 
    	// 94  old setdopt 
    	fsync                            = 95, 
    	setpriority                      = 96, 
    	socket                           = 97, 
    	connect                          = 98, 
    	// 99  old accept 
    	getpriority                      = 100, 
    	// 101  old send 
    	// 102  old recv 
    	// 103  old sigreturn 
    	bind                             = 104, 
    	setsockopt                       = 105, 
    	listen                           = 106, 
    	// 107  old vtimes 
    	// 108  old sigvec 
    	// 109  old sigblock 
    	// 110  old sigsetmask 
    	sigsuspend                       = 111, 
    	// 112  old sigstack 
    	// 113  old recvmsg 
    	// 114  old sendmsg 
    	// 115  old vtrace 
    	gettimeofday                     = 116, 
    	getrusage                        = 117, 
    	getsockopt                       = 118, 
    	// 119  old resuba 
    	readv                            = 120, 
    	writev                           = 121, 
    	settimeofday                     = 122, 
    	fchown                           = 123, 
    	fchmod                           = 124, 
    	// 125  old recvfrom 
    	setreuid                         = 126, 
    	setregid                         = 127, 
    	rename                           = 128, 
    	// 129  old truncate 
    	// 130  old ftruncate 
    	flock                            = 131, 
    	mkfifo                           = 132, 
    	sendto                           = 133, 
    	shutdown                         = 134, 
    	socketpair                       = 135, 
    	mkdir                            = 136, 
    	rmdir                            = 137, 
    	utimes                           = 138, 
    	futimes                          = 139, 
    	adjtime                          = 140, 
    	// 141  old getpeername 
    	gethostuuid                      = 142, 
    	// 143  old sethostid 
    	// 144  old getrlimit 
    	// 145  old setrlimit 
    	// 146  old killpg 
    	setsid                           = 147, 
    	// 148  old setquota 
    	// 149  old qquota 
    	// 150  old getsockname 
    	getpgid                          = 151, 
    	setprivexec                      = 152, 
    	pread                            = 153, 
    	pwrite                           = 154, 
    	nfssvc                           = 155, 
    	// 156  old getdirentries 
    	statfs                           = 157, 
    	fstatfs                          = 158, 
    	unmount                          = 159, 
    	// 160  old async_daemon 
    	getfh                            = 161, 
    	// 162  old getdomainname 
    	// 163  old setdomainname 
    	// 164  
    	quotactl                         = 165, 
    	// 166  old exportfs 
    	mount                            = 167, 
    	// 168  old ustat 
    	csops                            = 169, 
    	csops_audittoken                 = 170, 
    	// 171  old wait3 
    	// 172  old rpause 
    	waitid                           = 173, 
    	// 174  old getdents 
    	// 175  old gc_control 
    	// 176  old add_profil 
    	kdebug_typefilter                = 177, 
    	kdebug_trace_string              = 178, 
    	kdebug_trace64                   = 179, 
    	kdebug_trace                     = 180, 
    	setgid                           = 181, 
    	setegid                          = 182, 
    	seteuid                          = 183, 
    	sigreturn                        = 184, 
    	// 185  old chud 
    	thread_selfcounts                = 186, 
    	fdatasync                        = 187, 
    	stat                             = 188, 
    	fstat                            = 189, 
    	lstat                            = 190, 
    	pathconf                         = 191, 
    	fpathconf                        = 192, 
    	// 193  old getfsstat 
    	getrlimit                        = 194, 
    	setrlimit                        = 195, 
    	getdirentries                    = 196, 
    	mmap                             = 197, 
    	// 198  old __syscall 
    	lseek                            = 199, 
    	truncate                         = 200, 
    	ftruncate                        = 201, 
    	sysctl                           = 202, 
    	mlock                            = 203, 
    	munlock                          = 204, 
    	undelete                         = 205, 
    	// 206  old ATsocket 
    	// 207  old ATgetmsg 
    	// 208  old ATputmsg 
    	// 209  old ATsndreq 
    	// 210  old ATsndrsp 
    	// 211  old ATgetreq 
    	// 212  old ATgetrsp 
    	// 213  Reserved for AppleTalk 
    	// 214  
    	// 215  
    	open_dprotected_np               = 216, 
    	fsgetpath_ext                    = 217, 
    	// 218  old lstatv 
    	// 219  old fstatv 
    	getattrlist                      = 220, 
    	setattrlist                      = 221, 
    	getdirentriesattr                = 222, 
    	exchangedata                     = 223, 
    	// 224  old checkuseraccess or fsgetpath 
    	searchfs                         = 225, 
    	delete                           = 226, 
    	copyfile                         = 227, 
    	fgetattrlist                     = 228, 
    	fsetattrlist                     = 229, 
    	poll                             = 230, 
    	// 231  old watchevent 
    	// 232  old waitevent 
    	// 233  old modwatch 
    	getxattr                         = 234, 
    	fgetxattr                        = 235, 
    	setxattr                         = 236, 
    	fsetxattr                        = 237, 
    	removexattr                      = 238, 
    	fremovexattr                     = 239, 
    	listxattr                        = 240, 
    	flistxattr                       = 241, 
    	fsctl                            = 242, 
    	initgroups                       = 243, 
    	posix_spawn                      = 244, 
    	ffsctl                           = 245, 
    	// 246  
    	nfsclnt                          = 247, 
    	fhopen                           = 248, 
    	// 249  
    	minherit                         = 250, 
    	semsys                           = 251, 
    	msgsys                           = 252, 
    	shmsys                           = 253, 
    	semctl                           = 254, 
    	semget                           = 255, 
    	semop                            = 256, 
    	// 257  old semconfig 
    	msgctl                           = 258, 
    	msgget                           = 259, 
    	msgsnd                           = 260, 
    	msgrcv                           = 261, 
    	shmat                            = 262, 
    	shmctl                           = 263, 
    	shmdt                            = 264, 
    	shmget                           = 265, 
    	shm_open                         = 266, 
    	shm_unlink                       = 267, 
    	sem_open                         = 268, 
    	sem_close                        = 269, 
    	sem_unlink                       = 270, 
    	sem_wait                         = 271, 
    	sem_trywait                      = 272, 
    	sem_post                         = 273, 
    	sysctlbyname                     = 274, 
    	// 275  old sem_init 
    	// 276  old sem_destroy 
    	open_extended                    = 277, 
    	umask_extended                   = 278, 
    	stat_extended                    = 279, 
    	lstat_extended                   = 280, 
    	fstat_extended                   = 281, 
    	chmod_extended                   = 282, 
    	fchmod_extended                  = 283, 
    	access_extended                  = 284, 
    	settid                           = 285, 
    	gettid                           = 286, 
    	setsgroups                       = 287, 
    	getsgroups                       = 288, 
    	setwgroups                       = 289, 
    	getwgroups                       = 290, 
    	mkfifo_extended                  = 291, 
    	mkdir_extended                   = 292, 
    	identitysvc                      = 293, 
    	shared_region_check_np           = 294, 
    	// 295  old shared_region_map_np 
    	vm_pressure_monitor              = 296, 
    	psynch_rw_longrdlock             = 297, 
    	psynch_rw_yieldwrlock            = 298, 
    	psynch_rw_downgrade              = 299, 
    	psynch_rw_upgrade                = 300, 
    	psynch_mutexwait                 = 301, 
    	psynch_mutexdrop                 = 302, 
    	psynch_cvbroad                   = 303, 
    	psynch_cvsignal                  = 304, 
    	psynch_cvwait                    = 305, 
    	psynch_rw_rdlock                 = 306, 
    	psynch_rw_wrlock                 = 307, 
    	psynch_rw_unlock                 = 308, 
    	psynch_rw_unlock2                = 309, 
    	getsid                           = 310, 
    	settid_with_pid                  = 311, 
    	psynch_cvclrprepost              = 312, 
    	aio_fsync                        = 313, 
    	aio_return                       = 314, 
    	aio_suspend                      = 315, 
    	aio_cancel                       = 316, 
    	aio_error                        = 317, 
    	aio_read                         = 318, 
    	aio_write                        = 319, 
    	lio_listio                       = 320, 
    	// 321  old __pthread_cond_wait 
    	iopolicysys                      = 322, 
    	process_policy                   = 323, 
    	mlockall                         = 324, 
    	munlockall                       = 325, 
    	// 326  
    	issetugid                        = 327, 
    	__pthread_kill                   = 328, 
    	__pthread_sigmask                = 329, 
    	__sigwait                        = 330, 
    	__disable_threadsignal           = 331, 
    	__pthread_markcancel             = 332, 
    	__pthread_canceled               = 333, 
    	__semwait_signal                 = 334, 
    	// 335  old utrace 
    	proc_info                        = 336, 
    	sendfile                         = 337, 
    	stat64                           = 338, 
    	fstat64                          = 339, 
    	lstat64                          = 340, 
    	stat64_extended                  = 341, 
    	lstat64_extended                 = 342, 
    	fstat64_extended                 = 343, 
    	getdirentries64                  = 344, 
    	statfs64                         = 345, 
    	fstatfs64                        = 346, 
    	getfsstat64                      = 347, 
    	__pthread_chdir                  = 348, 
    	__pthread_fchdir                 = 349, 
    	audit                            = 350, 
    	auditon                          = 351, 
    	// 352  
    	getauid                          = 353, 
    	setauid                          = 354, 
    	// 355  old getaudit 
    	// 356  old setaudit 
    	getaudit_addr                    = 357, 
    	setaudit_addr                    = 358, 
    	auditctl                         = 359, 
    	bsdthread_create                 = 360, 
    	bsdthread_terminate              = 361, 
    	kqueue                           = 362, 
    	kevent                           = 363, 
    	lchown                           = 364, 
    	// 365  old stack_snapshot 
    	bsdthread_register               = 366, 
    	workq_open                       = 367, 
    	workq_kernreturn                 = 368, 
    	kevent64                         = 369, 
    	__old_semwait_signal             = 370, 
    	__old_semwait_signal_nocancel    = 371, 
    	thread_selfid                    = 372, 
    	ledger                           = 373, 
    	kevent_qos                       = 374, 
    	kevent_id                        = 375, 
    	// 376  
    	// 377  
    	// 378  
    	// 379  
    	__mac_execve                     = 380, 
    	__mac_syscall                    = 381, 
    	__mac_get_file                   = 382, 
    	__mac_set_file                   = 383, 
    	__mac_get_link                   = 384, 
    	__mac_set_link                   = 385, 
    	__mac_get_proc                   = 386, 
    	__mac_set_proc                   = 387, 
    	__mac_get_fd                     = 388, 
    	__mac_set_fd                     = 389, 
    	__mac_get_pid                    = 390, 
    	// 391  
    	// 392  
    	// 393  
    	pselect                          = 394, 
    	pselect_nocancel                 = 395, 
    	read_nocancel                    = 396, 
    	write_nocancel                   = 397, 
    	open_nocancel                    = 398, 
    	close_nocancel                   = 399, 
    	wait4_nocancel                   = 400, 
    	recvmsg_nocancel                 = 401, 
    	sendmsg_nocancel                 = 402, 
    	recvfrom_nocancel                = 403, 
    	accept_nocancel                  = 404, 
    	msync_nocancel                   = 405, 
    	fcntl_nocancel                   = 406, 
    	select_nocancel                  = 407, 
    	fsync_nocancel                   = 408, 
    	connect_nocancel                 = 409, 
    	sigsuspend_nocancel              = 410, 
    	readv_nocancel                   = 411, 
    	writev_nocancel                  = 412, 
    	sendto_nocancel                  = 413, 
    	pread_nocancel                   = 414, 
    	pwrite_nocancel                  = 415, 
    	waitid_nocancel                  = 416, 
    	poll_nocancel                    = 417, 
    	msgsnd_nocancel                  = 418, 
    	msgrcv_nocancel                  = 419, 
    	sem_wait_nocancel                = 420, 
    	aio_suspend_nocancel             = 421, 
    	__sigwait_nocancel               = 422, 
    	__semwait_signal_nocancel        = 423, 
    	__mac_mount                      = 424, 
    	__mac_get_mount                  = 425, 
    	__mac_getfsstat                  = 426, 
    	fsgetpath                        = 427, 
    	audit_session_self               = 428, 
    	audit_session_join               = 429, 
    	fileport_makeport                = 430, 
    	fileport_makefd                  = 431, 
    	audit_session_port               = 432, 
    	pid_suspend                      = 433, 
    	pid_resume                       = 434, 
    	pid_hibernate                    = 435, 
    	pid_shutdown_sockets             = 436, 
    	// 437  old shared_region_slide_np 
    	shared_region_map_and_slide_np   = 438, 
    	kas_info                         = 439, 
    	memorystatus_control             = 440, 
    	guarded_open_np                  = 441, 
    	guarded_close_np                 = 442, 
    	guarded_kqueue_np                = 443, 
    	change_fdguard_np                = 444, 
    	usrctl                           = 445, 
    	proc_rlimit_control              = 446, 
    	connectx                         = 447, 
    	disconnectx                      = 448, 
    	peeloff                          = 449, 
    	socket_delegate                  = 450, 
    	telemetry                        = 451, 
    	proc_uuid_policy                 = 452, 
    	memorystatus_get_level           = 453, 
    	system_override                  = 454, 
    	vfs_purge                        = 455, 
    	sfi_ctl                          = 456, 
    	sfi_pidctl                       = 457, 
    	coalition                        = 458, 
    	coalition_info                   = 459, 
    	necp_match_policy                = 460, 
    	getattrlistbulk                  = 461, 
    	clonefileat                      = 462, 
    	openat                           = 463, 
    	openat_nocancel                  = 464, 
    	renameat                         = 465, 
    	faccessat                        = 466, 
    	fchmodat                         = 467, 
    	fchownat                         = 468, 
    	fstatat                          = 469, 
    	fstatat64                        = 470, 
    	linkat                           = 471, 
    	unlinkat                         = 472, 
    	readlinkat                       = 473, 
    	symlinkat                        = 474, 
    	mkdirat                          = 475, 
    	getattrlistat                    = 476, 
    	proc_trace_log                   = 477, 
    	bsdthread_ctl                    = 478, 
    	openbyid_np                      = 479, 
    	recvmsg_x                        = 480, 
    	sendmsg_x                        = 481, 
    	thread_selfusage                 = 482, 
    	csrctl                           = 483, 
    	guarded_open_dprotected_np       = 484, 
    	guarded_write_np                 = 485, 
    	guarded_pwrite_np                = 486, 
    	guarded_writev_np                = 487, 
    	renameatx_np                     = 488, 
    	mremap_encrypted                 = 489, 
    	netagent_trigger                 = 490, 
    	stack_snapshot_with_config       = 491, 
    	microstackshot                   = 492, 
    	grab_pgo_data                    = 493, 
    	persona                          = 494, 
    	// 495  
    	mach_eventlink_signal            = 496, 
    	mach_eventlink_wait_until        = 497, 
    	mach_eventlink_signal_wait_until = 498, 
    	work_interval_ctl                = 499, 
    	getentropy                       = 500, 
    	necp_open                        = 501, 
    	necp_client_action               = 502, 
    	nexus_open                       = 503, // for those who are intressted http://newosxbook.com/bonus/vol1ch16.html
    	nexus_register                   = 504, 
    	nexus_deregister                 = 505, 
    	nexus_create                     = 506, 
    	nexus_destroy                    = 507, 
    	nexus_get_opt                    = 508, 
    	nexus_set_opt                    = 509, 
    	channel_open                     = 510, 
    	channel_get_info                 = 511, 
    	channel_sync                     = 512, 
    	channel_get_opt                  = 513, 
    	channel_set_opt                  = 514, 
    	ulock_wait                       = 515, 
    	ulock_wake                       = 516, 
    	fclonefileat                     = 517, 
    	fs_snapshot                      = 518, 
    	register_uexc_handler            = 519, 
    	terminate_with_payload           = 520, 
    	abort_with_payload               = 521, 
    	necp_session_open                = 522, 
    	necp_session_action              = 523, 
    	setattrlistat                    = 524, 
    	net_qos_guideline                = 525, 
    	fmount                           = 526, 
    	ntp_adjtime                      = 527, 
    	ntp_gettime                      = 528, 
    	os_fault_with_payload            = 529, 
    	kqueue_workloop_ctl              = 530, 
    	mach_bridge_remote_time          = 531, 
    	coalition_ledger                 = 532, 
    	log_data                         = 533, 
    	memorystatus_available_memory    = 534, 
    	objc_bp_assist_cfg_np            = 535, 
    	shared_region_map_and_slide_2_np = 536, 
    	pivot_root                       = 537, 
    	task_inspect_for_pid             = 538, 
    	task_read_for_pid                = 539, 
    	preadv                           = 540, 
    	pwritev                          = 541, 
    	preadv_nocancel                  = 542, 
    	pwritev_nocancel                 = 543, 
    	ulock_wait2                      = 544, 
    	proc_info_extended_id            = 545, 
    	tracker_action                   = 546, 
    	debug_syscall_reject             = 547, 
    	MAXSYSCALL                       = 548, 
    }
    Related Procedures With Parameters

    blkcnt_t ¶

    blkcnt_t :: i64

    blksize_t ¶

    blksize_t :: i32

    dev_t ¶

    dev_t :: i32

    gid_t ¶

    gid_t :: u16

    mode_t ¶

    mode_t :: u16
    nlink_t :: u16

    off_t ¶

    off_t :: i64

    os_clockid ¶

    os_clockid :: enum u32 {
    	MACH_ABSOLUTE_TIME = 32, 
    }
    Related Procedures With Parameters

    os_sync_wait_on_address_flag ¶

    os_sync_wait_on_address_flag :: enum u32 {
    	// This flag should be used as a default flag when no other flags listed below are required.
    	NONE, 
    	// This flag should be used when synchronizing among multiple processes by
    	// placing the @addr passed to os_sync_wait_on_address and its variants
    	// in a shared memory region.
    	// 
    	// When using this flag, it is important to pass OS_SYNC_WAKE_BY_ADDRESS_SHARED
    	// flag along with the exact same @addr to os_sync_wake_by_address_any and
    	// its variants to correctly find and wake up blocked waiters on the @addr.
    	// 
    	// This flag should not be used when synchronizing among multiple threads of
    	// a single process. It allows the kernel to perform performance optimizations
    	// as the @addr is local to the calling process.
    	SHARED, 
    }

    os_sync_wait_on_address_flags ¶

    os_sync_wait_on_address_flags :: bit_set[os_sync_wait_on_address_flag; u32]

    os_sync_wake_by_address_flag ¶

    os_sync_wake_by_address_flag :: enum u32 {
    	// This flag should be used as a default flag when no other flags listed below are required.
    	NONE, 
    	// This flag should be used when synchronizing among multiple processes by
    	// placing the @addr passed to os_sync_wake_by_address_any and its variants
    	// in a shared memory region.
    	// 
    	// When using this flag, it is important to pass OS_SYNC_WAIT_ON_ADDRESS_SHARED
    	// flag along with the exact same @addr to os_sync_wait_on_address and
    	// its variants to correctly find and wake up blocked waiters on the @addr.
    	// 
    	// This flag should not be used when synchronizing among multiple threads of
    	// a single process. It allows the kernel to perform performance optimizations
    	// as the @addr is local the calling process.
    	SHARED, 
    }

    os_sync_wake_by_address_flags ¶

    os_sync_wake_by_address_flags :: bit_set[os_sync_wake_by_address_flag; u32]

    pid_t ¶

    pid_t :: i32

    task_t ¶

    task_t :: distinct u64
     

    NOTE(tetra): Unclear whether these should be aligned 16 or not. However all other sync primitives are aligned for robustness. I cannot currently align these though. See core/sys/unix/pthread_linux.odin/pthread_t.

    Related Procedures With Parameters
    Related Procedures With Returns

    thread_act_t ¶

    thread_act_t :: distinct u64
    Related Procedures With Parameters

    time_t ¶

    time_t :: i64

    uid_t ¶

    uid_t :: u16

    Constants

    COPYFILE_ACL ¶

    COPYFILE_ACL :: 1 << 0
     

    copyfile flags

    COPYFILE_ALL ¶

    COPYFILE_ALL :: COPYFILE_METADATA | COPYFILE_DATA

    COPYFILE_DATA ¶

    COPYFILE_DATA :: 1 << 3

    COPYFILE_METADATA ¶

    COPYFILE_METADATA :: COPYFILE_SECURITY | COPYFILE_XATTR

    COPYFILE_SECURITY ¶

    COPYFILE_SECURITY :: COPYFILE_STAT | COPYFILE_ACL

    COPYFILE_STAT ¶

    COPYFILE_STAT :: 1 << 1

    COPYFILE_XATTR ¶

    COPYFILE_XATTR :: 1 << 2

    DARWIN_MAXCOMLEN ¶

    DARWIN_MAXCOMLEN :: 16
     

    bsd/sys/param.h

    DARWIN_PROC_ALL_PIDS ¶

    DARWIN_PROC_ALL_PIDS: i32 : c.int(1)

    DARWIN_PROC_INFO_CALL_CANUSEFGHW ¶

    DARWIN_PROC_INFO_CALL_CANUSEFGHW: i32 : c.int(0xc)

    DARWIN_PROC_INFO_CALL_DIRTYCONTROL ¶

    DARWIN_PROC_INFO_CALL_DIRTYCONTROL: i32 : c.int(0x8)

    DARWIN_PROC_INFO_CALL_KERNMSGBUF ¶

    DARWIN_PROC_INFO_CALL_KERNMSGBUF: i32 : c.int(0x4)

    DARWIN_PROC_INFO_CALL_LISTCOALITIONS ¶

    DARWIN_PROC_INFO_CALL_LISTCOALITIONS: i32 : c.int(0xb)

    DARWIN_PROC_INFO_CALL_LISTPIDS ¶

    DARWIN_PROC_INFO_CALL_LISTPIDS: i32 : c.int(0x1)

    DARWIN_PROC_INFO_CALL_PIDDYNKQUEUEINFO ¶

    DARWIN_PROC_INFO_CALL_PIDDYNKQUEUEINFO: i32 : c.int(0xd)

    DARWIN_PROC_INFO_CALL_PIDFDINFO ¶

    DARWIN_PROC_INFO_CALL_PIDFDINFO: i32 : c.int(0x3)

    DARWIN_PROC_INFO_CALL_PIDFILEPORTINFO ¶

    DARWIN_PROC_INFO_CALL_PIDFILEPORTINFO: i32 : c.int(0x6)

    DARWIN_PROC_INFO_CALL_PIDINFO ¶

    DARWIN_PROC_INFO_CALL_PIDINFO: i32 : c.int(0x2)

    DARWIN_PROC_INFO_CALL_PIDORIGINATORINFO ¶

    DARWIN_PROC_INFO_CALL_PIDORIGINATORINFO: i32 : c.int(0xa)

    DARWIN_PROC_INFO_CALL_PIDRUSAGE ¶

    DARWIN_PROC_INFO_CALL_PIDRUSAGE: i32 : c.int(0x9)

    DARWIN_PROC_INFO_CALL_SETCONTROL ¶

    DARWIN_PROC_INFO_CALL_SETCONTROL: i32 : c.int(0x5)

    DARWIN_PROC_INFO_CALL_TERMINATE ¶

    DARWIN_PROC_INFO_CALL_TERMINATE: i32 : c.int(0x7)

    DARWIN_PROC_INFO_CALL_UDATA_INFO ¶

    DARWIN_PROC_INFO_CALL_UDATA_INFO: i32 : c.int(0xe)

    DARWIN_PROC_KDBG_ONLY ¶

    DARWIN_PROC_KDBG_ONLY: i32 : c.int(7)

    DARWIN_PROC_PGRP_ONLY ¶

    DARWIN_PROC_PGRP_ONLY: i32 : c.int(2)

    DARWIN_PROC_PIDPATHINFO ¶

    DARWIN_PROC_PIDPATHINFO :: 11

    DARWIN_PROC_PIDPATHINFO_SIZE ¶

    DARWIN_PROC_PIDPATHINFO_SIZE :: MAXPATHLEN
     

    proc_info.h

    DARWIN_PROC_PPID_ONLY ¶

    DARWIN_PROC_PPID_ONLY: i32 : c.int(6)

    DARWIN_PROC_RUID_ONLY ¶

    DARWIN_PROC_RUID_ONLY: i32 : c.int(5)

    DARWIN_PROC_TTY_ONLY ¶

    DARWIN_PROC_TTY_ONLY: i32 : c.int(3)

    DARWIN_PROC_UID_ONLY ¶

    DARWIN_PROC_UID_ONLY: i32 : c.int(4)

    F_OK ¶

    F_OK: i32 : c.int(0)
     

    sys/unistd.h for access

    LOCK_EX ¶

    LOCK_EX :: 2
     

    exclusive lock

    LOCK_NB ¶

    LOCK_NB :: 4
     

    don't block when locking

    LOCK_SH ¶

    LOCK_SH :: 1
     

    flock

    LOCK_UN ¶

    LOCK_UN :: 8
     

    unlock

    MAP_32BIT ¶

    MAP_32BIT :: 0x8000
     

    Return virtual addresses <4G only

    MAP_ANONYMOUS ¶

    MAP_ANONYMOUS :: 0x1000
     

    mmap flags

    MAP_FILE ¶

    MAP_FILE :: 0x0000
     

    map from file (default)

    MAP_FIXED ¶

    MAP_FIXED :: 0x0010
     

    [MF|SHM] interpret addr exactly

    MAP_HASSEMAPHORE ¶

    MAP_HASSEMAPHORE :: 0x0200
     

    region may contain semaphores

    MAP_JIT ¶

    MAP_JIT :: 0x0800
     

    Allocate a region that will be used for JIT purposes

    MAP_NOCACHE ¶

    MAP_NOCACHE :: 0x0400
     

    don't cache pages for this mapping

    MAP_PRIVATE ¶

    MAP_PRIVATE :: 0x0002
     

    [MF|SHM] changes are private

    MAP_SHARED ¶

    MAP_SHARED :: 0x0001
     

    [MF|SHM] share changes

    MASK_ACCMODE ¶

    MASK_ACCMODE :: 0x0003
     

    mask for above rd/wr/rdwr flags

    MAXPATHLEN ¶

    MAXPATHLEN :: PATH_MAX
     

    param.h

    OPEN_FLAG_APPEND ¶

    OPEN_FLAG_APPEND :: 0x00000008
     

    set append mode

    OPEN_FLAG_CLOEXEC ¶

    OPEN_FLAG_CLOEXEC :: 0x01000000
     

    causes the descriptor to be closed if you use any of the exec like functions

    OPEN_FLAG_CREAT ¶

    OPEN_FLAG_CREAT :: 0x00000200
     

    create if nonexistant

    OPEN_FLAG_DIRECTORY ¶

    OPEN_FLAG_DIRECTORY :: 0x00100000
     

    restrict open to only directories

    OPEN_FLAG_EVTONLY ¶

    OPEN_FLAG_EVTONLY :: 0x00008000
     

    descriptor requested for event notifications only

    OPEN_FLAG_EXCL ¶

    OPEN_FLAG_EXCL :: 0x00000800
     

    error if already exists

    OPEN_FLAG_EXLOCK ¶

    OPEN_FLAG_EXLOCK :: 0x00000020
     

    open with exclusive file lock

    OPEN_FLAG_NOFOLLOW ¶

    OPEN_FLAG_NOFOLLOW :: 0x00000100
     

    don't follow symlinks

    OPEN_FLAG_NOFOLLOW_ANY ¶

    OPEN_FLAG_NOFOLLOW_ANY :: 0x20000000
     

    no symlinks allowed in path

    OPEN_FLAG_NONBLOCK ¶

    OPEN_FLAG_NONBLOCK :: 0x00000004
     

    no delay

    OPEN_FLAG_RDONLY ¶

    OPEN_FLAG_RDONLY :: 0x0000
     

    open for reading only

    OPEN_FLAG_RDWR ¶

    OPEN_FLAG_RDWR :: 0x0002
     

    open for reading and writing

    OPEN_FLAG_SHLOCK ¶

    OPEN_FLAG_SHLOCK :: 0x00000010
     

    open with shared file lock

    OPEN_FLAG_SYMLINK :: 0x00200000
     

    allow open of a symlink

    OPEN_FLAG_TRUNC ¶

    OPEN_FLAG_TRUNC :: 0x00000400
     

    truncate to zero length

    OPEN_FLAG_WRONLY ¶

    OPEN_FLAG_WRONLY :: 0x0001
     

    open for writing only

    PATH_MAX ¶

    PATH_MAX :: 1024
     

    syslimits.h

    PERMISSION_ALL_ALL ¶

    PERMISSION_ALL_ALL: bit_set[Permission_Enum; u16] : PERMISSION_OWNER_ALL | PERMISSION_GROUP_ALL | PERMISSION_OTHER_ALL

    PERMISSION_GROUP_ALL ¶

    PERMISSION_GROUP_ALL: bit_set[Permission_Enum; u16] : Permission{.PERMISSION_GROUP_READ, .PERMISSION_GROUP_WRITE, .PERMISSION_GROUP_EXECUTE}

    PERMISSION_MASK_IRGRP ¶

    PERMISSION_MASK_IRGRP :: 0o000040
     

    R for group

    PERMISSION_MASK_IROTH ¶

    PERMISSION_MASK_IROTH :: 0o000004
     

    R for other

    PERMISSION_MASK_IRUSR ¶

    PERMISSION_MASK_IRUSR :: 0o000400
     

    R for owner

    PERMISSION_MASK_IRWXG ¶

    PERMISSION_MASK_IRWXG :: 0o000070
     

    For group Mode/Permission Flags for Open etc.

    PERMISSION_MASK_IRWXO ¶

    PERMISSION_MASK_IRWXO :: 0o000007
     

    For other Mode/Permission Flags for Open etc.

    PERMISSION_MASK_IRWXU ¶

    PERMISSION_MASK_IRWXU :: 0o000700
     

    For owner Mode/Permission Flags for Open etc.

    PERMISSION_MASK_ISGID ¶

    PERMISSION_MASK_ISGID :: 0o002000
     

    set group id on execution

    PERMISSION_MASK_ISUID ¶

    PERMISSION_MASK_ISUID :: 0o004000
     

    Special Mode/Permission Flags for Open etc.

    PERMISSION_MASK_ISVTX ¶

    PERMISSION_MASK_ISVTX :: 0o001000
     

    save swapped text even after use

    PERMISSION_MASK_IWGRP ¶

    PERMISSION_MASK_IWGRP :: 0o000020
     

    W for group

    PERMISSION_MASK_IWOTH ¶

    PERMISSION_MASK_IWOTH :: 0o000002
     

    W for other

    PERMISSION_MASK_IWUSR ¶

    PERMISSION_MASK_IWUSR :: 0o000200
     

    W for owner

    PERMISSION_MASK_IXGRP ¶

    PERMISSION_MASK_IXGRP :: 0o000010
     

    X for group

    PERMISSION_MASK_IXOTH ¶

    PERMISSION_MASK_IXOTH :: 0o000001
     

    X for other

    PERMISSION_MASK_IXUSR ¶

    PERMISSION_MASK_IXUSR :: 0o000100
     

    X for owner

    PERMISSION_NONE_NONE ¶

    PERMISSION_NONE_NONE: bit_set[Permission_Enum; u16] : Permission{}

    PERMISSION_OTHER_ALL ¶

    PERMISSION_OTHER_ALL: bit_set[Permission_Enum; u16] : Permission{.PERMISSION_OTHER_READ, .PERMISSION_OTHER_WRITE, .PERMISSION_OTHER_EXECUTE}

    PERMISSION_OWNER_ALL ¶

    PERMISSION_OWNER_ALL: bit_set[Permission_Enum; u16] : Permission{.PERMISSION_OWNER_READ, .PERMISSION_OWNER_WRITE, .PERMISSION_OWNER_EXECUTE}

    PROT_EXEC ¶

    PROT_EXEC :: 0x04
     

    [MC2] pages can be executed

    PROT_NONE ¶

    PROT_NONE :: 0x00
     

    mmap prot flags

    PROT_READ ¶

    PROT_READ :: 0x01
     

    [MC2] pages can be read

    PROT_WRITE ¶

    PROT_WRITE :: 0x02
     

    [MC2] pages can be written

    R_OK ¶

    R_OK: i32 : c.int((1 << 2))
     

    test for read permission

    WAIT_ON_ADDRESS_AVAILABLE ¶

    WAIT_ON_ADDRESS_AVAILABLE :: false

    W_OK ¶

    W_OK: i32 : c.int((1 << 1))
     

    test for write permission

    X_OK ¶

    X_OK: i32 : c.int((1 << 0))
     

    test for execute or search permission

    Variables

    This section is empty.

    Procedures

    errno ¶

    errno :: proc "contextless" () -> i32 {…}

    mach_task_self ¶

    mach_task_self :: proc "c" () -> task_t ---

    os_sync_wait_on_address ¶

    os_sync_wait_on_address :: proc "c" (addr: rawptr, value: u64, size: uint, flags: bit_set[os_sync_wait_on_address_flag; u32]) -> i32 ---
     

    This function provides an atomic compare-and-wait functionality that can be used to implement other higher level synchronization primitives.

    It reads a value from @addr, compares it to expected @value and blocks the calling thread if they are equal. This sequence of operations is done atomically with respect to other concurrent operations that can be performed on this @addr by other threads using this same function or os_sync_wake_by_addr variants. At this point, the blocked calling thread is considered to be a waiter on this @addr, waiting to be woken up by a call to os_sync_wake_by_addr variants. If the value at @addr turns out to be different than expected, the calling thread returns immediately without blocking.

    This function is expected to be used for implementing synchronization primitives that do not have a sense of ownership (e.g. condition variables, semaphores) as it does not provide priority inversion avoidance. For locking primitives, it is recommended that you use existing OS primitives such as os_unfair_lock API family / pthread mutex or std::mutex.

    @param addr The userspace address to be used for atomic compare-and-wait. This address must be aligned to @size.

    @param value The value expected at @addr.

    @param size The size of @value, in bytes. This can be either 4 or 8 today. For @value of @size 4 bytes, the upper 4 bytes of @value are ignored.

    @param flags Flags to alter behavior of os_sync_wait_on_address. See os_sync_wait_on_address_flags_t.

    @return If the calling thread is woken up by a call to os_sync_wake_by_addr variants or the value at @addr is different than expected, this function returns successfully and the return value indicates the number of outstanding waiters blocked on this address. In the event of an error, returns -1 with errno set to indicate the error.

    EINVAL : Invalid flags or size. EINVAL : The @addr passed is NULL or misaligned. EINVAL : The operation associated with existing kernel state

    			at this @addr is inconsistent with what the caller
    			has requested.
    			It is important to make sure consistent values are
    			passed across wait and wake APIs for @addr, @size
    			and the shared memory specification
    			(See os_sync_wait_on_address_flags_t).
    
    

    It is possible for the os_sync_wait_on_address and its variants to perform an early return in the event of following errors where user may want to re-try the wait operation. E.g. low memory conditions could cause such early return. It is important to read the current value at the @addr before re-trying to ensure that the new value still requires waiting on @addr.

    ENOMEM : Unable to allocate memory for kernel internal data

    			structures.
    

    EINTR : The syscall was interrupted / spurious wake up. EFAULT : Unable to read value from the @addr. Kernel copyin failed.

    			It is possible to receive EFAULT error in following cases:
    			1. The @addr is an invalid address. This is a programmer error.
    			2. The @addr is valid; but, this is a transient error such as
    			due to low memory conditions. User may want to re-try the wait
    			operation.
    

    Following code snippet illustrates a possible re-try loop. <code> retry:

    current = atomic_load_explicit(addr, memory_order_relaxed);
    if (current != expected) {
    	int ret = os_sync_wait_on_address(addr, current, size, flags);
    	if ((ret < 0) && ((errno == EINTR) || (errno == EFAULT))) {
    		goto retry;
    	}
    

    } </code>

    os_sync_wait_on_address_with_deadline ¶

    os_sync_wait_on_address_with_deadline :: proc "c" (
    	addr:     rawptr, 
    	value:    u64, 
    	size:     uint, 
    	flags:    bit_set[os_sync_wait_on_address_flag; u32], 
    	clockid:  os_clockid, 
    	deadline: u64, 
    ) -> i32 ---
     

    This function is a variant of os_sync_wait_on_address that allows the calling thread to specify a deadline until which it is willing to block.

    @param addr The userspace address to be used for atomic compare-and-wait. This address must be aligned to @size.

    @param value The value expected at @addr.

    @param size The size of @value, in bytes. This can be either 4 or 8 today. For @value of @size 4 bytes, the upper 4 bytes of @value are ignored.

    @param flags Flags to alter behavior of os_sync_wait_on_address_with_deadline. See os_sync_wait_on_address_flags_t.

    @param clockid This value anchors @deadline argument to a specific clock id. See os_clockid_t.

    @param deadline This value is used to specify a deadline until which the calling thread is willing to block. Passing zero for the @deadline results in an error being returned. It is recommended to use os_sync_wait_on_address API to block indefinitely until woken up by a call to os_sync_wake_by_address_any or os_sync_wake_by_address_all APIs.

    @return If the calling thread is woken up by a call to os_sync_wake_by_addr variants or the value at @addr is different than expected, this function returns successfully and the return value indicates the number of outstanding waiters blocked on this address. In the event of an error, returns -1 with errno set to indicate the error.

    In addition to errors returned by os_sync_wait_on_address, this function can return the following additional error codes.

    EINVAL : Invalid clock id. EINVAL : The @deadline passed is 0. ETIMEDOUT : Deadline expired.

    os_sync_wait_on_address_with_timeout ¶

    os_sync_wait_on_address_with_timeout :: proc "c" (
    	addr:       rawptr, 
    	value:      u64, 
    	size:       uint, 
    	flags:      bit_set[os_sync_wait_on_address_flag; u32], 
    	clockid:    os_clockid, 
    	timeout_ns: u64, 
    ) -> i32 ---
     

    This function is a variant of os_sync_wait_on_address that allows the calling thread to specify a timeout until which it is willing to block.

    @param addr The userspace address to be used for atomic compare-and-wait. This address must be aligned to @size.

    @param value The value expected at @addr.

    @param size The size of @value, in bytes. This can be either 4 or 8 today. For @value of @size 4 bytes, the upper 4 bytes of @value are ignored.

    @param flags Flags to alter behavior of os_sync_wait_on_address_with_timeout. See os_sync_wait_on_address_flags_t.

    @param clockid This value anchors @timeout_ns argument to a specific clock id. See os_clockid_t.

    @param timeout_ns This value is used to specify a timeout in nanoseconds until which the calling thread is willing to block. Passing zero for the @timeout_ns results in an error being returned. It is recommended to use os_sync_wait_on_address API to block indefinitely until woken up by a call to os_sync_wake_by_address_any or os_sync_wake_by_address_all APIs.

    @return If the calling thread is woken up by a call to os_sync_wake_by_address variants or the value at @addr is different than expected, this function returns successfully and the return value indicates the number of outstanding waiters blocked on this address. In the event of an error, returns -1 with errno set to indicate the error.

    In addition to errors returned by os_sync_wait_on_address, this function can return the following additional error codes.

    EINVAL : Invalid clock id. EINVAL : The @timeout_ns passed is 0. ETIMEDOUT : Timeout expired.

    os_sync_wake_by_address_all ¶

    os_sync_wake_by_address_all :: proc "c" (addr: rawptr, size: uint, flags: bit_set[os_sync_wait_on_address_flag; u32]) -> i32 ---
     

    This function is a variant of os_sync_wake_by_address_any that wakes up all waiters blocked in os_sync_wait_on_address or its variants.

    @param addr The userspace address to be used for waking up the blocked waiters. It should be same as what is passed to os_sync_wait_on_address or its variants.

    @param size The size of lock value, in bytes. This can be either 4 or 8 today. It should be same as what is passed to os_sync_wait_on_address or its variants.

    @param flags Flags to alter behavior of os_sync_wake_by_address_all. See os_sync_wake_by_address_flags_t.

    @return Returns 0 on success. In the event of an error, returns -1 with errno set to indicate the error.

    This function returns same error codes as returned by os_sync_wait_on_address.

    os_sync_wake_by_address_any ¶

    os_sync_wake_by_address_any :: proc "c" (addr: rawptr, size: uint, flags: bit_set[os_sync_wait_on_address_flag; u32]) -> i32 ---
     

    This function wakes up one waiter out of all those blocked in os_sync_wait_on_address or its variants on the @addr. No guarantee is provided about which specific waiter is woken up.

    @param addr The userspace address to be used for waking up the blocked waiter. It should be same as what is passed to os_sync_wait_on_address or its variants.

    @param size The size of lock value, in bytes. This can be either 4 or 8 today. It should be same as what is passed to os_sync_wait_on_address or its variants.

    @param flags Flags to alter behavior of os_sync_wake_by_address_any. See os_sync_wake_by_address_flags_t.

    @return Returns 0 on success. In the event of an error, returns -1 with errno set to indicate the error.

    EINVAL : Invalid flags or size. EINVAL : The @addr passed is NULL. EINVAL : The operation associated with existing kernel state

    			at this @addr is inconsistent with what caller
    			has requested.
    			It is important to make sure consistent values are
    			passed across wait and wake APIs for @addr, @size
    			and the shared memory specification
    			(See os_sync_wake_by_address_flags_t).
    

    ENOENT : No waiter(s) found waiting on the @addr.

    semaphore_create ¶

    semaphore_create :: proc "c" (task: task_t, semaphore: ^semaphore_t, policy, value: i32) -> kern_return_t ---

    semaphore_destroy ¶

    semaphore_destroy :: proc "c" (task: task_t, semaphore: semaphore_t) -> kern_return_t ---

    semaphore_signal ¶

    semaphore_signal :: proc "c" (semaphore: semaphore_t) -> kern_return_t ---

    semaphore_signal_all ¶

    semaphore_signal_all :: proc "c" (semaphore: semaphore_t) -> kern_return_t ---

    semaphore_signal_thread ¶

    semaphore_signal_thread :: proc "c" (semaphore: semaphore_t, thread: thread_act_t) -> kern_return_t ---

    semaphore_wait ¶

    semaphore_wait :: proc "c" (semaphore: semaphore_t) -> kern_return_t ---

    sys_chmod ¶

    sys_chmod :: proc(path: string, mode: bit_set[Permission_Enum; u16]) -> bool {…}

    sys_lseek ¶

    sys_lseek :: proc(fd: i32, offset: i64, whence: Offset_From) -> i64 {…}

    sys_lstat ¶

    sys_lstat :: proc(path: string, status: ^__DARWIN_STRUCT_STAT64) -> bool {…}

    sys_mkdir ¶

    sys_mkdir :: proc(path: string, mode: bit_set[Permission_Enum; u16]) -> bool {…}

    sys_mkdir_at ¶

    sys_mkdir_at :: proc(fd: i32, path: string, mode: bit_set[Permission_Enum; u16]) -> bool {…}

    sys_open ¶

    sys_open :: proc(path: string, oflag: bit_set[Open_Flags_Enum; u16], mode: bit_set[Permission_Enum; u16]) -> (i32, bool) {…}

    sys_rename ¶

    sys_rename :: proc(path: string, new_path: string) -> bool {…}

    sys_rename_at ¶

    sys_rename_at :: proc(fd: i32, path: string, to_fd: i32, new_path: string) -> bool {…}

    sys_rmdir ¶

    sys_rmdir :: proc(path: string, mode: bit_set[Permission_Enum; u16]) -> bool {…}

    sys_write_string ¶

    sys_write_string :: proc(fd: i32, message: string) -> bool {…}
     

    this package uses the sys prefix for the proc names to indicate that these aren't native syscalls but directly call such

    syscall_access ¶

    syscall_access :: proc "contextless" (path: cstring, mode: i32) -> i32 {…}

    syscall_adjtime ¶

    syscall_adjtime :: proc "contextless" (delta: ^_STRUCT_TIMEVAL, old_delta: ^_STRUCT_TIMEVAL) -> i32 {…}

    syscall_chdir ¶

    syscall_chdir :: proc "contextless" (path: cstring) -> i32 {…}

    syscall_chmod ¶

    syscall_chmod :: proc "contextless" (path: cstring, mode: u32) -> i32 {…}

    syscall_close ¶

    syscall_close :: proc "contextless" (fd: i32) -> bool {…}

    syscall_copyfile ¶

    syscall_copyfile :: proc "contextless" (from: cstring, to: cstring, state: rawptr, flags: u32) -> i32 {…}

    syscall_dup ¶

    syscall_dup :: proc "contextless" (fd: i32) -> i32 {…}

    syscall_execve ¶

    syscall_execve :: proc "contextless" (path: cstring, argv: [^]cstring, env: [^]cstring) -> i32 {…}

    syscall_exit ¶

    syscall_exit :: proc "contextless" (code: i32) {…}

    syscall_faccessat ¶

    syscall_faccessat :: proc "contextless" (fd: i32, path: cstring, mode: i32, flag: i32) -> i32 {…}

    syscall_fchdir ¶

    syscall_fchdir :: proc "contextless" (fd: i32, path: cstring) -> i32 {…}

    syscall_fchmod ¶

    syscall_fchmod :: proc "contextless" (fildes: i32, mode: u32) -> i32 {…}

    syscall_fcntl ¶

    syscall_fcntl :: proc "contextless" (fd: i32, cmd: i32, other: rawptr) -> i32 {…}
     

    think about this? last arg should be more than one

    syscall_flock ¶

    syscall_flock :: proc "contextless" (fd: i32, operation: i32) -> i32 {…}

    syscall_fstat ¶

    syscall_fstat :: proc "contextless" (fd: i32, status: ^__DARWIN_STRUCT_STAT64) -> i32 {…}

    syscall_fstatat ¶

    syscall_fstatat :: proc "contextless" (fd: i32, path: cstring, status: ^__DARWIN_STRUCT_STAT64) -> i32 {…}

    syscall_fsync ¶

    syscall_fsync :: proc "contextless" (fildes: i32) -> bool {…}

    syscall_ftruncate ¶

    syscall_ftruncate :: proc "contextless" (fd: i32, length: i64) -> i32 {…}

    syscall_futimes ¶

    syscall_futimes :: proc "contextless" (fd: i32, times: ^_STRUCT_TIMEVAL) -> i32 {…}

    syscall_getdirentries ¶

    syscall_getdirentries :: proc "contextless" (fd: i32, buf: ^u8, nbytes: i32, base_pointer: ^u32) -> i32 {…}

    syscall_getentropy ¶

    syscall_getentropy :: proc "contextless" (buf: [^]u8, buflen: u64) -> i32 {…}

    syscall_getrusage ¶

    syscall_getrusage :: proc "contextless" (who: i32, rusage: ^RUsage) -> i32 {…}

    syscall_gettid ¶

    syscall_gettid :: proc "contextless" () -> u64 {…}

    syscall_kill ¶

    syscall_kill :: proc "contextless" (pid: i32, sig: i32) -> i32 {…}
    syscall_link :: proc "contextless" (path: cstring, to_link: cstring) -> i32 {…}

    syscall_linkat ¶

    syscall_linkat :: proc "contextless" (fd: i32, path: cstring, fd2: i32, to_link: cstring) -> i32 {…}

    syscall_lseek ¶

    syscall_lseek :: proc "contextless" (fd: i32, offset: i64, whence: i32) -> i64 {…}

    syscall_lstat ¶

    syscall_lstat :: proc "contextless" (path: cstring, status: ^__DARWIN_STRUCT_STAT64) -> i32 {…}

    syscall_mkdir ¶

    syscall_mkdir :: proc "contextless" (path: cstring, mode: u32) -> i32 {…}

    syscall_mkdir_at ¶

    syscall_mkdir_at :: proc "contextless" (fd: i32, path: cstring, mode: u32) -> i32 {…}

    syscall_mmap ¶

    syscall_mmap :: proc "contextless" (
    	addr:   ^u8, 
    	len:    u64, 
    	port:   i32, 
    	flags:  i32, 
    	fd:     int, 
    	offset: i64, 
    ) -> ^u8 {…}

    syscall_munmap ¶

    syscall_munmap :: proc "contextless" (addr: rawptr, len: u64) -> i32 {…}

    syscall_open ¶

    syscall_open :: proc "contextless" (path: cstring, oflag: u32, mode: u32) -> i32 {…}

    syscall_openat ¶

    syscall_openat :: proc "contextless" (fd: int, path: cstring, oflag: u32, mode: u32) -> i32 {…}

    syscall_pipe ¶

    syscall_pipe :: proc "contextless" (fds: [^]i32) -> i32 {…}

    syscall_proc_info ¶

    syscall_proc_info :: proc "contextless" (
    	num:         i32, 
    	pid:         u32, 
    	flavor:      i32, 
    	arg:         u64, 
    	buffer:      rawptr, 
    	buffer_size: i32, 
    ) -> i32 {…}

    syscall_read ¶

    syscall_read :: proc "contextless" (fildes: i32, buf: ^u8, nbyte: u64) -> i64 {…}
    syscall_readlink :: proc "contextless" (path: cstring, buf: ^u8, buf_size: u64) -> i64 {…}

    syscall_readlinkat ¶

    syscall_readlinkat :: proc "contextless" (fd: i32, path: cstring, buf: ^u8, buf_size: u64) -> i64 {…}

    syscall_rename ¶

    syscall_rename :: proc "contextless" (path_old: cstring, path_new: cstring) -> i32 {…}

    syscall_rename_at ¶

    syscall_rename_at :: proc "contextless" (from_fd: i32, from: cstring, to_fd: i32, to: cstring) -> i32 {…}

    syscall_rmdir ¶

    syscall_rmdir :: proc "contextless" (path: cstring, mode: u32) -> i32 {…}

    syscall_stat ¶

    syscall_stat :: proc "contextless" (path: cstring, status: ^__DARWIN_STRUCT_STAT64) -> i32 {…}

    syscall_sysctl ¶

    syscall_sysctl :: proc "contextless" (
    	name:    ^i32, 
    	namelen: u32, 
    	oldp:    rawptr, 
    	oldlenp: ^i64, 
    	newp:    ^i8, 
    	newlen:  i64, 
    ) -> i32 {…}

    syscall_sysctlbyname ¶

    syscall_sysctlbyname :: proc "contextless" (name: cstring, oldp: rawptr, oldlenp: ^i64, newp: rawptr, newlen: i64) -> i32 {…}

    syscall_truncate ¶

    syscall_truncate :: proc "contextless" (path: cstring, length: i64) -> i32 {…}

    syscall_utimes ¶

    syscall_utimes :: proc "contextless" (path: cstring, times: ^_STRUCT_TIMEVAL) -> i32 {…}

    syscall_write ¶

    syscall_write :: proc "contextless" (fildes: i32, buf: ^u8, nbyte: u64) -> bool {…}

    unix_offset_syscall ¶

    unix_offset_syscall :: proc "contextless" (number: System_Call_Number) -> uintptr {…}

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2024-04 (vendor "odin") Windows_amd64 @ 2024-04-26 21:08:58.651230000 +0000 UTC