public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/29147] New: Wrong values for symbolic constants defined in limits.h
@ 2022-05-14 23:05 cquike at arcor dot de
  2022-05-14 23:05 ` [Bug libc/29147] getconf: " cquike at arcor dot de
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: cquike at arcor dot de @ 2022-05-14 23:05 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29147

            Bug ID: 29147
           Summary: Wrong values for symbolic constants defined in
                    limits.h
           Product: glibc
           Version: 2.34
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: cquike at arcor dot de
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 14102
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14102&action=edit
Potential patch

I am trying to understand the output of some of the values in getconf and I
came to the conclusion that a number of symbolic constants defined in limits.h
are not properly printed by getconf utility.

According to POSIX.1-2018
(https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getconf.html), the
getconf utility shall print "the symbolic constants listed under the headings
``Maximum Values'' and ``Minimum Values'' in the description of the <limits.h>
header". Quoting the reference book "Advanced Programming in the UNIX
environment": "Those minimum values do not change from one system to another.
They specify the most restrictive values for these features".

I realized first with the _POSIX_PIPE_BUF constant. According to POSIX.1-2018
(https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html) the
value must be 512. However, on a Fedora 35 machine:

# getconf -a | grep  _POSIX_PIPE_BUF
_POSIX_PIPE_BUF                    4096

Looking at the sources it seems that _POSIX_PIPE_BUF (the minimum value for
_any_ POSIX implementation) is using pathconf(_PC_PIPE_BUF, ...) which is the
value for _this_ specific implementation.

I have jot down a potential patch that fixes the problem (albeit only for
_POSIX_PIPE_BUF, not for the rest of the constants in limits.h) and have
attached it here.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2022-07-29 22:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-14 23:05 [Bug libc/29147] New: Wrong values for symbolic constants defined in limits.h cquike at arcor dot de
2022-05-14 23:05 ` [Bug libc/29147] getconf: " cquike at arcor dot de
2022-05-14 23:12 ` cquike at arcor dot de
2022-05-18 19:47 ` adhemerval.zanella at linaro dot org
2022-05-23 20:02 ` cquike at arcor dot de
2022-05-23 20:47 ` adhemerval.zanella at linaro dot org
2022-05-24  0:57 ` cquike at arcor dot de
2022-05-24  7:49 ` schwab@linux-m68k.org
2022-05-26 17:22 ` adhemerval.zanella at linaro dot org
2022-05-27 14:31 ` adhemerval.zanella at linaro dot org
2022-07-29 22:10 ` cquike at arcor dot de

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 read-only IMAP folder(s) and NNTP newsgroup(s).