diff options
| author | Alejandro Colomar <colomar.6.4.3@gmail.com> | 2020-09-11 22:53:51 +0200 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2020-09-12 08:38:20 +0200 |
| commit | dc97703b4adb91ebf6ba405c8d2ee43ccf10c247 (patch) | |
| tree | b83e64c5e07291f96a8a63d1651d5924eaab0002 /man3 | |
| parent | ec8b00033c6b7e7c20e900334f4e9af391d823fe (diff) | |
| download | man-pages-dc97703b4adb91ebf6ba405c8d2ee43ccf10c247.tar.gz | |
eventfd.2, mprotect.2, pidfd_open.2, spu_run.2, timer_create.2, bswap.3, dl_iterate_phdr.3, endian.3, pthread_attr_init.3, pthread_getattr_np.3, vcs.4, rtld-audit.7: In printf(): s/0x%/%#/ except when followed by X instead of x
Use printf()'s '#' flag character to prepend the string "0x".
However, when the number is printed in uppercase, and the prefix
is in lowercase, the string "0x" needs to be manually written.
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man3')
| -rw-r--r-- | man3/bswap.3 | 2 | ||||
| -rw-r--r-- | man3/dl_iterate_phdr.3 | 4 | ||||
| -rw-r--r-- | man3/endian.3 | 6 | ||||
| -rw-r--r-- | man3/pthread_attr_init.3 | 2 | ||||
| -rw-r--r-- | man3/pthread_getattr_np.3 | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/man3/bswap.3 b/man3/bswap.3 index ce847580aa..722cac806e 100644 --- a/man3/bswap.3 +++ b/man3/bswap.3 @@ -73,7 +73,7 @@ main(int argc, char *argv[]) } x = strtoull(argv[1], NULL, 0); - printf("0x%" PRIx64 " ==> 0x%" PRIx64 "\en", x, bswap_64(x)); + printf("%#" PRIx64 " ==> %#" PRIx64 "\en", x, bswap_64(x)); exit(EXIT_SUCCESS); } diff --git a/man3/dl_iterate_phdr.3 b/man3/dl_iterate_phdr.3 index 62a3596a3f..70206a0ba8 100644 --- a/man3/dl_iterate_phdr.3 +++ b/man3/dl_iterate_phdr.3 @@ -325,14 +325,14 @@ callback(struct dl_phdr_info *info, size_t size, void *data) (p_type == PT_GNU_STACK) ? "PT_GNU_STACK" : (p_type == PT_GNU_RELRO) ? "PT_GNU_RELRO" : NULL; - printf(" %2d: [%14p; memsz:%7lx] flags: 0x%x; ", j, + printf(" %2d: [%14p; memsz:%7lx] flags: %#x; ", j, (void *) (info\->dlpi_addr + info\->dlpi_phdr[j].p_vaddr), info\->dlpi_phdr[j].p_memsz, info\->dlpi_phdr[j].p_flags); if (type != NULL) printf("%s\en", type); else - printf("[other (0x%x)]\en", p_type); + printf("[other (%#x)]\en", p_type); } return 0; diff --git a/man3/endian.3 b/man3/endian.3 index bdf1efd7e0..4a2b29882e 100644 --- a/man3/endian.3 +++ b/man3/endian.3 @@ -164,9 +164,9 @@ main(int argc, char *argv[]) x.arr[2] = 0x33; x.arr[3] = 0x44; /* Highest-address byte */ - printf("x.u32 = 0x%x\en", x.u32); - printf("htole32(x.u32) = 0x%x\en", htole32(x.u32)); - printf("htobe32(x.u32) = 0x%x\en", htobe32(x.u32)); + printf("x.u32 = %#x\en", x.u32); + printf("htole32(x.u32) = %#x\en", htole32(x.u32)); + printf("htobe32(x.u32) = %#x\en", htobe32(x.u32)); exit(EXIT_SUCCESS); } diff --git a/man3/pthread_attr_init.3 b/man3/pthread_attr_init.3 index ed7faaff0e..815b45de86 100644 --- a/man3/pthread_attr_init.3 +++ b/man3/pthread_attr_init.3 @@ -228,7 +228,7 @@ display_pthread_attr(pthread_attr_t *attr, char *prefix) if (s != 0) handle_error_en(s, "pthread_attr_getstack"); printf("%sStack address = %p\en", prefix, stkaddr); - printf("%sStack size = 0x%zx bytes\en", prefix, v); + printf("%sStack size = %#zx bytes\en", prefix, v); } static void * diff --git a/man3/pthread_getattr_np.3 b/man3/pthread_getattr_np.3 index be957607e0..01538526b0 100644 --- a/man3/pthread_getattr_np.3 +++ b/man3/pthread_getattr_np.3 @@ -222,7 +222,7 @@ display_stack_related_attributes(pthread_attr_t *attr, char *prefix) if (stack_size > 0) printf(" (EOS = %p)", (char *) stack_addr + stack_size); printf("\en"); - printf("%sStack size = 0x%zx (%zu) bytes\en", + printf("%sStack size = %#zx (%zu) bytes\en", prefix, stack_size, stack_size); } |
