public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* errnos.h usage
@ 2024-02-14  4:59 Lucas Augusto Valentim Dantas
  2024-02-14  7:53 ` Konstantin Kharlamov
  2024-02-14  7:58 ` Basile Starynkevitch
  0 siblings, 2 replies; 3+ messages in thread
From: Lucas Augusto Valentim Dantas @ 2024-02-14  4:59 UTC (permalink / raw)
  To: libc-help

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]

Hello, I have been playing around with Doom's source code, the 90s one, and I have noticed that it has a header included named errnos.h that I have recently learned that it was actually present in glibc beginning from 2.0.0 (I think) until 2.0.7. Could anyone shed light on why it was added to glibc and later removed?

https://sources.debian.org/src/glibc/2.0.7t-1/sysdeps/unix/sysv/linux/errnos.h/
https://github.com/id-Software/DOOM/blob/master/linuxdoom-1.10/i_video.c#L49

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

* Re: errnos.h usage
  2024-02-14  4:59 errnos.h usage Lucas Augusto Valentim Dantas
@ 2024-02-14  7:53 ` Konstantin Kharlamov
  2024-02-14  7:58 ` Basile Starynkevitch
  1 sibling, 0 replies; 3+ messages in thread
From: Konstantin Kharlamov @ 2024-02-14  7:53 UTC (permalink / raw)
  To: Lucas Augusto Valentim Dantas, libc-help

On Wed, 2024-02-14 at 04:59 +0000, Lucas Augusto Valentim Dantas via
Libc-help wrote:
> Hello, I have been playing around with Doom's source code, the 90s
> one, and I have noticed that it has a header included named errnos.h
> that I have recently learned that it was actually present in glibc
> beginning from 2.0.0 (I think) until 2.0.7. Could anyone shed light
> on why it was added to glibc and later removed?
>
> https://sources.debian.org/src/glibc/2.0.7t-1/sysdeps/unix/sysv/linux/errnos.h/
> https://github.com/id-Software/DOOM/blob/master/linuxdoom-1.10/i_video.c#L49

Judging by the commit 5107cf1d7d27f17c6de68ec15a8e8d9dd5b471c1 description from 1997:

>            * sysdeps/mach/hurd/errnos.h: -> .../bits/errno.h
>            * sysdeps/standalone/arm/errnos.h: Likewise.
>            * sysdeps/stub/errnos.h: Likewise.
>            * sysdeps/unix/bsd/bsd4.4/errnos.h: Likewise.
>            * sysdeps/unix/sysv/linux/errnos.h: Likewise.

all platform-specific `errnos.h` were merged into a single file `errno.h`.

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

* Re: errnos.h usage
  2024-02-14  4:59 errnos.h usage Lucas Augusto Valentim Dantas
  2024-02-14  7:53 ` Konstantin Kharlamov
@ 2024-02-14  7:58 ` Basile Starynkevitch
  1 sibling, 0 replies; 3+ messages in thread
From: Basile Starynkevitch @ 2024-02-14  7:58 UTC (permalink / raw)
  To: Lucas Augusto Valentim Dantas; +Cc: libc-help

[-- Attachment #1: Type: text/plain, Size: 2372 bytes --]

Hello from near Paris in France,

On 2/14/24 05:59, Lucas Augusto Valentim Dantas via Libc-help wrote:
> Hello, I have been playing around with Doom's source code, the 90s one, and I have noticed that it has a header included named errnos.h that I have recently learned that it was actually present in glibc beginning from 2.0.0 (I think) until 2.0.7. Could anyone shed light on why it was added to glibc and later removed?
I can't explain why it was added. I can guess why it was removed.
>
> https://sources.debian.org/src/glibc/2.0.7t-1/sysdeps/unix/sysv/linux/errnos.h/
> https://github.com/id-Software/DOOM/blob/master/linuxdoom-1.10/i_video.c#L49


Maybe because errnos.h is no more in standard C or in POSIX. But errno.h 
is standard. See also https://man7.org/linux/man-pages/man3/errno.3.html
<https://man7.org/linux/man-pages/man3/errno.3.html>>

and https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf or buy 
from your ISO representative <https://www.iso.org/standard/74528.html> 
the formal C standard book.


 From my human (and perhaps wrong) memory, errnos.h existed on old 
operating systems and computers like Sun4/110 workstation with a 
SunOS3.5 (this was in the early 1990s, I worked then as a software 
developer at CEA <https://www.cea.fr/>). I don't have that header file 
on my current Debian/Sid/amd64 desktop.

Today, using errno actually requires the #include <errno.h> preprocessor 
directive, and on my Linux system it is a macro defined in 
/usr/include/errno.h as

> rimski.x86_64 ~/misc-basile 8:45 .0 %grep  errno_/usr/include/errno.h_  
>   *	ISO C99 Standard: 7.5 Errors	<errno.h>
> #include <bits/errno.h>
> extern int *__errno_location (void) __THROW __attribute_const__;
> # define errno (*__errno_location ())
> #endif /* errno.h */

And today my pet open source project is the RefPerSys 
<http://refpersys.org/> inference engine (*REF*lective *PER*sistent 
*SYS*tem, GPLv3+ licensed) on https://github.com/RefPerSys/RefPerSys/ ; 
if you know someone who wants to contribute, please forward to him/her 
this email.

Thanks for reading.

Regards

<https://man7.org/linux/man-pages/man3/errno.3.html>>

-- 
Basile Starynkevitch<basile@starynkevitch.net>
(only mine opinions / les opinions sont miennes uniquement)
92340 Bourg-la-Reine, France
web page: starynkevitch.net/Basile/
See/voir:https://github.com/RefPerSys/RefPerSys

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

end of thread, other threads:[~2024-02-14  7:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-14  4:59 errnos.h usage Lucas Augusto Valentim Dantas
2024-02-14  7:53 ` Konstantin Kharlamov
2024-02-14  7:58 ` Basile Starynkevitch

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).