flaneur2020 / fleurix

an unix-like toy os kernel
BSD 3-Clause "New" or "Revised" License
286 stars 60 forks source link

what's the meaning of 'write(0, "", 0);' in cat.c #3

Closed chobits closed 12 years ago

chobits commented 12 years ago

RT

flaneur2020 commented 12 years ago

这里该是个诡异的bug,没有找到原因,但是诡异地workaround过去了..囧 刚刚调了一下依然无解中,明天好好整整它 :p

flaneur2020 commented 12 years ago

最后发现是因为这句...怪不得有随机性囧...

-    fd = open(pathp, "r", 0);
+    fd = open(pathp, O_RDONLY, 0);