tmpfile(3)


NAME

   tmpfile - create a temporary file

SYNOPSIS

   #include <stdio.h>

   FILE *tmpfile(void);

DESCRIPTION

   The  tmpfile()  function  opens  a  unique  temporary  file  in  binary
   read/write (w+b) mode.  The file will be automatically deleted when  it
   is closed or the program terminates.

RETURN VALUE

   The tmpfile() function returns a stream descriptor, or NULL if a unique
   filename cannot be generated or the unique file cannot be  opened.   In
   the latter case, errno is set to indicate the error.

ERRORS

   EACCES Search permission denied for directory in file's path prefix.

   EEXIST Unable to generate a unique filename.

   EINTR  The call was interrupted by a signal; see signal(7).

   EMFILE The per-process limit on the number of open file descriptors has
          been reached.

   ENFILE The system-wide limit on the total number of open files has been
          reached.

   ENOSPC There was no room in the directory to add the new filename.

   EROFS  Read-only filesystem.

ATTRIBUTES

   For   an   explanation   of   the  terms  used  in  this  section,  see
   attributes(7).

   
   Interface  Attribute      Value   
   
   tmpfile()  Thread safety  MT-Safe 
   

CONFORMING TO

   POSIX.1-2001, POSIX.1-2008, C89, C99, SVr4, 4.3BSD, SUSv2.

NOTES

   POSIX.1-2001 specifies: an error message may be written  to  stdout  if
   the stream cannot be opened.

   The  standard  does  not specify the directory that tmpfile() will use.
   Glibc will try the path prefix P_tmpdir defined in  <stdio.h>,  and  if
   that fails the directory /tmp.

SEE ALSO

   exit(3), mkstemp(3), mktemp(3), tempnam(3), tmpnam(3)

COLOPHON

   This  page  is  part of release 4.09 of the Linux man-pages project.  A
   description of the project, information about reporting bugs,  and  the
   latest     version     of     this    page,    can    be    found    at
   https://www.kernel.org/doc/man-pages/.

                              2016-03-15                        TMPFILE(3)


More Linux Commands

manpages/X11::Protocol::Ext::RENDER.3pm.html
X11::Protocol::Ext::RENDER.3pm..............................
The RENDER extension adds a new set of drawing primitives which effectively represent a replacement of the drawing routines in the core protocol, redesigned bas

manpages/pthread_setcancelstate.3.html
pthread_setcancelstate(3) - set cancelability state and type
The pthread_setcancelstate() sets the cancelability state of the calling thread to the value given in state. The previous cancelability state of the thread is r

manpages/FcPatternGet.3.html
FcPatternGet(3) - Return a value from a pattern (Man Page)
Returns in v the idth value associated with the property object. The value returned is not a copy, but rather refers to the data stored within the pattern direc

manpages/slk_attroff.3ncurses.html
slk_attroff(3ncurses) - curses soft label routines (ManPage)
The slk* functions manipulate the set of soft function-key labels that exist on many terminals. For those terminals that do not have soft labels, curses takes o

manpages/pthread_getaffinity_np.3.html
pthread_getaffinity_np(3) - set/get CPU affinity of a thread
The pthread_setaffinity_np() function sets the CPU affinity mask of the thread thread to the CPU set pointed to by cpuset. If the call is successful, and the th

manpages/XF86MiscGetKbdSettings.3.html
XF86MiscGetKbdSettings(3) - Extension library for the XFree8
These functions provide an interface to the XFree86-Misc extension which allows various server settings to be queried and changed dynamically. Applications that

manpages/zoomsh.1.html
zoomsh(1) - ZOOM shell (Commands - Linux manual page).......
zoomsh is a ZOOM client with a simple command line interface. The client demonstrates the ZOOM API and is useful for testing targets. You may pass one or more c

manpages/XtCallbackExclusive.3.html
XtCallbackExclusive(3) - map a pop-up - Linux manual page...
The XtPopup function performs the following: * Calls XtCheckSubclass to ensure popup_shell is a subclass of Shell. * Generates an error if the shells popped_up

manpages/klogctl.3.html
klogctl(3) - read and/or clear kernel message ring buffer; s
If you need the C library function syslog() (which talks to syslogd(8)), then look at syslog(3). The system call of this name is about controlling the kernel pr

manpages/Tk_DeleteImage.3.html
Tk_DeleteImage(3) - Destroy an image. - Linux manual page...
Tk_DeleteImage deletes the image given by interp and name, if there is one. All instances of that image will redisplay as empty regions. If the given image does

manpages/setxkbmap.1.html
setxkbmap(1) - set the keyboard using the X Keyboard Extensi
The setxkbmap command maps the keyboard to use the layout determined by the options specified on the command line. An XKB keymap is constructed from a number of

manpages/asn1_read_value_type.3.html
asn1_read_value_type(3) API function - Linux manual page....
Returns the type and value of one element inside a structure. If an element is OPTIONAL and this returns ASN1_ELEMENT_NOT_FOUND, it means that this element wasn





We can't live, work or learn in freedom unless the software we use is free.