From 2e65ca2b226a55e7d25ef687ce33185c0a71bd99 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 6 Jul 1999 16:26:03 +0000 Subject: Update. 1999-07-06 Ulrich Drepper * sysdeps/unix/sysv/linux/alpha/ioperm.c: Update for some more motherboards. Patch by Jay Estabrook. * sysdeps/unix/sysv/linux/configure.in: Don't test for libc4 in ldd for SPARC. * /sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed: New file. Patch by Cristian Gafton. 1999-07-02 Cristian Gafton * sysdeps/unix/sysv/linux/bits/socket.h (__cmsg_nxthdr): "return 0" instead of "return NULL" to make C++ happy. 1999-07-04 Mark Kettenis * libio/iofdopen.c (_IO_new_fdopen): Set EINVAL if MODE is not allowed by the file access mode of the open file. 1999-07-06 Ulrich Drepper * sysdeps/generic/setfpucw.c: Include math.h to get all needed macros defined. 1999-07-03 Jakub Jelinek * sysdeps/sparc/sparc64/submul_1.S: Fix carry handling. Optimize. * sysdeps/sparc/sparc64/lshift.S: Make a leaf subroutine. Optimize. * sysdeps/sparc/sparc64/rshift.S: Likewise. * sysdeps/sparc/sparc64/mul_1.S: Optimize. 1999-07-04 Wolfram Gloger * malloc/malloc.c (request2size): Check for overflow and return NULL whenever it is encountered. 1999-07-04 Zack Weinberg * sysdeps/posix/tempname.c (__gen_tempname): Add ability to create directories. Replace OPENIT and LARGEFILE args with a single flags parameter. * sysdeps/generic/tempname.c: Likewise. * include/stdio.h: Adjust prototype of __gen_tempname to match. Define symbolic constants for second argument. * misc/mkdtemp.c: New file, provides new function mkdtemp(). * stdlib/stdlib.h: Prototype it. * misc/Versions: Export it. * misc/Makefile (routines): Add mktemp. * manual/filesys.texi: Document it. * misc/mktemp.c: Adjust call of __gen_tempname to match new convention. * misc/mkstemp.c: Likewise. * stdio-common/tempnam.c: Likewise. * stdio-common/tmpfile.c: Likewise. * stdio-common/tmpfile64.c: Likewise. * stdio-common/tmpnam.c: Likewise. * stdio-common/tmpnam_r.c: Likewise. 1999-07-05 Jakub Jelinek * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Support R_SPARC_OLO10 relocations. * elf/elf.h (R_SPARC_OLO10): Fix comment. --- manual/filesys.texi | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'manual/filesys.texi') diff --git a/manual/filesys.texi b/manual/filesys.texi index 51af84633d..29f20758e8 100644 --- a/manual/filesys.texi +++ b/manual/filesys.texi @@ -2935,7 +2935,7 @@ end with @samp{XXXXXX}, @code{mkstemp} returns @code{-1} and does not modify @var{template}. The file is opened using mode @code{0600}. If the file is meant to be -used by other users the mode must explicitly changed. +used by other users the mode must be changed explicitly. @end deftypefun Unlike @code{mktemp}, @code{mkstemp} is actually guaranteed to create a @@ -2943,3 +2943,28 @@ unique file that cannot possibly clash with any other program trying to create a temporary file. This is because it works by calling @code{open} with the @code{O_EXCL} flag bit, which says you want to always create a new file, and get an error if the file already exists. + +@comment stdlib.h +@comment BSD +@deftypefun {char *} mkdtemp (char *@var{template}) +The @code{mkdtemp} function creates a directory with a unique name. If +it succeeds, it overwrites @var{template} with the name of the +directory, and returns @var{template}. As with @code{mktemp} and +@code{mkstemp}, @var{template} should be a string ending with +@samp{XXXXXX}. + +If @code{mkdtemp} cannot create an uniquely named directory, it returns +@code{NULL} and sets @var{errno} appropriately. If @var{template} does +not end with @samp{XXXXXX}, @code{mkdtemp} returns @code{NULL} and does +not modify @var{template}. @var{errno} will be set to @code{EINVAL} in +this case. + +The directory is created using mode @code{0700}. +@end deftypefun + +The directory created by @code{mkdtemp} cannot clash with temporary +files or directories created by other users. This is because directory +creation always works like @code{open} with @code{O_EXCL}. +@xref{Creating Directories}. + +The @code{mkdtemp} function comes from OpenBSD. -- cgit v1.2.3