summaryrefslogtreecommitdiff
path: root/usr/src/lib
diff options
context:
space:
mode:
authorDan McDonald <danmcd@mnx.io>2022-11-26 10:39:52 -0500
committerDan McDonald <danmcd@mnx.io>2022-11-26 10:39:52 -0500
commit4a074b8b70a2368c3e335b5a70cdf09a8f912115 (patch)
tree7c3dc3dd61d831489b3623fc65cc8603f15270be /usr/src/lib
parent329cc77e6ce2d98b347a297d8c3f8a61bde4cca9 (diff)
parent218c1e8d5b1b53d614b55e423b8b0a03f728e2e3 (diff)
downloadillumos-joyent-4a074b8b70a2368c3e335b5a70cdf09a8f912115.tar.gz
[illumos-gate merge]
commit 218c1e8d5b1b53d614b55e423b8b0a03f728e2e3 15175 Update intel CPU Microcode to 20221108 commit 621b6cf75a027e4c06f2a1b3207abb5f24539b14 15181 Add errc, verrc, warnc, vwarnc to libc commit 3eaaeb3d8421fdd2f5e4d63f0483f6047911215f 15202 nvme should recognise Format-in-progress generic status Conflicts: manifest usr/src/pkg/manifests/system-test-libctest.p5m
Diffstat (limited to 'usr/src/lib')
-rw-r--r--usr/src/lib/libc/port/gen/err.c126
-rw-r--r--usr/src/lib/libc/port/mapfile-vers10
2 files changed, 95 insertions, 41 deletions
diff --git a/usr/src/lib/libc/port/gen/err.c b/usr/src/lib/libc/port/gen/err.c
index 31c5a7e559..7cf6ef8105 100644
--- a/usr/src/lib/libc/port/gen/err.c
+++ b/usr/src/lib/libc/port/gen/err.c
@@ -23,6 +23,10 @@
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*/
+/*
+ * Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
+ */
+
#include "lint.h"
#include "file64.h"
#include "mtlib.h"
@@ -111,85 +115,71 @@ warnfinish(FILE *fp, rmutex_t *lk)
FUNLOCKFILE(lk);
}
-void
-_vwarnxfp(FILE *fp, const char *fmt, va_list args)
+static void
+vwarnfp(FILE *fp, int code, const char *fmt, va_list args)
{
rmutex_t *lk;
lk = warncore(fp, fmt, args);
+ if (fmt != NULL) {
+ (void) fputc(':', fp);
+ (void) fputc(' ', fp);
+ }
+ (void) fputs(strerror(code), fp);
warnfinish(fp, lk);
}
void
vwarnx(const char *fmt, va_list args)
{
- _vwarnxfp(stderr, fmt, args);
-}
-
-void
-_vwarnfp(FILE *fp, const char *fmt, va_list args)
-{
- int tmperr = errno; /* Capture errno now. */
rmutex_t *lk;
- lk = warncore(fp, fmt, args);
- if (fmt != NULL) {
- (void) fputc(':', fp);
- (void) fputc(' ', fp);
- }
- (void) fputs(strerror(tmperr), fp);
- warnfinish(fp, lk);
+ lk = warncore(stderr, fmt, args);
+ warnfinish(stderr, lk);
}
void
vwarn(const char *fmt, va_list args)
{
- _vwarnfp(stderr, fmt, args);
+ vwarnfp(stderr, errno, fmt, args);
}
-/* PRINTFLIKE1 */
void
-warnx(const char *fmt, ...)
+vwarnc(int code, const char *fmt, va_list args)
{
- va_list args;
-
- va_start(args, fmt);
- vwarnx(fmt, args);
- va_end(args);
+ vwarnfp(stderr, code, fmt, args);
}
void
-_warnfp(FILE *fp, const char *fmt, ...)
+warnx(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- _vwarnfp(fp, fmt, args);
+ vwarnx(fmt, args);
va_end(args);
}
void
-_warnxfp(FILE *fp, const char *fmt, ...)
+warn(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- _vwarnxfp(fp, fmt, args);
+ vwarn(fmt, args);
va_end(args);
}
-/* PRINTFLIKE1 */
void
-warn(const char *fmt, ...)
+warnc(int code, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- vwarn(fmt, args);
+ vwarnc(code, fmt, args);
va_end(args);
}
-/* PRINTFLIKE2 */
void
err(int status, const char *fmt, ...)
{
@@ -202,12 +192,12 @@ err(int status, const char *fmt, ...)
}
void
-_errfp(FILE *fp, int status, const char *fmt, ...)
+errc(int status, int code, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- _vwarnfp(fp, fmt, args);
+ vwarnc(code, fmt, args);
va_end(args);
exit(status);
}
@@ -220,13 +210,12 @@ verr(int status, const char *fmt, va_list args)
}
void
-_verrfp(FILE *fp, int status, const char *fmt, va_list args)
+verrc(int status, int code, const char *fmt, va_list args)
{
- _vwarnfp(fp, fmt, args);
+ vwarnc(code, fmt, args);
exit(status);
}
-/* PRINTFLIKE2 */
void
errx(int status, const char *fmt, ...)
{
@@ -239,20 +228,77 @@ errx(int status, const char *fmt, ...)
}
void
-_errxfp(FILE *fp, int status, const char *fmt, ...)
+verrx(int status, const char *fmt, va_list args)
+{
+ vwarnx(fmt, args);
+ exit(status);
+}
+
+/*
+ * The following functions are here as the targets of filters in libipsecutil.
+ */
+
+void
+_vwarnxfp(FILE *fp, const char *fmt, va_list args)
+{
+ rmutex_t *lk;
+
+ lk = warncore(fp, fmt, args);
+ warnfinish(fp, lk);
+}
+
+void
+_vwarnfp(FILE *fp, const char *fmt, va_list args)
+{
+ vwarnfp(fp, errno, fmt, args);
+}
+
+void
+_warnfp(FILE *fp, const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ _vwarnfp(fp, fmt, args);
+ va_end(args);
+}
+
+void
+_warnxfp(FILE *fp, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
_vwarnxfp(fp, fmt, args);
va_end(args);
+}
+
+void
+_errfp(FILE *fp, int status, const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ _vwarnfp(fp, fmt, args);
+ va_end(args);
exit(status);
}
void
-verrx(int status, const char *fmt, va_list args)
+_verrfp(FILE *fp, int status, const char *fmt, va_list args)
{
- vwarnx(fmt, args);
+ _vwarnfp(fp, fmt, args);
+ exit(status);
+}
+
+void
+_errxfp(FILE *fp, int status, const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ _vwarnxfp(fp, fmt, args);
+ va_end(args);
exit(status);
}
diff --git a/usr/src/lib/libc/port/mapfile-vers b/usr/src/lib/libc/port/mapfile-vers
index 46f3fa5f07..9ccd7c528e 100644
--- a/usr/src/lib/libc/port/mapfile-vers
+++ b/usr/src/lib/libc/port/mapfile-vers
@@ -27,7 +27,7 @@
# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright (c) 2013 Gary Mills
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
-# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
#
#
@@ -78,6 +78,14 @@ $if _x86 && _ELF64
$add amd64
$endif
+SYMBOL_VERSION ILLUMOS_0.40 {
+ protected:
+ errc;
+ verrc;
+ vwarnc;
+ warnc;
+} ILLUMOS_0.39;
+
SYMBOL_VERSION ILLUMOS_0.39 {
protected:
memrchr;