aio_cancel

Section: C Library Functions (3)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

aio_cancel - 完了していない非同期 I/O リクエストをキャンセルする  

ライブラリ

リアルタイムライブラリ (librt,~-lrt)  

書式

#include <aio.h>

int aio_cancel(int fd, struct aiocb *aiocbp);
 

説明

aio_cancel() 関数は、ファイルディスクリプター fd についての完了して いない非同期 I/O リクエストをキャンセルしようとする。 aiocbp が NULL の場合、そのような全てのリクエストがキャンセルされる。 aiocbp が NULL でない場合、aiocbp で指された制御ブロックで記述されたリクエ ストのみがキャンセルされる。(aiocb 構造体の説明は aio(7) を参照)

Normal asynchronous notification occurs for canceled requests (see aio(7) and sigevent(3type)). The request return status (aio_return(3)) is set to -1, and the request error status (aio_error(3)) is set to ECANCELED. The control block of requests that cannot be canceled is not changed.

リクエストがキャンセルできない場合には、 aio_cancel() は通常の I/O 操作の実行後と同じように終了する。 (この場合、 aio_error(3) はステータス EINPROGRESSS を返す)。

aiocbp が NULL でなく、かつ fd が非同期操作が開始されたファイルディスクリプターと異なる場合、 生じる結果は不定である。

どの操作をキャンセルできるかは、実装定義である。  

返り値

aio_cancel() 関数は以下のいずれかの値を返す。
AIO_CANCELED
全てのリクエストが正常にキャンセルされた。
AIO_NOTCANCELED
指定されたリクエストのうち少なくとも一つが、実行中のため キャンセルできなかった。この場合には、aio_error(3) を使って 個々のリクエストの状態を確認できる。
AIO_ALLDONE
呼び出しの前に全てのリクエストがすでに完了していた。
-1
An error occurred. The error can be found by inspecting errno.
 

エラー

EBADF
fd が有効なファイルディスクリプターでない。
ENOSYS
aio_cancel() は実装されていない。
 

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース属性値
aio_cancel() Thread safetyMT-Safe
 

標準規格

POSIX.1-2008.  

歴史

glibc 2.1. POSIX.1-2001.  

例

aio(7) を参照。  

関連項目

aio_error(3), aio_fsync(3), aio_read(3), aio_return(3), aio_suspend(3), aio_write(3), lio_listio(3), aio(7)


 

Index

名前
ライブラリ
書式
説明
返り値
エラー
属性
標準規格
歴史
例
関連項目

This document was created by man2html, using the manual pages.