-/* $OpenBSD: stdlib.h,v 1.76 2019/05/10 15:03:24 otto Exp $ */
+/* $OpenBSD: stdlib.h,v 1.77 2024/03/01 21:30:40 millert Exp $ */
/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */
/*-
extern char *suboptarg; /* getsubopt(3) external variable */
+char * mkdtemps(char *, int);
int mkstemps(char *, int);
int mkostemps(char *, int, int);
getwc
getwchar
mkdtemp
+mkdtemps
mkostemp
mkostemps
mkstemp
-/* $OpenBSD: stdlib.h,v 1.19 2024/01/19 19:45:02 millert Exp $ */
+/* $OpenBSD: stdlib.h,v 1.20 2024/03/01 21:30:40 millert Exp $ */
/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */
/*-
PROTO_STD_DEPRECATED(mbtowc);
PROTO_DEPRECATED(mergesort);
PROTO_DEPRECATED(mkdtemp);
+PROTO_DEPRECATED(mkdtemps);
PROTO_NORMAL(mkostemp);
PROTO_DEPRECATED(mkostemps);
PROTO_NORMAL(mkstemp);
-major=98
+major=99
minor=0
# note: If changes were made to include/thread_private.h or if system calls
# were added/changed then librthread/shlib_version must also be updated.
-/* $OpenBSD: mkdtemp.c,v 1.1 2024/01/19 19:45:02 millert Exp $ */
+/* $OpenBSD: mkdtemp.c,v 1.2 2024/03/01 21:30:40 millert Exp $ */
/*
* Copyright (c) 2024 Todd C. Miller
*
return path;
return NULL;
}
+
+char *
+mkdtemps(char *path, int slen)
+{
+ if (__mktemp4(path, slen, 0, mkdtemp_cb) == 0)
+ return path;
+ return NULL;
+}
-.\" $OpenBSD: mktemp.3,v 1.1 2024/01/19 16:30:28 millert Exp $
+.\" $OpenBSD: mktemp.3,v 1.2 2024/03/01 21:30:40 millert Exp $
.\"
.\" Copyright (c) 1989, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: January 19 2024 $
+.Dd $Mdocdate: March 1 2024 $
.Dt MKTEMP 3
.Os
.Sh NAME
.Nm mkostemp ,
.Nm mkstemps ,
.Nm mkostemps ,
-.Nm mkdtemp
+.Nm mkdtemp ,
+.Nm mkdtemps
.Nd make temporary file name (unique)
.Sh SYNOPSIS
.In stdlib.h
.Fn mkstemps "char *template" "int suffixlen"
.Ft char *
.Fn mkdtemp "char *template"
+.Ft char *
+.Fn mkdtemps "char *template" "int suffixlen"
.In stdlib.h
.In fcntl.h
.Ft int
function makes the same replacement to the template as in
.Fn mktemp
and creates the template directory, mode 0700.
+The
+.Fn mkdtemps
+function acts the same as
+.Fn mkdtemp ,
+except that it permits a suffix to exist in the template,
+similar to
+.Fn mkstemps .
.Sh RETURN VALUES
The
-.Fn mktemp
+.Fn mktemp ,
+.Fn mkdtemp ,
and
-.Fn mkdtemp
+.Fn mkdtemps
functions return a pointer to the template on success and
.Dv NULL
on failure.
it is no longer a part of the standard.
.Pp
The
-.Fn mkstemps
+.Fn mkstemps ,
+.Fn mkostemps ,
and
-.Fn mkostemps
+.Fn mkdtemps
functions are non-standard and should not be used if portability is required.
.Sh HISTORY
A
.Fn mkostemps
functions appeared in
.Ox 5.7 .
+The
+.Fn mkdtemps
+function appeared in
+.Ox 7.5 .
.Sh BUGS
For
.Fn mktemp