| 総合手引 | セクション 9 | English | オプション |
#include <sys/param.h>
#include <sys/vnode.h>
引数は以下の通りです。
| vp | |
| ファイルの vnode。 | |
| mode | |
| 呼び出しプロセスによって要求されたアクセスモード。 | |
| td | |
| ファイルにアクセスしているスレッド。 | |
加えて、 VOP_OPEN() は fdidx の中のファイル記述子番号を受け入れることが可能です。 これは例えば fdesc(5) のような情報を要求するファイルシステムで有用です。
アクセスモードは、 FREAD, FWRITE, O_NONBLOCK, O_APPEND を含むフラグの組です。
VOP_CLOSE() は、vnode に結びつけられた参照が少なくとも 1 個は存在することを期待し、 vnode がロックされているかどうかは気にしません。 ロックおよび参照状態は、戻る時に変更されずにそのままになります。 vn_close は、ロックされていない参照された vnode を期待し、 戻る前に参照を手繰ることに注意してください。
int
vop_open(struct vnode *vp, int mode, struct ucred *cred, struct thread *td)
{
/*
* ほとんどのファイルシステムは、ここでは大したことはしません。
*/
return 0;
}
| VOP_OPEN (9) | July 24, 1996 |
| 総合手引 | セクション 9 | English | オプション |
このマニュアルページサービスについてのご意見は Ben Bullock にお知らせください。 Privacy policy.
| “ | Our grievance is not just against Unix itself, but against the cult of Unix zealots who defend and nurture it. They take the heat, disease, and pestilence as givens, and, as ancient shamans did, display their wounds, some self-inflicted, as proof of their power and wizardry. We aim, through bluntness and humor, to show them that they pray to a tin god, and that science, not religion, is the path to useful and friendly technology. | ” |
| — The Unix Haters' handbook | ||