From d2a62e16376e5dfc38a2356fa706c28f86eba414 Mon Sep 17 00:00:00 2001 From: imp Date: Sun, 4 Apr 1999 21:15:37 +0000 Subject: [PATCH] Add mkstemps to the man page, and create a link for it. Obtained from: OpenBSD Poked in the eye about committing new functions without a manpage: obrien --- lib/libc/stdio/Makefile.inc | 4 ++-- lib/libc/stdio/mktemp.3 | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/libc/stdio/Makefile.inc b/lib/libc/stdio/Makefile.inc index e5f5e04488a4..43deef474561 100644 --- a/lib/libc/stdio/Makefile.inc +++ b/lib/libc/stdio/Makefile.inc @@ -1,5 +1,5 @@ # @(#)Makefile.inc 8.3 (Berkeley) 4/17/94 -# $Id: Makefile.inc,v 1.16 1999/02/08 21:32:37 dt Exp $ +# $Id: Makefile.inc,v 1.17 1999/03/05 13:01:22 bde Exp $ # stdio sources .PATH: ${.CURDIR}/../libc/stdio @@ -31,7 +31,7 @@ MLINKS+=fseek.3 fgetpos.3 fseek.3 fseeko.3 fseek.3 fsetpos.3 fseek.3 ftell.3 \ fseek.3 ftello.3 fseek.3 rewind.3 MLINKS+=funopen.3 fropen.3 funopen.3 fwopen.3 MLINKS+=getc.3 fgetc.3 getc.3 getchar.3 getc.3 getw.3 -MLINKS+=mktemp.3 mkdtemp.3 mktemp.3 mkstemp.3 +MLINKS+=mktemp.3 mkdtemp.3 mktemp.3 mkstemp.3 mktemp.3 mkstemps.3 MLINKS+=printf.3 asprintf.3 printf.3 fprintf.3 \ printf.3 snprintf.3 printf.3 sprintf.3 \ printf.3 vasprintf.3 \ diff --git a/lib/libc/stdio/mktemp.3 b/lib/libc/stdio/mktemp.3 index 50d7de4cda3f..b6048ce02743 100644 --- a/lib/libc/stdio/mktemp.3 +++ b/lib/libc/stdio/mktemp.3 @@ -43,6 +43,8 @@ .Fn mktemp "char *template" .Ft int .Fn mkstemp "char *template" +.Ft int +.Fn mkstemps "char *template, int suffixlen" .Ft char * .Fn mkdtemp "char *template" .Sh DESCRIPTION @@ -82,6 +84,16 @@ This avoids the race between testing for a file's existence and opening it for use. .Pp The +.Fn mkstemps +function acts the same as +.Fn mkstemp , +except it permits a suffix to exist in the template. The template +should be of the form +.Pa /tmp/tmpXXXXXXsuffix . +.Fn mkstemps +is told the length of the suffix string, ie. strlen("suffix"); +.Pp +The .Fn mkdtemp function makes the same replacement to the template as in .Xr mktemp 3