Skip to content

Conversation

krobelus
Copy link
Contributor

@krobelus krobelus commented Oct 6, 2025

According to
https://man.netbsd.org/confstr.3

_CS_PATH is obsoleted by sysctl (which has a USER_CS_PATH equivalent),
but Linux doesn't have that.

So the simplest thing for applications is to use _CS_PATH which is
part of POSIX. Define, matching the <unistd.h> header.

We could maybe share this definition in src/unix/bsd/netbsdlike/mod.rs,
but I saw that existing definitions are not shared either, so I'm
not sure.

$ grep src/unix/bsd/netbsdlike -e _PC_LINK_MAX
src/unix/bsd/netbsdlike/netbsd/mod.rs:1599:11:pub const _PC_LINK_MAX: c_int = 1;
src/unix/bsd/netbsdlike/openbsd/mod.rs:1193:11:pub const _PC_LINK_MAX: c_int = 1;

Originally reported in fish-shell/fish-shell#11892

@rustbot
Copy link
Collaborator

rustbot commented Oct 6, 2025

Some changes occurred in OpenBSD module

cc @semarie

Copy link
Contributor

@semarie semarie left a comment

Choose a reason for hiding this comment

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

  • LGTM for OpenBSD part
  • but you added _CS_PATH in netbsd.txt and I don't see corresponding mod.rs edited

According to 
https://man.netbsd.org/confstr.3

_CS_PATH is obsoleted by sysctl (which has a USER_CS_PATH equivalent),
but Linux doesn't have that.

So the simplest thing for applications is to use _CS_PATH which is
part of POSIX. Define, matching the <unistd.h> header.

We could maybe share this definition in src/unix/bsd/netbsdlike/mod.rs,
but I saw that existing definitions are not shared either, so I'm
not sure.

	$ grep src/unix/bsd/netbsdlike -e _PC_LINK_MAX
	src/unix/bsd/netbsdlike/netbsd/mod.rs:1599:11:pub const _PC_LINK_MAX: c_int = 1;
	src/unix/bsd/netbsdlike/openbsd/mod.rs:1193:11:pub const _PC_LINK_MAX: c_int = 1;


Originally reported in fish-shell/fish-shell#11892
Copy link
Contributor

@semarie semarie left a comment

Choose a reason for hiding this comment

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

LGTM thanks.
Please note that currently people able to merge seems to be busy. it could take some time to be merged.

Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Thank you!

@JohnTitor JohnTitor added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Oct 6, 2025
@JohnTitor JohnTitor added this pull request to the merge queue Oct 6, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 6, 2025
@JohnTitor JohnTitor added this pull request to the merge queue Oct 7, 2025
Merged via the queue into rust-lang:main with commit b1be455 Oct 7, 2025
51 of 52 checks passed
JohnTitor pushed a commit to JohnTitor/libc that referenced this pull request Oct 9, 2025
According to
https://man.netbsd.org/confstr.3

_CS_PATH is obsoleted by sysctl (which has a USER_CS_PATH equivalent),
but Linux doesn't have that.

So the simplest thing for applications is to use _CS_PATH which is
part of POSIX. Define, matching the <unistd.h> header.

We could maybe share this definition in src/unix/bsd/netbsdlike/mod.rs,
but I saw that existing definitions are not shared either, so I'm
not sure.

	$ grep src/unix/bsd/netbsdlike -e _PC_LINK_MAX
	src/unix/bsd/netbsdlike/netbsd/mod.rs:1599:11:pub const _PC_LINK_MAX: c_int = 1;
	src/unix/bsd/netbsdlike/openbsd/mod.rs:1193:11:pub const _PC_LINK_MAX: c_int = 1;

Originally reported in fish-shell/fish-shell#11892

(backport rust-lang#4738)

(cherry picked from commit b1be455)
@JohnTitor JohnTitor mentioned this pull request Oct 9, 2025
github-merge-queue bot pushed a commit that referenced this pull request Oct 9, 2025
According to
https://man.netbsd.org/confstr.3

_CS_PATH is obsoleted by sysctl (which has a USER_CS_PATH equivalent),
but Linux doesn't have that.

So the simplest thing for applications is to use _CS_PATH which is
part of POSIX. Define, matching the <unistd.h> header.

We could maybe share this definition in src/unix/bsd/netbsdlike/mod.rs,
but I saw that existing definitions are not shared either, so I'm
not sure.

	$ grep src/unix/bsd/netbsdlike -e _PC_LINK_MAX
	src/unix/bsd/netbsdlike/netbsd/mod.rs:1599:11:pub const _PC_LINK_MAX: c_int = 1;
	src/unix/bsd/netbsdlike/openbsd/mod.rs:1193:11:pub const _PC_LINK_MAX: c_int = 1;

Originally reported in fish-shell/fish-shell#11892

(backport #4738)

(cherry picked from commit b1be455)
@JohnTitor JohnTitor added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-dragonfly O-unix stable-applied This PR has been cherry-picked to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants