Skip to contentSkip to conversation

libc.7: Revise content

PATCH In review G. Branden Robinson 2 participants 2 messages Jan 15, 2023 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH v5 3/6 libc.7: Revise content

* Define the term "standard C library".
* Say who's responsible for standardizing it.
* Practically all C _libraries_ use libc, too.
* Move material describing structure glibc from intro(3) to here and recast in more detail.
* Update example filespec for libc.so.6.

---
 man7/libc.7 | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)
man7/libc.7 +26 -8
index c6180075c..09d21e7f5 100644
@@ -8,13 +8,18 @@
 libc \- overview of standard C libraries on Linux
 .SH DESCRIPTION
 The term \(lqlibc\(rq is commonly used as a shorthand for
-the \(lqstandard C library\(rq
-a library of standard functions that can be used by all C programs
-(and sometimes by programs in other languages).
-Because of some history
-(see below),
-use of the term \(lqlibc\(rq
-to refer to the standard C library is somewhat ambiguous on Linux.
+the
+.IR "standard C library" ,
+a collection of functions,
+data types,
+constants,
+and global variables \" like errno
+defined by ISO/IEC JTC1/\:SC22/\:WG14 and POSIX.1
+(the Austin Group)
+and used by practically all programs and libraries written in C.
+.I libc
+refers to any library that implements a significant portion of the
+published standard interface.
 .SS glibc
 The standard libc most popularly used with the Linux kernel is
 .UR http://www.gnu.org\:/software\:/libc/
@@ -33,13 +38,26 @@ primarily in section 3 of the manual.
 glibc also offers a manual of its own in Texinfo format,
 browsable at the command line with
 .RI \(lq "info libc" \(rq.
+.PP
+glibc is organized into three
+.I dynamic shared objects
+(DSOs):
+.I libc
+itself,
+.I libm
+for mathematical functions,
+and
+.I librt
+for real-time extensions
+(historically POSIX.1b).
 Version 1.0 of glibc was released in September 1992.
 (There were earlier 0.x releases.)
 The next major release of glibc was 2.0
 at the beginning of 1997.
 .PP
 The file
-.I /lib/libc.so.6
+.IR /lib/libc.so.6 ,
+.IR /lib/x86_64\-linux\-gnu/libc.so.6 ,
 or similar
 is normally a symbolic link to the glibc library.
 Execute it to display information about the version installed on your
Signature · 1 line
2.30.2
#1 lore raw

Hi Branden,

Quoted 25 lines · G. Branden Robinson

* Define the term "standard C library".
* Say who's responsible for standardizing it.
* Practically all C _libraries_ use libc, too.
* Move material describing structure glibc from intro(3) to here and recast in more detail.
* Update example filespec for libc.so.6.

---
  man7/libc.7 | 34 ++++++++++++++++++++++++++--------
  1 file changed, 26 insertions(+), 8 deletions(-)
man7/libc.7 +0 -5
index c6180075c..09d21e7f5 100644
@@ -8,13 +8,18 @@
  libc \- overview of standard C libraries on Linux
  .SH DESCRIPTION
  The term \(lqlibc\(rq is commonly used as a shorthand for
-the \(lqstandard C library\(rq
-a library of standard functions that can be used by all C programs
-(and sometimes by programs in other languages).
-Because of some history
-(see below),

man7/libc.7 line 18

Quoted 10 lines
man7/libc.7 +8 -2
-use of the term \(lqlibc\(rq
-to refer to the standard C library is somewhat ambiguous on Linux.
+the
+.IR "standard C library" ,
+a collection of functions,
+data types,
+constants,
+and global variables \" like errno
+defined by ISO/IEC JTC1/\:SC22/\:WG14 and POSIX.1
+(the Austin Group)

I'd just call it ISO C and POSIX.1, and defer to standards(7) for more details about the Austing group, WG14, and company.

man7/libc.7 line 19

Quoted 1 line
man7/libc.7 +1 -0
+and used by practically all programs and libraries written in C.

And actually, non-C too, unless you write static binaries :)

man7/libc.7 primarily in section 3 of the manual. · line 42

Quoted 12 lines
man7/libc.7 +5 -0
+.I libc
+refers to any library that implements a significant portion of the
+published standard interface.
  .SS glibc
  The standard libc most popularly used with the Linux kernel is
  .UR http://www.gnu.org\:/software\:/libc/
@@ -33,13 +38,26 @@ primarily in section 3 of the manual.
  glibc also offers a manual of its own in Texinfo format,
  browsable at the command line with
  .RI \(lq "info libc" \(rq.
+.PP
+glibc is organized into three

Why precise about glibc? A programmer should only care about the standard for these, right? If POSIX specifies some organization, programmers should normally link against the library that POSIX specifies. If POSIX says foo(3) is in libfoo.so, but glibc puts it in libbar.so, I will only document what POSIX says (of course glibc will make the magic so that a POSIX-conformant program would work).

This reminds me that I had a pending task: make sure that LIBRARY contents are right according to POSIX.

man7/libc.7 primarily in section 3 of the manual. · line 52

Quoted 10 lines
man7/libc.7 +10 -0
+.I dynamic shared objects
+(DSOs):
+.I libc
+itself,
+.I libm
+for mathematical functions,
+and
+.I librt
+for real-time extensions
+(historically POSIX.1b).

Is it? I thought there were more libraries. I'm thinking about libpthread, and maybe some others.

man7/libc.7 primarily in section 3 of the manual. · line 60

Quoted 9 lines
man7/libc.7 +2 -1
  Version 1.0 of glibc was released in September 1992.
  (There were earlier 0.x releases.)
  The next major release of glibc was 2.0
  at the beginning of 1997.
  .PP
  The file
-.I /lib/libc.so.6
+.IR /lib/libc.so.6 ,
+.IR /lib/x86_64\-linux\-gnu/libc.so.6 ,

How about adding a FILES section?

Cheers,

Alex

Quoted 3 lines
man7/libc.7 +0 -0
  or similar
  is normally a symbolic link to the glibc library.
  Execute it to display information about the version installed on your
Signature · 1 line
<http://www.alejandro-colomar.es/>