aio_suspend

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

名前

aio_suspend - 非同期 I/O 操作またはタイムアウトを待つ  

ライブラリ

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

書式


#include <aio.h>

int aio_suspend(int n;
                const struct aiocb *const aiocb_list[n], int n,
                const struct timespec *restrict timeout);
 

説明

aio_suspend() 関数は、以下のいずれかが発生するまで 呼び出したスレッドの実行を停止 (suspend) する。
•
aiocb_list リスト内の非同期 I/O リクエストのうち、少なくとも一つが完了した。
•
シグナルが配送された。
•
timeout が NULL でない場合に、指定した時間が経過した (timespec 構造体の詳細は nanosleep(2) を参照)。

The n argument specifies the number of items in aiocb_list. Each item in the list pointed to by aiocb_list must be either NULL (and then is ignored), or a pointer to a control block on which I/O was initiated using aio_read(3), aio_write(3), or lio_listio(3). (See aio(7) for a description of the aiocb structure.)

If CLOCK_MONOTONIC is supported, this clock is used to measure the timeout interval (see clock_gettime(2)).  

返り値

aiocb_list で指定された I/O リクエストの 1 つが完了した後に この関数が返った場合は、0 が返される。 それ以外の場合は、 -1 が返り、 errno にエラーを示す値に設定される。  

エラー

EAGAIN
指示された操作のどれも完了しないうちに、呼び出しがタイムアウトした。
EINTR
この呼び出しがシグナルによって終了させられた (このシグナルは、完了を待っていた 操作のいずれかの完了シグナルの可能性もある)。signal(7) 参照。
ENOSYS
aio_suspend() は実装されていない。
 

属性

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

標準規格

POSIX.1-2008.  

歴史

glibc 2.1. POSIX.1-2001.

POSIX doesn't specify the parameters to be restrict; that is specific to glibc.  

注意

時間間隔が 0 であることを指定する NULL ではない timeout を使って、ポーリングを行うこともできる。

aiocb_list リストで指定した非同期 I/O 操作のうち、 aio_suspend() を呼び出した時点ですでに完了したものがある場合、 aio_suspend() はすぐに返る。

aio_suspend() が成功で返った後でどの I/O 操作が完了したかを特定するには、 aio_error(3) を使って aiocb_list が指す aiocb 構造体のリストを スキャンする。  

バグ

aio_suspend() の glibc 実装は、 POSIX.1 の要件を満たしていないが、 async-signal-safe (非同期シグナルで安全) ではない。  

関連項目

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


 

Index

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

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