-/* $OpenBSD: errstr.c,v 1.10 2023/03/06 14:32:06 tb Exp $ */
+/* $OpenBSD: errstr.c,v 1.11 2023/07/23 11:20:11 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/lhash.h>
#include <openssl/ssl.h>
-static struct {
- int stats;
-} cfg;
-
static const struct option errstr_options[] = {
- {
- .name = "stats",
- .desc = "Print debugging statistics for the hash table",
- .type = OPTION_FLAG,
- .opt.flag = &cfg.stats,
- },
{ NULL },
};
static void
-errstr_usage()
+errstr_usage(void)
{
- fprintf(stderr, "usage: errstr [-stats] errno ...\n");
- options_usage(errstr_options);
+ fprintf(stderr, "usage: errstr errno ...\n");
}
int
exit(1);
}
- memset(&cfg, 0, sizeof(cfg));
-
if (options_parse(argc, argv, errstr_options, NULL, &argsused) != 0) {
errstr_usage();
return (1);
}
- if (cfg.stats) {
- BIO *out;
-
- if ((out = BIO_new_fp(stdout, BIO_NOCLOSE)) == NULL) {
- fprintf(stderr, "Out of memory");
- return (1);
- }
-
- lh_ERR_STRING_DATA_node_stats_bio(ERR_get_string_table(), out);
- lh_ERR_STRING_DATA_stats_bio(ERR_get_string_table(), out);
- lh_ERR_STRING_DATA_node_usage_stats_bio(
- ERR_get_string_table(), out);
-
- BIO_free_all(out);
- }
-
for (i = argsused; i < argc; i++) {
errno = 0;
ularg = argv[i];
-.\" $OpenBSD: openssl.1,v 1.150 2023/07/03 08:37:22 jmc Exp $
+.\" $OpenBSD: openssl.1,v 1.151 2023/07/23 11:20:11 tb Exp $
.\" ====================================================================
.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
.\"
.\" copied and put under another distribution licence
.\" [including the GNU Public Licence.]
.\"
-.Dd $Mdocdate: July 3 2023 $
+.Dd $Mdocdate: July 23 2023 $
.Dt OPENSSL 1
.Os
.Sh NAME
.Tg errstr
.Sh ERRSTR
.Nm openssl errstr
-.Op Fl stats
.Ar errno ...
.Pp
The
and
.Bq reason string
are all ASCII text.
-.Pp
-The options are as follows:
-.Bl -tag -width Ds
-.It Fl stats
-Print debugging statistics about various aspects of the hash table.
-.El
.Tg gendsa
.Sh GENDSA
.Bl -hang -width "openssl gendsa"