From nobody Sun Oct 27 16:43:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xc2Q60dK6z5bChP; Sun, 27 Oct 2024 16:43:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xc2Q607pZz4T9Y; Sun, 27 Oct 2024 16:43:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730047390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=30RxdBvG2Z9wJaeYLOfVMOqIGHPjcs+uVFlpun/hW+8=; b=sbkznlFBLP6O6+7WCtkB5J8DVyY837ZiKaF4lphQ9XVGeZXnl00763xAIbXyig1NujCNKb DzAn644F5+Ur82T3o9r36ggu8HxQx68+wPh9kvEvHlg+5BdSB1XUPr3qO2V8wy11PUGkoh 57ycGbIA/wKgjel7p5xYi3VzVJu12EkhNmGhjnrSeNMxEn2eiAGMpT7luNE66H5B6q1nEi RtKl3Z23RhrlC9M5z0pgqS8oYfqHZ/mK7waYEz/ssTq5/sg1UsSEXEzQuZ+dLIzRd1LWBR CI41kXsw+RHVX/MzYXidJP6aBXJJcsxC6ZR9DH/lrsYwF+wv6exNMQ8CF96fug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730047390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=30RxdBvG2Z9wJaeYLOfVMOqIGHPjcs+uVFlpun/hW+8=; b=t8ennqwf+uGjw7w8aagTkbF2uNZGu4a5JyOGBcY0xXaHISt6L18AAwWbiX+d14QZNCE3OE u2/OpVgYodQ4j6Fyt15bb4SsGI8lTE0NkPxP3xh7IdEBLP31GMBnm31sw77NwtjevmZXjL owVfal35V0z7Q8SbShQhZETqZZ2iptlDRxcA3z1HSXucyHSj0ehP9MpaG38TYNYPnTG6ip +/NpfCVAaqtYnHBBEw5pTYmnf6AeEHsAoQ8qNBAThgR1+GncPUTjYMvfXW1vaW+U7Xy8IK +AmRcaOi1R40NAqdL194LmLltX74BGMSXOt5tpE0qSUkT3hnlpEBx9nKigX/Lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730047390; a=rsa-sha256; cv=none; b=w+aVOfvV/k3LiIKAIEWDFgQ5HZLgxQtD2w/iUAib+Q3CN/vyS5wPlM8KuxlMenu9r20yxK 9ViidH0TiR/kIUt9ArNBpjva0oe3nZRDMDjmn6giUO3Ut/iNCWiVyjq0GyRhpOQc7BKUb4 w0pB8C15AlnImBPZ4r0QrjIEXKQ4wv1VNtjq429o0tXUw8WiUPmN/VYHyDn+Ue6iDgp2ZB mrTv0kxLXhUgR/4oJ2YXStzcAXjblAsWZaoBoOV+djK7SYtwc6YIt1cN+zzh34kjhrs/zf +9+XeCZnDiOeob/6Vl4zED+HfvAMOoVb/qt1NceJ8R1c5mCNZWx0FaMW6oDVIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xc2Q56s1Zz12ys; Sun, 27 Oct 2024 16:43:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49RGh975053798; Sun, 27 Oct 2024 16:43:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49RGh9Us053795; Sun, 27 Oct 2024 16:43:09 GMT (envelope-from git) Date: Sun, 27 Oct 2024 16:43:09 GMT Message-Id: <202410271643.49RGh9Us053795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: 95b17d3b1c51 - main - mktemp(3): bring the documentation up to date with best practice List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95b17d3b1c5187d2630556eaa0f2107378ca3b4f Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=95b17d3b1c5187d2630556eaa0f2107378ca3b4f commit 95b17d3b1c5187d2630556eaa0f2107378ca3b4f Author: Wolfram Schneider AuthorDate: 2024-10-27 16:41:01 +0000 Commit: Wolfram Schneider CommitDate: 2024-10-27 16:41:01 +0000 mktemp(3): bring the documentation up to date with best practice Using short temp filenames as /tmp/temp.XXXX (4 or 6 X) was probably ok 20 years ago, but not anymore. Best practice is to use 10 X. Given that our users often copy & paste examples from our manual pages we need to update the documentation. PR: 261437 --- lib/libc/stdio/mktemp.3 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdio/mktemp.3 b/lib/libc/stdio/mktemp.3 index d00d3d4f61fb..93870f3865de 100644 --- a/lib/libc/stdio/mktemp.3 +++ b/lib/libc/stdio/mktemp.3 @@ -63,7 +63,7 @@ The template may be any file name with some number of .Ql X Ns s appended to it, for example -.Pa /tmp/temp.XXXXXX . +.Pa /tmp/temp.XXXXXXXXXX . The trailing .Ql X Ns s are replaced with a @@ -116,7 +116,7 @@ and respectively, except they permit a suffix to exist in the template. The template should be of the form -.Pa /tmp/tmpXXXXXXsuffix . +.Pa /tmp/tmpXXXXXXXXXXsuffix . The .Fn mkstemps and @@ -243,7 +243,7 @@ compilers were common. For example, calling .Fn mkstemp with an argument of -.Qq /tmp/tempfile.XXXXXX +.Qq /tmp/tempfile.XXXXXXXXXX will result in a core dump due to .Fn mkstemp attempting to modify the string constant that was given.