public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Basile Starynkevitch <basile@starynkevitch.net>
To: Lucas Augusto Valentim Dantas <lucasvalentim@outlook.com.br>
Cc: libc-help@sourceware.org
Subject: Re: errnos.h usage
Date: Wed, 14 Feb 2024 08:58:07 +0100	[thread overview]
Message-ID: <406d99f0-e577-4b01-b8ab-ca543672cbd6@starynkevitch.net> (raw)
In-Reply-To: <ROAP284MB2203AF5516D8A7FEB4F452558A4E2@ROAP284MB2203.BRAP284.PROD.OUTLOOK.COM>

[-- 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

      parent reply	other threads:[~2024-02-14  7:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14  4:59 Lucas Augusto Valentim Dantas
2024-02-14  7:53 ` Konstantin Kharlamov
2024-02-14  7:58 ` Basile Starynkevitch [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=406d99f0-e577-4b01-b8ab-ca543672cbd6@starynkevitch.net \
    --to=basile@starynkevitch.net \
    --cc=libc-help@sourceware.org \
    --cc=lucasvalentim@outlook.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).