bug-libsigsegv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: perhaps a dumb question re libsigsegv


From: Dennis Clarke
Subject: Re: perhaps a dumb question re libsigsegv
Date: Sun, 9 Oct 2022 16:19:16 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 10/8/22 14:05, Bruno Haible wrote:
[CCing the mailing list.]

Dennis Clarke wrote:

Should libsigsegv be a C99 clean code base ? I have been looking at
libsigsegv back to 2.12 on FreeBSD amd64 and on Linux ppc64 and a few
other places and mmap() simply will not work with MAP_ANONYMOUS when I
ask for strict C99 or even C11.

.
.
.
So I guess the question is , gee, what is the C lang spec that I should
be using on all platforms for this ?

First, you should be aware what relevant standards exist:
   - C,
   - POSIX: contains additional functions typically found on Unix-like systems,
   - GNU: roughly the same as the LSB, contains additional functions provided
     by the glibc. (And remember that glibc provides access to most Linux
     kernel system calls.)

The C standard can be chosen for a program that is written in portable C,
for example a program that computes and prints N digits of pi.

The POSIX standard can be chosen for a program that uses Unix features (e.g.
mmap), for example a database program.

The GNU "standard" should be chosen for a program that accesses all kinds
of non-portable features.

Second, the GCC manual [1] translates these choices into command-line options
for GCC.

Now, ask yourself: In which category is GNU libsigsegv? A library which makes
use of a signal 'SIGSEGV', which exists in POSIX but not in C.

Bruno

[1] https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/C-Dialect-Options.html




Well that explains why I can do such things on the old Solaris systems
 but not on Linux. I have been edified !

--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional



reply via email to

[Prev in Thread] Current Thread [Next in Thread]