Unix-system-calls-fchownat

提供:Dev Guides
移動先:案内検索

[top]#

|http://www.google.com/[Google] | a|

Web This Site
  • 初心者向けのUnix *
  • 高度なUnix *

選択した読書

Copyright©2014 by finddevguides

[cols=",,,,,,,",]

| |  Home   | |  References   | |  Discussion Forums   | |  About TP  

[width="100%",cols="100%",]

a| == fchownat()-Unix、Linuxシステムコール

[[File:]] image :http://www.finddevguides.com/images/next.gif [next] image:http://www.finddevguides.com/add- this.gif [AddThisソーシャルブックマークボタン]

広告

NAME

fchownat-ディレクトリファイル記述子に関連するファイルの所有権を変更する

概要

#include <unistd.h> int fchownat(int dirfd, const char* path, uid_t owner, gid_t group, int flags);

説明

*fchownat* ()システムコールは、このマニュアルページで説明されている違いを除き、 *chown* (2)とまったく同じように動作します。

_path_で指定されたパス名が相対である場合、ファイル記述子_dirfd_によって参照されるディレクトリを基準として解釈されます(呼び出しプロセスの現在の作業ディレクトリに相対するのではなく、 chown (2)によって行われます)相対パス名)。

_path_で指定されたパス名が相対であり、_dirfd_が特別な値 AT_FDCWD である場合、_path_は呼び出し側プロセスの現在の作業ディレクトリに関連して解釈されます( chown (2)など)。

_path_で指定されたパス名が絶対の場合、_dirfd_は無視されます。

_flags_は0にするか、次のフラグを含めることができます。

Tag Description
*AT_SYMLINK_NOFOLLOW * If path is a symbolic link, do not dereference it: instead operate on the link itself, like* lchown*(2). (By default, fchownat() dereferences symbolic links, like chown(2).)

返り値

成功すると、 fchownat ()は0を返します。 エラーの場合、-1が返され、_errno_がエラーを示すように設定されます。

エラー

*chown* (2)で発生する同じエラーは、 *fchownat* ()でも発生する可能性があります。 *fchownat* ()で次の追加エラーが発生する可能性があります。
Tag Description
EBADF dirfd is not a valid file descriptor.
EINVAL Invalid flag specified in flags.
ENOTDIR path is a relative path and dirfd is a file descriptor referring to a file other than a directory.

ノート

*fchownat* ()の必要性の説明については、 *openat* (2)を参照してください。

準拠

このシステムコールは非標準ですが、POSIX.1の将来のリビジョンに含めることを提案しています。 Solarisにも同様のシステムコールが存在します。

バージョン

*fchownat* ()はカーネル2.6.16でLinuxに追加されました。

関連項目

[[File:]] image :http://www.finddevguides.com/images/next.gif [next] [[File:]]

広告

|  

[cols="^",]

|Advertisements