Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160351335
D54380.id168643.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D54380.id168643.diff
View Options
diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c
--- a/lib/libc/gen/err.c
+++ b/lib/libc/gen/err.c
@@ -120,7 +120,7 @@
}
fprintf(err_file, "%s", strerror(code));
if (doexterr && extstatus == 0 && exterr[0] != '\0')
- fprintf(err_file, " (extended error %s)", exterr);
+ fprintf(err_file, " (%s)", exterr);
fprintf(err_file, "\n");
}
diff --git a/lib/libc/gen/uexterr_format.c b/lib/libc/gen/uexterr_format.c
--- a/lib/libc/gen/uexterr_format.c
+++ b/lib/libc/gen/uexterr_format.c
@@ -29,7 +29,8 @@
ue->error, ue->cat, ue->src_line,
(uintmax_t)ue->p1, (uintmax_t)ue->p2);
} else {
- strlcpy(buf, ue->msg, bufsz);
+ snprintf(buf, bufsz, ue->msg, (uintmax_t)ue->p1,
+ (uintmax_t)ue->p2);
}
return (0);
}
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -197,12 +197,14 @@
check_fp_fn = mrp->mr_check_fp_fn;
if ((prot & ~(_PROT_ALL | PROT_MAX(_PROT_ALL))) != 0) {
- return (EXTERROR(EINVAL, "unknown PROT bits"));
+ return (EXTERROR(EINVAL, "unknown PROT bits %#jx", prot));
}
max_prot = PROT_MAX_EXTRACT(prot);
prot = PROT_EXTRACT(prot);
if (max_prot != 0 && (max_prot & prot) != prot) {
- return (EXTERROR(ENOTSUP, "prot is not subset of max_prot"));
+ return (EXTERROR(ENOTSUP,
+ "prot %#jx is not subset of max_prot %#jx",
+ prot, max_prot));
}
p = td->td_proc;
@@ -236,7 +238,7 @@
if ((len == 0 && p->p_osrel >= P_OSREL_MAP_ANON) ||
((flags & MAP_ANON) != 0 && (fd != -1 || pos != 0))) {
return (EXTERROR(EINVAL,
- "offset not zero/fd not -1 for MAP_ANON",
+ "offset %#jd not zero/fd %#jd not -1 for MAP_ANON",
fd, pos));
}
} else {
@@ -247,8 +249,8 @@
if (flags & MAP_STACK) {
if ((fd != -1) || ((prot & (PROT_READ | PROT_WRITE)) !=
(PROT_READ | PROT_WRITE))) {
- return (EXTERROR(EINVAL, "MAP_STACK with prot < rw",
- prot));
+ return (EXTERROR(EINVAL,
+ "MAP_STACK with prot %#jx < rw", prot));
}
flags |= MAP_ANON;
pos = 0;
@@ -257,18 +259,21 @@
MAP_STACK | MAP_NOSYNC | MAP_ANON | MAP_EXCL | MAP_NOCORE |
MAP_PREFAULT_READ | MAP_GUARD | MAP_32BIT |
MAP_ALIGNMENT_MASK)) != 0) {
- return (EXTERROR(EINVAL, "reserved flag set"));
+ return (EXTERROR(EINVAL, "reserved flag set (flags %#jx)",
+ flags));
}
if ((flags & (MAP_EXCL | MAP_FIXED)) == MAP_EXCL) {
- return (EXTERROR(EINVAL, "EXCL without FIXED"));
+ return (EXTERROR(EINVAL, "EXCL without FIXED (flags %#jx)",
+ flags));
}
if ((flags & (MAP_SHARED | MAP_PRIVATE)) == (MAP_SHARED |
MAP_PRIVATE)) {
- return (EXTERROR(EINVAL, "both SHARED and PRIVATE set"));
+ return (EXTERROR(EINVAL,
+ "both SHARED and PRIVATE set (flags %#jx)", flags));
}
if (prot != PROT_NONE &&
(prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) {
- return (EXTERROR(EINVAL, "invalid prot", prot));
+ return (EXTERROR(EINVAL, "invalid prot %#jx", prot));
}
if ((flags & MAP_GUARD) != 0 && (prot != PROT_NONE || fd != -1 ||
pos != 0 || (flags & ~(MAP_FIXED | MAP_GUARD | MAP_EXCL |
@@ -295,7 +300,7 @@
if (align != 0 && align != MAP_ALIGNED_SUPER &&
(align >> MAP_ALIGNMENT_SHIFT >= sizeof(void *) * NBBY ||
align >> MAP_ALIGNMENT_SHIFT < PAGE_SHIFT)) {
- return (EXTERROR(EINVAL, "bad alignment", align));
+ return (EXTERROR(EINVAL, "bad alignment %#jx", align));
}
/*
@@ -310,8 +315,8 @@
*/
addr -= pageoff;
if ((addr & PAGE_MASK) != 0) {
- return (EXTERROR(EINVAL, "fixed mapping not aligned",
- addr));
+ return (EXTERROR(EINVAL,
+ "fixed mapping at %#jx not aligned", addr));
}
/* Address range must be all in user VM space. */
@@ -321,7 +326,8 @@
}
if (flags & MAP_32BIT && addr + size > MAP_32BIT_MAX_ADDR) {
return (EXTERROR(EINVAL,
- "fixed 32bit mapping does not fit into 4G"));
+ "fixed 32bit mapping of [%#jx %#jx] does not fit into 4G",
+ addr, addr + size));
}
} else if (flags & MAP_32BIT) {
/*
@@ -1495,7 +1501,7 @@
handle, &foff, &object, &writecounted);
break;
default:
- error = EXTERROR(EINVAL, "unsupported backing obj type",
+ error = EXTERROR(EINVAL, "unsupported backing obj type %jd",
handle_type);
break;
}
@@ -1578,7 +1584,7 @@
* exec).
*/
if ((foff & PAGE_MASK) != 0) {
- return (EXTERROR(EINVAL, "offset not page-aligned", foff));
+ return (EXTERROR(EINVAL, "offset %#jx not page-aligned", foff));
}
if ((flags & MAP_FIXED) == 0) {
@@ -1587,7 +1593,8 @@
} else {
if (*addr != trunc_page(*addr)) {
return (EXTERROR(EINVAL,
- "non-fixed mapping address not aligned", *addr));
+ "non-fixed mapping address %#jx not aligned",
+ *addr));
}
fitit = false;
}
@@ -1599,7 +1606,7 @@
}
if (foff != 0) {
return (EXTERROR(EINVAL,
- "anon mapping with non-zero offset"));
+ "anon mapping with non-zero offset %#jx", foff));
}
docow = 0;
} else if (flags & MAP_PREFAULT_READ)
@@ -1702,6 +1709,6 @@
}
if ((curthread->td_pflags2 & (TDP2_UEXTERR | TDP2_EXTERR)) ==
TDP2_UEXTERR)
- EXTERROR(error, "mach error", rv);
+ EXTERROR(error, "mach error %jd", rv);
return (error);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jun 24, 2:17 PM (12 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34285780
Default Alt Text
D54380.id168643.diff (5 KB)
Attached To
Mode
D54380: exterror: support %d in error messages
Attached
Detach File
Event Timeline
Log In to Comment