#, fuzzy msgid "" msgstr "" "Project-Id-Version: man-pages-l10n VERSION\n" "POT-Creation-Date: 2014-07-17 17:58+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: man-pages-posix/man3p/close.3p:2 #, no-wrap msgid "CLOSE" msgstr "" #. type: TH #: man-pages-posix/man3p/close.3p:2 #, no-wrap msgid "2013" msgstr "" #. type: TH #: man-pages-posix/man3p/close.3p:2 #, no-wrap msgid "IEEE/The Open Group" msgstr "" #. type: TH #: man-pages-posix/man3p/close.3p:2 #, no-wrap msgid "POSIX Programmer's Manual" msgstr "" #. type: SH #: man-pages-posix/man3p/close.3p:3 #, no-wrap msgid "PROLOG" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:8 msgid "" "This manual page is part of the POSIX Programmer's Manual. The Linux " "implementation of this interface may differ (consult the corresponding Linux " "manual page for details of Linux behavior), or the interface may not be " "implemented on Linux." msgstr "" #. type: SH #: man-pages-posix/man3p/close.3p:9 #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:12 msgid "close \\(em close a file descriptor" msgstr "" #. type: SH #: man-pages-posix/man3p/close.3p:12 #, no-wrap msgid "SYNOPSIS" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:16 #, no-wrap msgid "#include Eunistd.hE\n" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:18 #, no-wrap msgid "int close(int I);\n" msgstr "" #. type: SH #: man-pages-posix/man3p/close.3p:19 #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:30 msgid "" "The I() function shall deallocate the file descriptor indicated by " "I. To deallocate means to make the file descriptor available for " "return by subsequent calls to I() or other functions that allocate " "file descriptors. All outstanding record locks owned by the process on the " "file associated with the file descriptor shall be removed (that is, " "unlocked)." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:50 msgid "" "If I() is interrupted by a signal that is to be caught, it shall " "return \\(mi1 with I set to B<[EINTR]> and the state of I is " "unspecified. If an I/O error occurred while reading from or writing to the " "file system during I(), it may return \\(mi1 with I set to " "B<[EIO]>; if this error is returned, the state of I is unspecified." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:53 msgid "" "When all file descriptors associated with a pipe or FIFO special file are " "closed, any data remaining in the pipe or FIFO shall be discarded." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:56 msgid "" "When all file descriptors associated with an open file description have been " "closed, the open file description shall be freed." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:60 msgid "" "If the link count of the file is 0, when all file descriptors associated " "with the file are closed, the space occupied by the file shall be freed and " "the file shall no longer be accessible." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:83 msgid "" "If a STREAMS-based I is closed and the calling process was " "previously registered to receive a SIGPOLL signal for events associated with " "that STREAM, the calling process shall be unregistered for events associated " "with the STREAM. The last I() for a STREAM shall cause the STREAM " "associated with I to be dismantled. If O_NONBLOCK is not set and " "there have been no signals posted for the STREAM, and if there is data on " "the module's write queue, I() shall wait for an unspecified time " "(for each module and driver) for any output to drain before dismantling the " "STREAM. The time delay can be changed via an I_SETCLTIME I() request." " If the O_NONBLOCK flag is set, or if there are any pending signals, " "I() shall not wait for output to drain, and shall dismantle the " "STREAM immediately." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:98 msgid "" "If the implementation supports STREAMS-based pipes, and I is " "associated with one end of a pipe, the last I() shall cause a hangup " "to occur on the other end of the pipe. In addition, if the other end of the " "pipe has been named by I(), then the last I() shall force " "the named end to be detached by I(). If the named end has no open " "file descriptors associated with it and gets detached, the STREAM associated " "with that end shall also be dismantled." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:107 msgid "" "If I refers to the master side of a pseudo-terminal, and this is the " "last close, a SIGHUP signal shall be sent to the controlling process, if " "any, for which the slave side of the pseudo-terminal is the controlling " "terminal. It is unspecified whether closing the master side of the pseudo-" "terminal flushes all queued input and output." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:112 msgid "" "If I refers to the slave side of a STREAMS-based pseudo-terminal, a " "zero-length message may be sent to the master." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:131 msgid "" "When there is an outstanding cancelable asynchronous I/O operation against " "I when I() is called, that I/O operation may be canceled. An " "I/O operation that is not canceled completes as if the I() operation " "had not yet occurred. All operations that are not canceled shall complete as " "if the I() blocked until the operations completed. The I() " "operation itself need not block awaiting such I/O completion. Whether any I/" "O operation is canceled, and which I/O operation may be canceled upon " "I(), is implementation-defined." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:142 msgid "" "If a memory mapped file or a shared memory object remains referenced at the " "last close (that is, a process has it mapped), then the entire contents of " "the memory object shall persist until the memory object becomes unreferenced." " If this is the last close of a memory mapped file or a shared memory " "object and the close results in the memory object becoming unreferenced, and " "the memory object has been unlinked, then the memory object shall be removed." "" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:153 msgid "" "If I refers to a socket, I() shall cause the socket to be " "destroyed. If the socket is in connection-mode, and the SO_LINGER option is " "set for the socket with non-zero linger time, and the socket has " "untransmitted data, then I() shall block for up to the current " "linger interval until all data is transmitted." msgstr "" #. type: SH #: man-pages-posix/man3p/close.3p:153 #, no-wrap msgid "RETURN VALUE" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:158 msgid "" "Upon successful completion, 0 shall be returned; otherwise, \\(mi1 shall be " "returned and I set to indicate the error." msgstr "" #. type: SH #: man-pages-posix/man3p/close.3p:158 #, no-wrap msgid "ERRORS" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:162 msgid "The I() function shall fail if:" msgstr "" #. type: TP #: man-pages-posix/man3p/close.3p:162 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:167 msgid "The I argument is not a open file descriptor." msgstr "" #. type: TP #: man-pages-posix/man3p/close.3p:167 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:172 msgid "The I() function was interrupted by a signal." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:176 msgid "The I() function may fail if:" msgstr "" #. type: TP #: man-pages-posix/man3p/close.3p:176 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:179 msgid "" "An I/O error occurred while reading from or writing to the file system." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:181 msgid "I" msgstr "" #. type: SH #: man-pages-posix/man3p/close.3p:181 #, no-wrap msgid "EXAMPLES" msgstr "" #. type: SS #: man-pages-posix/man3p/close.3p:182 #, no-wrap msgid "Reassigning a File Descriptor" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:189 msgid "" "The following example closes the file descriptor associated with standard " "output for the current process, re-assigns standard output to a new file " "descriptor, and closes the original file descriptor to clean up. This " "example assumes that the file descriptor 0 (which is the descriptor for " "standard input) is not closed." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:201 #, no-wrap msgid "" "B<\n" "#include Eunistd.hE\n" "\\&...\n" "int pfd;\n" "\\&...\n" "close(1);\n" "dup(pfd);\n" "close(pfd);\n" "\\&...>\n" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:206 msgid "Incidentally, this is exactly what could be achieved using:" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:212 #, no-wrap msgid "B<\n" "dup2(pfd, 1);\n" "close(pfd);>\n" msgstr "" #. type: SS #: man-pages-posix/man3p/close.3p:215 #, no-wrap msgid "Closing a File Descriptor" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:222 msgid "" "In the following example, I() is used to close a file descriptor " "after an unsuccessful attempt is made to associate that file descriptor with " "a stream." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:229 #, no-wrap msgid "" "B<\n" "#include Estdio.hE\n" "#include Eunistd.hE\n" "#include Estdlib.hE>\n" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:241 #, no-wrap msgid "" "#define LOCKFILE \"/etc/ptmp\"\n" "\\&...\n" "int pfd;\n" "FILE *fpfd;\n" "\\&...\n" "if ((fpfd = fdopen (pfd, \"w\")) == NULL) {\n" " close(pfd);\n" " unlink(LOCKFILE);\n" " exit(1);\n" "}\n" "\\&...\n" msgstr "" #. type: SH #: man-pages-posix/man3p/close.3p:244 #, no-wrap msgid "APPLICATION USAGE" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:255 msgid "" "An application that had used the I routine I() to open a file " "should use the corresponding I() routine rather than I(). " "Once a file is closed, the file descriptor no longer exists, since the " "integer corresponding to it no longer refers to a file." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:276 msgid "" "Implementations may use file descriptors that must be inherited into child " "processes for the child process to remain conforming, such as for message " "catalog or tracing purposes. Therefore, an application that calls I() " " on an arbitrary integer risks non-conforming behavior, and I() can " "only portably be used on file descriptor values that the application has " "obtained through explicit actions, as well as the three file descriptors " "corresponding to the standard file streams. In multi-threaded parent " "applications, the practice of calling I() in a loop after I() " "and before an I call in order to avoid a race condition of leaking an " "unintended file descriptor into a child process, is therefore unsafe, and " "the race should instead be combatted by opening all file descriptors with " "the FD_CLOEXEC bit set unless the file descriptor is intended to be " "inherited across I." msgstr "" #. type: SH #: man-pages-posix/man3p/close.3p:276 #, no-wrap msgid "RATIONALE" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:285 msgid "" "The use of interruptible device close routines should be discouraged to " "avoid problems with the implicit closes of file descriptors by I and " "I(). This volume of POSIX.1\\(hy2008 only intends to permit such " "behavior by specifying the B<[EINTR]> error condition." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:290 msgid "" "Note that the requirement for I() on a socket to block for up to the " "current linger interval is not conditional on the O_NONBLOCK setting." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:298 msgid "" "The standard developers rejected a proposal to add I() to the " "standard. Because the standard permits implementations to use inherited file " "descriptors as a means of providing a conforming environment for the child " "process, it is not possible to standardize an interface that closes " "arbitrary file descriptors above a certain value while still guaranteeing a " "conforming environment." msgstr "" #. type: SH #: man-pages-posix/man3p/close.3p:298 #, no-wrap msgid "FUTURE DIRECTIONS" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:300 msgid "None." msgstr "" #. type: SH #: man-pages-posix/man3p/close.3p:300 #, no-wrap msgid "SEE ALSO" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:310 msgid "" "I
, I, I\\^, I\\^(\\|), " "I\\^(\\|), I\\^(\\|), I\\^(\\|), I\\^(\\|), " "I\\^(\\|), I\\^(\\|)" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:313 msgid "The Base Definitions volume of POSIX.1\\(hy2008, Bunistd.hE>" msgstr "" #. type: SH #: man-pages-posix/man3p/close.3p:313 #, no-wrap msgid "COPYRIGHT" msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:324 msgid "" "Portions of this text are reprinted and reproduced in electronic form from " "IEEE Std 1003.1, 2013 Edition, Standard for Information Technology -- " "Portable Operating System Interface (POSIX), The Open Group Base " "Specifications Issue 7, Copyright (C) 2013 by the Institute of Electrical " "and Electronics Engineers, Inc and The Open Group. (This is POSIX.1-2008 " "with the 2013 Technical Corrigendum 1 applied.) In the event of any " "discrepancy between this version and the original IEEE and The Open Group " "Standard, the original IEEE and The Open Group Standard is the referee " "document. The original Standard can be obtained online at http://www.unix." "org/online.html ." msgstr "" #. type: Plain text #: man-pages-posix/man3p/close.3p:329 msgid "" "Any typographical or formatting errors that appear in this page are most " "likely to have been introduced during the conversion of the source files to " "man page format. To report such errors, see https://www.kernel.org/doc/man-" "pages/reporting_bugs.html ." msgstr ""