Skip to content

Commit

Permalink
Prep 241.1: Re-add sd_is_mq(), but make it a stub
Browse files Browse the repository at this point in the history
Bug: #97
Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
  • Loading branch information
Yamakuzure committed Mar 20, 2019
1 parent 54705c4 commit 64c0b9c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
1 change: 0 additions & 1 deletion cb/elogind.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<Add option="-Wall" />
</Compiler>
<Unit filename="../README" />
<Unit filename="../man/busctl.xml" />
<Unit filename="../man/custom-entities.ent.in" />
<Unit filename="../man/custom-html.xsl" />
<Unit filename="../man/custom-man.xsl" />
Expand Down
22 changes: 0 additions & 22 deletions man/sd_is_fifo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,28 +160,6 @@
whether the specified file descriptor refers to a POSIX message
queue. As elogind does not need and therefore does not support POSIX
message queues, this function is a stub that always returns 0.</para>

<para>The reason for not supporting this function is, that it would
pull in a dependency to librt, just for this one function.</para>

<para>If you need to check for POSIX message queues, you could implement
the check yourself like this:</para>

<programlisting>#include &lt;mqueue.h&gt;
int is_mq(int fd) {
struct mq_attr attr;

if (mq_getattr(fd, &amp;attr) &lt; 0) {
if (errno == EBADF)
/* A non-mq fd */
return 0;
return -errno;
}

return 1;
}
…</programlisting>
<!-- // 0 -->

<para><function>sd_is_special()</function> may be called to check
Expand Down

0 comments on commit 64c0b9c

Please sign in to comment.