Void Linux discussion
 help / color / mirror / Atom feed
* [PATCH] musl: move NPROCESSORS* constants to regular namespace
@ 2022-11-06  8:09 'Quentin Rameau' via voidlinux
  2022-11-06 18:07 ` Leah Neukirchen
  0 siblings, 1 reply; 5+ messages in thread
From: 'Quentin Rameau' via voidlinux @ 2022-11-06  8:09 UTC (permalink / raw)
  To: voidlinux

The constants _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN
have been included in POSIX-next[0] so we can already make them
available as they don't conflict with anything else.

Move them in their own commented caterogy, maybe,
once POSIX release has been done.

[0] https://austingroupbugs.net/view.php?id=339
---
 srcpkgs/musl/files/getconf.c | 4 ++--
 srcpkgs/musl/template        | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/musl/files/getconf.c b/srcpkgs/musl/files/getconf.c
index c4235242b0..5aebeb6b2a 100644
--- a/srcpkgs/musl/files/getconf.c
+++ b/srcpkgs/musl/files/getconf.c
@@ -170,8 +170,8 @@ static const struct conf_variable conf_table[] = {
 /* Commonly provided extensions */
 { "_PHYS_PAGES",		SYSCONF,	_SC_PHYS_PAGES		},
 { "_AVPHYS_PAGES",		SYSCONF,	_SC_AVPHYS_PAGES	},
-{ "_NPROCESSORS_CONF",		SYSCONF,	_SC_NPROCESSORS_CONF	},
-{ "_NPROCESSORS_ONLN",		SYSCONF,	_SC_NPROCESSORS_ONLN	},
+{ "NPROCESSORS_CONF",		SYSCONF,	_SC_NPROCESSORS_CONF	},
+{ "NPROCESSORS_ONLN",		SYSCONF,	_SC_NPROCESSORS_ONLN	},
 
 /* Data type related extensions */
 { "CHAR_BIT",			CONSTANT,	CHAR_BIT		},
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e6..34e6ed4fba 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure
-- 
2.38.1

-- 
You received this message because you are subscribed to the Google Groups "voidlinux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to voidlinux+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/voidlinux/Y2drn%2Bld0eiwWALG%40fifth.space.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] musl: move NPROCESSORS* constants to regular namespace
  2022-11-06  8:09 [PATCH] musl: move NPROCESSORS* constants to regular namespace 'Quentin Rameau' via voidlinux
@ 2022-11-06 18:07 ` Leah Neukirchen
  2022-11-06 19:05   ` 'Quentin Rameau' via voidlinux
  0 siblings, 1 reply; 5+ messages in thread
From: Leah Neukirchen @ 2022-11-06 18:07 UTC (permalink / raw)
  To: voidlinux; +Cc: Quentin Rameau

"'Quentin Rameau' via voidlinux" <voidlinux@googlegroups.com> writes:

> The constants _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN
> have been included in POSIX-next[0] so we can already make them
> available as they don't conflict with anything else.
>
> Move them in their own commented caterogy, maybe,
> once POSIX release has been done.

That will break current scripts using `getconf _NPROCESSORS_CONF`.
From the man page, it's not clear to me if things there need
underscores or not, but imo we should extend the script in a
backward-compatible way.

-- 
Leah Neukirchen  <leah@vuxu.org>  https://leahneukirchen.org/

-- 
You received this message because you are subscribed to the Google Groups "voidlinux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to voidlinux+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/voidlinux/87o7tkvtw7.fsf%40vuxu.org.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] musl: move NPROCESSORS* constants to regular namespace
  2022-11-06 18:07 ` Leah Neukirchen
@ 2022-11-06 19:05   ` 'Quentin Rameau' via voidlinux
  2022-11-06 19:05     ` [PATCH] musl: add " 'Quentin Rameau' via voidlinux
  2022-11-07 14:28     ` [PATCH] musl: move " Leah Neukirchen
  0 siblings, 2 replies; 5+ messages in thread
From: 'Quentin Rameau' via voidlinux @ 2022-11-06 19:05 UTC (permalink / raw)
  To: voidlinux

Hi Leah,

Thank you for taking the time to review this.

> That will break current scripts using `getconf _NPROCESSORS_CONF`.
> From the man page, it's not clear to me if things there need
> underscores or not, but imo we should extend the script in a
> backward-compatible way.

I highly doubt anybody is relying on the constants from the reserved
namespace, as on most other systems, those are exposed directly.

For the names, the POSIX getconf additions from the page I linked
explains it:

“The names NPROCESSORS_CONF and NPROCESSORS_ONLN. The values of these
configuration variables shall be determined as if they were obtained by
calling the function sysconf() with the argument _SC_NPROCESSORS_CONF
or _SC_NPROCESSORS_ONLN, respectively.”

This would be added in the section “system_var: A name of a
configuration variable. All of the following variables
shall be supported:”

I nevertheless kept the previous underscored versions just in case,
I suppose that we could remove those after the POSIX release.

Cheers!

-- 
You received this message because you are subscribed to the Google Groups "voidlinux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to voidlinux+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/voidlinux/20221106190558.26434-1-quinq%40fifth.space.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] musl: add NPROCESSORS* constants to regular namespace
  2022-11-06 19:05   ` 'Quentin Rameau' via voidlinux
