Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3736,7 +3736,11 @@ pub const MNT_NOWAIT: c_int = 2;

// <mach/thread_policy.h>
pub const THREAD_STANDARD_POLICY: c_int = 1;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const THREAD_STANDARD_POLICY_COUNT: c_int = 0;

Comment on lines +3739 to +3743

@tgross35 tgross35 Jun 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be okay since it has a value of 0?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's meant to denote a number of arguments. Each thread policy is parameterized. The standard thread policy is the default. It requires no parameters. It's declared in [1].

It's value has been the same for over three decades. Though the choice of declaration has changed. Five years ago they hardcoded the 0 value [2]. It had been using a more programmatic expression before that. Maybe that's indicative of a commitment?

pub const THREAD_EXTENDED_POLICY: c_int = 1;
pub const THREAD_TIME_CONSTRAINT_POLICY: c_int = 2;
pub const THREAD_PRECEDENCE_POLICY: c_int = 3;
Expand Down Expand Up @@ -3798,7 +3802,11 @@ pub const VM_PAGE_QUERY_PAGE_CS_NX: i32 = 0x400;

// mach/task_info.h
pub const TASK_THREAD_TIMES_INFO: u32 = 3;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const HOST_CPU_LOAD_INFO_COUNT: u32 = 4;

pub const MACH_TASK_BASIC_INFO: u32 = 20;

pub const MACH_PORT_NULL: i32 = 0;
Expand Down Expand Up @@ -3861,7 +3869,10 @@ pub const COPYFILE_STATE_DST_BSIZE: c_int = 12;
pub const COPYFILE_STATE_BSIZE: c_int = 13;

// <sys/attr.h>
/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const ATTR_BIT_MAP_COUNT: c_ushort = 5;

pub const FSOPT_NOFOLLOW: u32 = 0x1;
pub const FSOPT_NOFOLLOW_ANY: u32 = 0x800;
pub const FSOPT_REPORT_FULLSIZE: u32 = 0x4;
Expand Down Expand Up @@ -4032,36 +4043,73 @@ const fn __DARWIN_ALIGN32(p: usize) -> usize {
(p + __DARWIN_ALIGNBYTES32) & !__DARWIN_ALIGNBYTES32
}

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t =
(size_of::<thread_extended_policy_data_t>() / size_of::<integer_t>()) as mach_msg_type_number_t;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t =
(size_of::<thread_time_constraint_policy_data_t>() / size_of::<integer_t>())
as mach_msg_type_number_t;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t =
(size_of::<thread_precedence_policy_data_t>() / size_of::<integer_t>())
as mach_msg_type_number_t;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t =
(size_of::<thread_affinity_policy_data_t>() / size_of::<integer_t>()) as mach_msg_type_number_t;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t =
(size_of::<thread_background_policy_data_t>() / size_of::<integer_t>())
as mach_msg_type_number_t;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t =
(size_of::<thread_latency_qos_policy_data_t>() / size_of::<integer_t>())
as mach_msg_type_number_t;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t =
(size_of::<thread_throughput_qos_policy_data_t>() / size_of::<integer_t>())
as mach_msg_type_number_t;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t =
(size_of::<thread_basic_info_data_t>() / size_of::<integer_t>()) as mach_msg_type_number_t;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t =
(size_of::<thread_identifier_info_data_t>() / size_of::<integer_t>()) as mach_msg_type_number_t;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t =
(size_of::<thread_extended_info_data_t>() / size_of::<integer_t>()) as mach_msg_type_number_t;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const TASK_THREAD_TIMES_INFO_COUNT: u32 =
(size_of::<task_thread_times_info_data_t>() / size_of::<natural_t>()) as u32;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const MACH_TASK_BASIC_INFO_COUNT: u32 =
(size_of::<mach_task_basic_info_data_t>() / size_of::<natural_t>()) as u32;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t =
(size_of::<vm_statistics64_data_t>() / size_of::<integer_t>()) as mach_msg_type_number_t;

Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,9 @@ pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: c_int = 8;
pub const NFNL_SUBSYS_CTHELPER: c_int = 9;
pub const NFNL_SUBSYS_NFTABLES: c_int = 10;
pub const NFNL_SUBSYS_NFT_COMPAT: c_int = 11;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const NFNL_SUBSYS_COUNT: c_int = 12;

pub const NFNL_MSG_BATCH_BEGIN: c_int = NLMSG_MIN_TYPE;
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,9 @@ pub const NFNL_SUBSYS_CTHELPER: c_int = 9;
pub const NFNL_SUBSYS_NFTABLES: c_int = 10;
pub const NFNL_SUBSYS_NFT_COMPAT: c_int = 11;
pub const NFNL_SUBSYS_HOOK: c_int = 12;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const NFNL_SUBSYS_COUNT: c_int = 13;

pub const NFNL_MSG_BATCH_BEGIN: c_int = crate::NLMSG_MIN_TYPE;
Expand Down
3 changes: 3 additions & 0 deletions src/unix/solarish/illumos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ pub const PRIV_USER: c_uint = PRIV_DEBUG
| PRIV_AWARE_RESET
| PRIV_PFEXEC;

/// This symbol is prone to change across releases upstream.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const LGRP_RSRC_COUNT: crate::lgrp_rsrc_t = 2;

pub const LGRP_RSRC_CPU: crate::lgrp_rsrc_t = 0;
pub const LGRP_RSRC_MEM: crate::lgrp_rsrc_t = 1;

Expand Down