diff options
author | wollman <wollman@FreeBSD.org> | 2002-10-27 18:07:41 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 2002-10-27 18:07:41 +0000 |
commit | 7e9d4df21f95c33c9f6ee36ceffeb83ea7bcbe61 (patch) | |
tree | 2822b6cd0c488f5c61a84aca6c46f88a41665440 /sys/kern/kern_descrip.c | |
parent | 17bae0e5c0378e3bd58d79dec5a359f2d1b8347d (diff) | |
download | FreeBSD-src-7e9d4df21f95c33c9f6ee36ceffeb83ea7bcbe61.zip FreeBSD-src-7e9d4df21f95c33c9f6ee36ceffeb83ea7bcbe61.tar.gz |
Change the way support for asynchronous I/O is indicated to applications
to conform to 1003.1-2001. Make it possible for applications to actually
tell whether or not asynchronous I/O is supported.
Since FreeBSD's aio implementation works on all descriptor types, don't
call down into file or vnode ops when [f]pathconf() is asked about
_PC_ASYNC_IO; this avoids the need for every file and vnode op to know about
it.
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r-- | sys/kern/kern_descrip.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 6c9ca9d..13b339b 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -969,6 +969,12 @@ fpathconf(td, uap) if ((error = fget(td, uap->fd, &fp)) != 0) return (error); + + /* If asynchronous I/O is available, it works for all descriptors. */ + if (uap->name == _PC_ASYNC_IO) { + td->td_retval[0] = async_io_version; + goto out; + } switch (fp->f_type) { case DTYPE_PIPE: case DTYPE_SOCKET: @@ -990,6 +996,7 @@ fpathconf(td, uap) error = EOPNOTSUPP; break; } +out: fdrop(fp, td); return (error); } |