@ 2022-11-06 19:05     ` 'Quentin Rameau' via voidlinux
  2022-11-07 14:28     ` [PATCH] musl: move " Leah Neukirchen
  1 sibling, 0 replies; 5+ messages in thread
From: 'Quentin Rameau' via voidlinux @ 2022-11-06 19:05 UTC (permalink / raw)
  To: voidlinux

The constants _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN
have been included in POSIX-next[0] so we can already make them
available as they don't conflict with anything else.

Move them in their own commented caterogy, maybe,
once POSIX release has been done.

The previous definitions are kept for backward-compatibility,
although most likely nobody uses those as they're undocumented
extensions of this implementation; remove them later.

[0] https://austingroupbugs.net/view.php?id=339
---
 srcpkgs/musl/files/getconf.c | 2 ++
 srcpkgs/musl/template        | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/musl/files/getconf.c b/srcpkgs/musl/files/getconf.c
index c4235242b0..0435e59345 100644
--- a/srcpkgs/musl/files/getconf.c
+++ b/srcpkgs/musl/files/getconf.c
@@ -172,6 +172,8 @@ static const struct conf_variable conf_table[] = {
 { "_AVPHYS_PAGES",		SYSCONF,	_SC_AVPHYS_PAGES	},
 { "_NPROCESSORS_CONF",		SYSCONF,	_SC_NPROCESSORS_CONF	},
 { "_NPROCESSORS_ONLN",		SYSCONF,	_SC_NPROCESSORS_ONLN	},
+{ "NPROCESSORS_CONF",		SYSCONF,	_SC_NPROCESSORS_CONF	},
+{ "NPROCESSORS_ONLN",		SYSCONF,	_SC_NPROCESSORS_ONLN	},
 
 /* Data type related extensions */
 { "CHAR_BIT",			CONSTANT,	CHAR_BIT		},
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 5bdc5c48e6..34e6ed4fba 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=10
+revision=11
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure
-- 
2.38.1

-- 
You received this message because you are subscribed to the Google Groups "voidlinux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to voidlinux+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/voidlinux/20221106190558.26434-2-quinq%40fifth.space.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] musl: move NPROCESSORS* constants to regular namespace
  2022-11-06 19:05   ` 'Quentin Rameau' via voidlinux
  2022-11-06 19:05     ` [PATCH] musl: add " 'Quentin Rameau' via voidlinux
@ 2022-11-07 14:28     ` Leah Neukirchen
  1 sibling, 0 replies; 5+ messages in thread
From: Leah Neukirchen @ 2022-11-07 14:28 UTC (permalink / raw)
  To: 'Quentin Rameau' via voidlinux; +Cc: Quentin Rameau

"'Quentin Rameau' via voidlinux" <voidlinux@googlegroups.com> writes:

> Hi Leah,
>
> Thank you for taking the time to review this.
>
>> That will break current scripts using `getconf _NPROCESSORS_CONF`.
>> From the man page, it's not clear to me if things there need
>> underscores or not, but imo we should extend the script in a
>> backward-compatible way.
>
> I highly doubt anybody is relying on the constants from the reserved
> namespace, as on most other systems, those are exposed directly.

It also works on glibc, and a few packages use it:

http://codesearch.debian.net/search?q=getconf+_NPROCESSORS_CONF&literal=1

-- 
Leah Neukirchen  <leah@vuxu.org>  https://leahneukirchen.org/

-- 
You received this message because you are subscribed to the Google Groups "voidlinux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to voidlinux+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/voidlinux/87k046x2i7.fsf%40vuxu.org.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-07 14:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-06  8:09 [PATCH] musl: move NPROCESSORS* constants to regular namespace 'Quentin Rameau' via voidlinux
2022-11-06 18:07 ` Leah Neukirchen
2022-11-06 19:05   ` 'Quentin Rameau' via voidlinux
2022-11-06 19:05     ` [PATCH] musl: add " 'Quentin Rameau' via voidlinux
2022-11-07 14:28     ` [PATCH] musl: move " Leah Neukirchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).