討論區: 幫助論壇 (Thread #3796)

/etc/rc (2003-11-18 16:20 by j_akita #6672)

秋田と申します。
自作プログラムを、/etc/rc から起動しているのですが、
select()で標準入力(fd=0)の入力の有無をチェックしているプログラムを
/etc/rcから起動すると、
----
select: Bad file descriptor
----
というエラーが表示されます。

このプログラムを、/etc/rcからではなく、起動後に手動で起動すると、問題なく動くようです。

デバイスファイルがらみの問題のような気もするのですが、原因、なにかわかりませんでしょうか・・・?

回覆 #6672×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登入

RE: /etc/rc (2003-11-26 23:16 by ysato #6778)

initの仕様でstdinは閉じた状態になっているようです。
なんでそんな仕様になっているのか謎ですが。

自分で/dev/console開いて使うのが一番確実そうですね。
回覆: #6672

回覆 #6778×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登入

RE: /etc/rc (2003-11-27 11:50 by j_akita #6786)

ご指摘ありがとうございました。
たしかに/dev/console をopen()でひらけば大丈夫でした。
そういう仕様だったんですね・・・
回覆: #6778

回覆 #6786×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登入