X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ferr%2Ferr.h;h=23e7f0c4858ef78c566b0107663695eecc802a3a;hp=da9ea0c5bd165a97183f78bbebf965c813184df6;hb=6abc867fce8c3eba40eb26092d31e34b47dd9165;hpb=9f5e1ef758d5b052a8df115f1d79c0c53e802ddf diff --git a/ccan/err/err.h b/ccan/err/err.h index da9ea0c5..23e7f0c4 100644 --- a/ccan/err/err.h +++ b/ccan/err/err.h @@ -1,12 +1,31 @@ +/* CC0 (Public domain) - see LICENSE file for details */ #ifndef CCAN_ERR_H #define CCAN_ERR_H #include "config.h" #if HAVE_ERR_H #include + +/* This is unnecessary with a real err.h. See below */ +#define err_set_progname(name) ((void)name) + #else #include +/** + * err_set_progname - set the program name + * @name: the name to use for err, errx, warn and warnx + * + * The BSD err.h calls know the program name, unfortunately there's no + * portable way for the CCAN replacements to do that on other systems. + * + * If you don't call this with argv[0], it will be "unknown program". + * + * Example: + * err_set_progname(argv[0]); + */ +void err_set_progname(const char *name); + /** * err - exit(eval) with message based on format and errno. * @eval: the exit code