semaphore.h.html
来自「unix 下的C开发手册,还用详细的例程。」· HTML 代码 · 共 72 行
HTML
72 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title><semaphore.h></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_008_351"> </a>NAME</h4><blockquote>semaphore.h - semaphores(<b>REALTIME</b>)</blockquote><h4><a name = "tag_000_008_352"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <semaphore.h></code></pre></blockquote><h4><a name = "tag_000_008_353"> </a>DESCRIPTION</h4><blockquote>The<i><semaphore.h></i>header defines the<b>sem_t</b>type, used in performing semaphore operations. The semaphore may beimplemented using a file descriptor, in which case applications areable to open up at least a total of OPEN_MAX files and semaphores.<p>The symbol SEM_FAILED is defined (see <i><a href="sem_open.html">sem_open()</a></i>).<p>The following are declared as functions and may also be declared asmacros.Function prototypes must be provided for use with an ISO Ccompiler.<pre><code>int <a href="sem_close.html">sem_close</a>(sem_t *);int <a href="sem_destroy.html">sem_destroy</a>(sem_t *);int <a href="sem_getvalue.html">sem_getvalue</a>(sem_t *, int *);int <a href="sem_init.html">sem_init</a>(sem_t *, int, unsigned int);sem_t *<a href="sem_open.html">sem_open</a>(const char *, int, ...);int <a href="sem_post.html">sem_post</a>(sem_t *);int <a href="sem_trywait.html">sem_trywait</a>(sem_t *);int <a href="sem_unlink.html">sem_unlink</a>(const char *);int <a href="sem_wait.html">sem_wait</a>(sem_t *);</code></pre><p>Inclusion of the<i><semaphore.h></i>header may make visible symbols defined in the headers<i><a href="fcntl.h.html"><fcntl.h></a></i>and<i><a href="systypes.h.html"><sys/types.h></a></i>.</blockquote><h4><a name = "tag_000_008_354"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_355"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_356"> </a>SEE ALSO</h4><blockquote><i><a href="fcntl.h.html"><fcntl.h></a></i>,<i><a href="systypes.h.html"><sys/types.h></a></i>.</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 + =
减小字号Ctrl + -
显示快捷键?