Update contrib.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
16 * <<tmpfile>>---create a temporary file
23 * FILE *tmpfile(void);
24 * FILE *_tmpfile_r(void *<[reent]>);
28 * FILE *_tmpfile_r(<[reent]>)
30 * Create a temporary file (a file which will be deleted automatically),
31 * using a name generated by <<tmpnam>>. The temporary file is opened with
32 * the mode <<"wb+">>, permitting you to read and write anywhere in it
33 * as a binary file (without any data transformations the host system may
34 * perform for text files).
35 * The alternate function <<_tmpfile_r>> is a reentrant version. The
36 * argument <[reent]> is a pointer to a reentrancy structure.
38 * <<tmpfile>> normally returns a pointer to the temporary file. If no
39 * temporary file could be created, the result is NULL, and <<errno>>
40 * records the reason for failure.
42 * Both ANSI C and the System V Interface Definition (Issue 2) require
44 * Supporting OS subroutines required: <<close>>, <<fstat>>, <<getpid>>,
45 * <<isatty>>, <<lseek>>, <<open>>, <<read>>, <<sbrk>>, <<write>>.
46 * <<tmpfile>> also requires the global pointer <<environ>>.
56 Open a temporary file.
57 Creates a temporary binary file for update.
58 The filename is unique to avoid any conflict with existing files.
59 @return file pointer (stream) to the temporary file created.
60 If the file can not be created a NULL pointer is returned.
62 EXPORT_C FILE *tmpfile (void)
64 return _tmpfile_r (_REENT);
68 Open a temporary file.
69 Creates a temporary binary file for update.
70 The filename is unique to avoid any conflict with existing files.
73 EXPORT_C FILE *_tmpfile_r (struct _reent *r)
75 return _wfopen_r(r, (wchar_t*)L"TMP:", (wchar_t*)L"wb+");