Hi, we regular use functions returning errno error code like ENOMEN or EINVAL. The return type of these functions is usually int. To underline that the return code is only an error code and should not be used otherwise a special type can be used. There is the ISO/ICE technical report 24731-1 which recommends they type errno_t for this purpose. I think it makes sense to stick with this recommendation (and I hope people don't mind that the same TR also recommends the not so smart *_s replacements for most of the standard libc functions).
The attached patch add a configure check for errno_t and defines it if not present in the system. bye, Sumit
>From ad5a2894e9404a3fba0f5f94a3a01b7f42b8df82 Mon Sep 17 00:00:00 2001 From: Sumit Bose <sb...@redhat.com> Date: Fri, 24 Jul 2009 22:41:17 +0200 Subject: [PATCH] add configure check for errno_t --- server/configure.ac | 2 ++ server/util/util.h | 4 ++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/server/configure.ac b/server/configure.ac index 5a9888b..d9e1e0e 100644 --- a/server/configure.ac +++ b/server/configure.ac @@ -31,6 +31,8 @@ AM_CONDITIONAL([HAVE_GCC], [test "$ac_cv_prog_gcc" = yes]) AC_CHECK_HEADERS(stdint.h dlfcn.h) AC_CONFIG_HEADER(config.h) +AC_CHECK_TYPES([errno_t], [], [], [[#include <errno.h>]]) + TESTS="" EXTRA_OBJ="" diff --git a/server/util/util.h b/server/util/util.h index 02916c1..b60dfa8 100644 --- a/server/util/util.h +++ b/server/util/util.h @@ -14,6 +14,10 @@ #include "tevent.h" #include "ldb.h" +#ifndef HAVE_ERRNO_T +typedef int errno_t; +#endif + extern const char *debug_prg_name; extern int debug_level; extern int debug_timestamps; -- 1.6.2.5
_______________________________________________ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel