<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tokuchan3515</author_name>
  <author_url>https://blog.hatena.ne.jp/tokuchan3515/</author_url>
  <blog_title>備忘録やめた</blog_title>
  <blog_url>https://tokuchan3515.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>つまり，次のプログラムは，lsコマンドの出力を標準出力に出すのではなく，foo.txtに書き込む． #include &lt;fcntl.h&gt; #include &lt;stdio.h&gt; #include &lt;unistd.h&gt; int main(void) { close(STDOUT_FILENO); int fd = open(&quot;foo.txt&quot;, O_CREAT | O_WRONLY, 0644); if (fd != STDOUT_FILENO) { printf(&quot;fd: %d, stdout: %d\n&quot;, fd, STDOUT_FILENO); } else { execl(&quot;/bin/ls…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftokuchan3515.hatenablog.com%2Fentry%2F2021%2F04%2F02%2F235938&quot; title=&quot;execシステムコールは既存のファイルデスクリプタを保持する - 備忘録やめた&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-04-02 23:59:38</published>
  <title>execシステムコールは既存のファイルデスクリプタを保持する</title>
  <type>rich</type>
  <url>https://tokuchan3515.hatenablog.com/entry/2021/04/02/235938</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
