Bug 31661 - NPROCESSORS_CONF and NPROCESSORS_ONLN not available in getconf
Summary: NPROCESSORS_CONF and NPROCESSORS_ONLN not available in getconf
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.38
: P2 normal
Target Milestone: 2.40
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-19 21:13 UTC by Mohamed Akram
Modified: 2024-06-15 14:17 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
add NPROCESSORS_CONF and NPROCESSORS_ONLN to getconf (260 bytes, patch)
2024-05-04 11:13 UTC, Mohamed Akram
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mohamed Akram 2024-04-19 21:13:25 UTC
getconf should support `NPROCESSORS_CONF` and `NPROCESSORS_ONLN`, without a leading underscore, as specified in POSIX:

https://austingroupbugs.net/view.php?id=339

This is already supported in macOS, FreeBSD, Solaris and other operating systems.
Comment 1 Mohamed Akram 2024-05-04 11:13:44 UTC
Created attachment 15492 [details]
add NPROCESSORS_CONF and NPROCESSORS_ONLN to getconf
Comment 2 Adhemerval Zanella 2024-05-06 12:28:50 UTC
(In reply to Mohamed Akram from comment #1)
> Created attachment 15492 [details]
> add NPROCESSORS_CONF and NPROCESSORS_ONLN to getconf

Could you please send the patch to libc-alpha for revision? The wiki has all the information on how to do [1].

[1] https://sourceware.org/glibc/wiki/Contribution%20checklist
Comment 3 Mohamed Akram 2024-05-30 14:07:34 UTC
(In reply to Adhemerval Zanella from comment #2)
> (In reply to Mohamed Akram from comment #1)
> > Created attachment 15492 [details]
> > add NPROCESSORS_CONF and NPROCESSORS_ONLN to getconf
> 
> Could you please send the patch to libc-alpha for revision? The wiki has all
> the information on how to do [1].
> 
> [1] https://sourceware.org/glibc/wiki/Contribution%20checklist

Thank you, I've sent a patch.
Comment 4 Andreas K. Huettel 2024-06-15 14:17:43 UTC
commit 2f7246015c0d0760ab4529c4b13b2816337bed35
Author: Mohamed Akram <mohd.akram@outlook.com>
Date:   Thu May 30 18:05:50 2024 +0400

    getconf: Add NPROCESSORS_{CONF,ONLN} [BZ #31661]
    
    These are required by the upcoming POSIX standard and are available on
    other platforms.
    
    Link: https://austingroupbugs.net/view.php?id=339
    Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
    Reviewed-by: Arjun Shankar <arjun@redhat.com>