📄 getchar_unlocked.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>getc_unlocked</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_005_470"> </a>NAME</h4><blockquote>getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked- stdio with explicit client locking</blockquote><h4><a name = "tag_000_005_471"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="stdio.h.html">stdio.h</a>>int getc_unlocked(FILE *<i>stream</i>);int getchar_unlocked(void);int putc_unlocked(int <i>c</i>, FILE *<i>stream</i>);int putchar_unlocked(int <i>c</i>);</code></pre></blockquote><h4><a name = "tag_000_005_472"> </a>DESCRIPTION</h4><blockquote>Versions of the functions<i><a href="getc.html">getc()</a></i>,<i><a href="getchar.html">getchar()</a></i>,<i><a href="putc.html">putc()</a></i>,and<i><a href="putchar.html">putchar()</a></i>respectively named<i>getc_unlocked()</i>,<i>getchar_unlocked()</i>,<i><a href="putc_unlocked.html">putc_unlocked()</a></i>,and<i><a href="putchar_unlocked.html">putchar_unlocked()</a></i>are provided which are functionally identical to the original versionswith the exception that they are not required to be implementedin a thread-safe manner.They may only safely be used within a scope protected by<i><a href="flockfile.html">flockfile()</a></i>(or<i><a href="ftrylockfile.html">ftrylockfile()</a></i>)and<i><a href="funlockfile.html">funlockfile()</a></i>.These functions may safely be used in a multi-threaded programif and only if they are calledwhile the invoking thread owns the (<b> FILE *</b>)object, as is the case after a successful call of the<i><a href="flockfile.html">flockfile()</a></i>or<i><a href="ftrylockfile.html">ftrylockfile()</a></i>functions.</blockquote><h4><a name = "tag_000_005_473"> </a>RETURN VALUE</h4><blockquote>See<i><a href="getc.html">getc()</a></i>,<i><a href="getchar.html">getchar()</a></i>,<i><a href="putc.html">putc()</a></i>,and<i><a href="putchar.html">putchar()</a></i>.</blockquote><h4><a name = "tag_000_005_474"> </a>ERRORS</h4><blockquote>No errors are defined. </blockquote><h4><a name = "tag_000_005_475"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_476"> </a>APPLICATION USAGE</h4><blockquote>Because they may be implemented as macros, <i>getc_unlocked()</i>and <i>putc_unlocked()</i> may treat incorrectly a stream argumentwith side effects.In particular,<i>getc_unlocked</i>(*<i>f</i>++)and<i>putc_unlocked</i>(*<i>f</i>++)will not necessarily work as expected.Therefore, use of these functions should be preceded by the appropriate "#undef getc_unlocked" or "#undef putc_unlocked" statementin such situations. </blockquote><h4><a name = "tag_000_005_477"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_478"> </a>SEE ALSO</h4><blockquote><i><a href="getc.html">getc()</a></i>,<i><a href="getchar.html">getchar()</a></i>,<i><a href="putc.html">putc()</a></i>,<i><a href="putchar.html">putchar()</a></i>,<i><a href="stdio.h.html"><stdio.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from the POSIX Threads Extension (1003.1c-1995)</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -