<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kakts</author_name>
  <author_url>https://blog.hatena.ne.jp/kakts/</author_url>
  <blog_title>kakts-log</blog_title>
  <blog_url>https://kakts.dev/</blog_url>
  <categories>
    <anon>c</anon>
  </categories>
  <description>概要 fork()による子プロセスを作成するプログラムにおいて、printfなどのstdioライブラリの関数を実行した場合、標準出力が端末とファイルの場合で出力結果が異なる場合があります。 この挙動について整理します。 (参考: LINUXプログラミングインタフェース25.4) fork()とprintf()を利用した例 下記のように、fork()の前にprintfで文字列出力させ、その後fork()によって子プロセスを作成するプログラムを例とします。 #include &quot;tlpi_hdr.h&quot; #include &lt;stdio.h&gt; #include &lt;unistd.h&gt; int main(i…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkakts.dev%2Fentry%2F2023%2F11%2F09%2F002029&quot; title=&quot;stdioバッファの方式について - kakts-log&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>2023-11-09 00:20:29</published>
  <title>stdioバッファの方式について</title>
  <type>rich</type>
  <url>https://kakts.dev/entry/2023/11/09/002029</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
