Unix-system-calls-epoll-ctl
[top]#
[[File:]]
[[File:]] |
|Web |This Site
- 初心者向けのUnix *
- Unix-ホーム
- Unix-はじめに
- Unix-ファイル管理
- Unix-ディレクトリ
- Unix-ファイル権限
- Unix-環境
- Unix-基本ユーティリティ
- Unix-パイプとフィルタ
- Unix-プロセス
- Unix-コミュニケーション
- Unix-The Vi Editor
- Unix Shellプログラミング*
- Unix-シェルとは?
- Unix-変数の使用
- Unix-特殊変数
- Unix-配列の使用
- Unix-基本的な演算子
- Unix-意思決定
- Unix-シェルループ
- Unix-ループ制御
- Unix-シェル置換
- Unix-引用メカニズム
- Unix-IOリダイレクト
- UNIX-シェル関数
- Unix-マンページヘルプ
- 高度なUnix *
- Unix-正規表現
- Unix-ファイルシステムの基本
- Unix-ユーザー管理
- Unix-システムパフォーマンス
- Unix-システムログ
- Unix-信号とトラップ
- Unixの便利なリファレンス*
- Unix-便利なコマンド
- Unix-クイックガイド
- Unix-組み込み関数
- Unix-システムコール
- Unix-コマンドリスト
- Unixの役立つリソース*
- Unix役立つリソース
選択した読書
- http://www.finddevguides.com/computer_glossary [コンピュータ用語集] *http://www.finddevguides.com/computer_whoiswho[Who is Who]
Copyright©2014 by finddevguides
Home | References | Discussion Forums | About TP |
epoll_ctl()-Unix、Linuxシステムコール
[[File:]] image :http://www.finddevguides.com/images/next.gif [next] image:http://www.finddevguides.com/add- this.gif [AddThisソーシャルブックマークボタン]
広告
NAME
epoll_ctl-epoll記述子の制御インターフェース
概要
#include <sys/epoll.h> int epoll_ctl(int epfd, int op, int fd, struct epoll_event* event) |
説明
ターゲットファイル記述子_fd_に対して操作_op_を実行するように要求することにより、 epoll 記述子_epfd_を制御します。 _event_は、ファイル記述子_fd_にリンクされたオブジェクトを記述します。 _struct epoll_event_は次のように定義されます:
typedef union epoll_data { void *ptr; int fd; __uint32_t u32; __uint64_t u64; } epoll_data_t; struct epoll_event { __uint32_t events; /*Epoll events*/ epoll_data_t data; /*User data variable*/ }; |
_events_メンバーは、次の利用可能なイベントタイプを使用して構成されたビットセットです。
エラーコード
説明
エポリン
関連ファイルは、* read *(2)操作に使用できます。
関連付けられたファイルは、 write (2)操作に使用できます。
ストリームソケットピアが接続を閉じたか、接続の半分を書き込んでシャットダウンしました。 (このフラグは、Edge Triggered監視を使用しているときにピアのシャットダウンを検出する簡単なコードを書くのに特に役立ちます。)
関連するファイル記述子でエラー状態が発生しました。 epoll_wait (2)は常にこのイベントを待機します。 _events_で設定する必要はありません。
関連付けられたファイル記述子でハングアップしました。 epoll_wait (2)は常にこのイベントを待機します。 _events_で設定する必要はありません。
- エポレット *
関連付けられたファイル記述子のEdge Triggered動作を設定します。* epoll のデフォルトの動作はLevel Triggeredです。 EdgeおよびLevel Triggeredイベント配布アーキテクチャの詳細については、 *epoll (7)を参照してください。
関連するファイル記述子のワンショット動作を設定します。 これは、 epoll_wait (2)でイベントが取り出された後、関連するファイル記述子が内部的に無効になり、 epoll インターフェースによって他のイベントが報告されないことを意味します。 ユーザーは、 EPOLL_CTL_MOD を指定して epoll_ctl (2)を呼び出し、新しいイベントマスクでファイル記述子を再度有効にする必要があります。
Code | Description |
---|---|
*EPOLL_CTL_ADD * | Add the target file descriptor fd to the* epoll* descriptor epfd and associate the event event with the internal file linked to fd. |
EPOLL_CTL_MOD | Change the event event associated with the target file descriptor fd. |
*EPOLL_CTL_DEL * | Remove the target file descriptor fd from the* epoll* file descriptor, epfd. The event is ignored and can be NULL (but see BUGS below). |
返り値
成功すると、 epoll_ctl (2)はゼロを返します。 エラーが発生すると、 epoll_ctl (2)は-1を返し、_errno_が適切に設定されます。
エラー
Error Code | Description |
---|---|
EBADF | epfd or fd is not a valid file descriptor. |
EEXIST | op was EPOLL_CTL_ADD, and the supplied file descriptor fd is already in epfd. |
*EINVAL * | epfd is not an* epoll* file descriptor, or fd is the same as epfd, or the requested operation op is not supported by this interface. |
ENOENT | op was EPOLL_CTL_MOD or EPOLL_CTL_DEL, and fd is not in epfd. |
ENOMEM | There was insufficient memory to handle the requested op control operation. |
*EPERM * | The target file fd does not support* epoll*. |
準拠
BUGS
2.6.9より前のカーネルバージョンでは、 EPOLL_CTL_DEL 操作では、_event_にNULL以外のポインターが必要でしたが、この引数は無視されます。 カーネル2.6.9以降、 EPOLL_CTL_DEL を使用する場合、_event_をNULLとして指定できます。
関連項目
[[File:]] image :http://www.finddevguides.com/images/next.gif [next] [[File:]]
広告
Advertisements |