Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/mktemp Update to reflect current reality for templat...



details:   https://anonhg.NetBSD.org/src/rev/da58c42a7c4f
branches:  trunk
changeset: 1022560:da58c42a7c4f
user:      simonb <simonb%NetBSD.org@localhost>
date:      Sun Jul 25 08:52:03 2021 +0000

description:
Update to reflect current reality for template characters - the process
ID is not longer used and we replace each "X" with one of 64 values not
26 values.

diffstat:

 lib/libc/stdio/mktemp.3 |  25 +++++++++----------------
 usr.bin/mktemp/mktemp.1 |  10 +++++-----
 2 files changed, 14 insertions(+), 21 deletions(-)

diffs (97 lines):

diff -r ca6792bb844b -r da58c42a7c4f lib/libc/stdio/mktemp.3
--- a/lib/libc/stdio/mktemp.3   Sun Jul 25 08:42:28 2021 +0000
+++ b/lib/libc/stdio/mktemp.3   Sun Jul 25 08:52:03 2021 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: mktemp.3,v 1.30 2014/06/19 09:30:33 wiz Exp $
+.\"    $NetBSD: mktemp.3,v 1.31 2021/07/25 08:52:03 simonb Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"     @(#)mktemp.3   8.1 (Berkeley) 6/4/93
 .\"
-.Dd June 18, 2014
+.Dd July 25, 2021
 .Dt MKTEMP 3
 .Os
 .Sh NAME
@@ -67,33 +67,26 @@
 by the application.
 The template may be any file name with some number of
 .So Li X
-.Sc Ns s
-appended
-to it, for example
+characters appended to it, for example
 .Pa /tmp/temp.XXXXXX .
 The trailing
 .So Li X
-.Sc Ns s
-are replaced with the current process number and/or a
-unique letter combination.
-The number of unique file names
+characters in the template are replaced with a unique letter and number
+combination.
 .Fn mktemp
 can return depends on the number of
 .So Li X
-.Sc Ns s
-provided.
+characters provided.
 Although the
 .Nx
 implementation of the functions will accept any number of trailing
 .So Li X
-.Sc Ns s ,
-for portability reasons one should use only six.
+characters, for portability reasons one should use only six.
 Using six
 .So Li X
-.Sc Ns s
-will result in
+characters will result in
 .Fn mktemp
-testing roughly 26 ** 6 (308915776) combinations.
+testing roughly 62 ** 6 (56800235584) combinations.
 .Pp
 The
 .Fn mkstemp
diff -r ca6792bb844b -r da58c42a7c4f usr.bin/mktemp/mktemp.1
--- a/usr.bin/mktemp/mktemp.1   Sun Jul 25 08:42:28 2021 +0000
+++ b/usr.bin/mktemp/mktemp.1   Sun Jul 25 08:52:03 2021 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: mktemp.1,v 1.23 2017/07/03 21:34:20 wiz Exp $
+.\" $NetBSD: mktemp.1,v 1.24 2021/07/25 08:52:03 simonb Exp $
 .\" From: $FreeBSD: src/usr.bin/mktemp/mktemp.1,v 1.5 1999/08/28 01:04:13 peter Exp $
 .\" From: $OpenBSD: mktemp.1,v 1.8 1998/03/19 06:13:37 millert Exp $
 .\"
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD: src/usr.bin/mktemp/mktemp.1,v 1.5 1999/08/28 01:04:13 peter Exp $
 .\"
-.Dd November 4, 2012
+.Dd July 25, 2021
 .Dt MKTEMP 1
 .Os
 .Sh NAME
@@ -61,8 +61,8 @@
 .Pa /tmp/prefix.XXXX .
 The trailing
 .Ql X
-characters in the template are replaced by unique values derived from
-the current process number and additional letters or numbers.
+characters in the template are replaced with a unique letter and number
+combination.
 Any
 .Ql X
 characters other than at the end of the template are taken literally.
@@ -74,7 +74,7 @@
 .Ql X Ns s
 will result in
 .Nm
-testing roughly 26 ** 6 combinations.
+testing roughly 62 ** 6 (56800235584) combinations.
 .Pp
 The templates used to create the unique names are derived from the
 .Fl t Ar prefix



Home | Main Index | Thread Index | Old Index