X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ferr%2Ferr.h;h=58ad91c728a65a36487bd4eda87d31dbf8c19957;hp=da9ea0c5bd165a97183f78bbebf965c813184df6;hb=5add556a1cb64b49a664506aa76216d885b22c97;hpb=9f5e1ef758d5b052a8df115f1d79c0c53e802ddf diff --git a/ccan/err/err.h b/ccan/err/err.h index da9ea0c5..58ad91c7 100644 --- a/ccan/err/err.h +++ b/ccan/err/err.h @@ -4,9 +4,27 @@ #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