TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why did 16-bit _lopen and _lcreat functions return -1 on failure instead of 0?

6 点作者 nikbackm超过 1 年前

1 comment

NikkiA超过 1 年前
That, surprisingly for raymond, doesn&#x27;t actually answer the question, since you cannot request opening stdin&#x2F;stdout&#x2F;stderr via this API, the values 0..2 are also invalid return values.<p>(&#x2F;dev&#x2F;stdin, &#x2F;dev&#x2F;stdout, &#x2F;dev&#x2F;stderr exist today, but did not then, and even today I don&#x27;t think you can open&#x2F;create them since they are symlinks to &#x2F;proc&#x2F;self&#x2F;fd&#x2F;0..2 and thus open(&quot;&#x2F;dev&#x2F;stdin&quot;, ...) returns -1)<p>AFAIK if you close(0) you lose your stdin and never see it again.
评论 #37581002 未加载