gpg_err_code_from_errno usage

Nikos Mavrogiannopoulos nmav at
Sat Mar 11 11:52:26 CET 2006

On Sat 11 Mar 2006 10:45, Marcus Brinkmann wrote:

> > But how can you be sure that calloc() (or in that case gcry_calloc)
> > will set the errno? calloc is a library call which may or may not
> > use a system call. Even if it works on some systems, this is a very
> > non-portable construction, which will result in no error checking
> > in systems that do not set errno.
> It's not in ISO C, but in POSIX.  Single Unix v3 has:

Maybe but this doesn't change my argument. It is less portable than
the ISO/ANSI C  behavior. Given that libgcrypt is already ported to 
non-UNIX systems as well[0], I would consider this a bug.

[0]. Even older unix systems may not support that.


Nikos Mavrogiannopoulos

More information about the Gcrypt-devel mailing list