| 総合手引 | セクション 9 | English | オプション |
#include <sys/param.h>
#include <sys/vnode.h>
#include <sys/namei.h>
引数は以下の通りです。
| dvp | |
| ディレクトリのロックされた vnode。 | |
| vpp | |
| 作成結果のロックされた vnode が格納されるべき、変数のアドレス。 | |
| cnp | |
| 生成された要素のパス名。 | |
| vap | |
| 新しいオブジェクトの作成時に使用されるべき属性。 | |
| target | |
| シンボリックリンクの対象のパス名。 | |
これらのエントリポイントは、オブジェクトの生成中に VOP_LOOKUP(9) の後に呼び出されます。
int
vop_create(struct vnode *dvp,
struct vnode **vpp,
struct componentname *cnp
struct vattr *vap)
{
int mode = MAKEIMODE(vap->va_type, vap->va_mode);
struct vnode *vp;
int error;
*vpp = NULL;
if ((mode & IFMT) == 0)
mode |= IFREG;
error = SOMEFS_VALLOC(dvp, mode, cnp->cn_cred, &vp);
if (error)
return error;
/*
* 新しい vnode のパーミッションを更新します。
* これには、ディレクトリからのグループのコピーを含みます。
*/
...;
#ifdef QUOTA
/*
* できる限りクォータ情報をチェックします。
*/
...;
#endif
/*
* ディレクトリに新しい vnode を入れ、ディレクトリ内容が変更される
* 前に vnode がディスクをアクセスしない様に注意します。
*/
error = ...;
if (error)
goto bad;
*vpp = vp;
return 0;
bad:
/*
* inode またはディレクトリの更新の試みで書き込みエラーが
* 発生したため inode の割り当てを解放しなければなりません。
*/
vput(vp);
/*
* vp のためのファイルシステム資源を解放。
*/
...;
return error;
}
| [ENOSPC] | |
| ファイルシステムが一杯です。 | |
| [EDQUOT] | |
| そのユーザのファイルシステム空間または inode のクォータを超過しました。 | |
| VOP_CREATE (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 | ||