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/vfs_extattr.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/vfs_extattr.c')
-rw-r--r-- | sys/kern/vfs_extattr.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 6e2aa6b..55aea6e 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -93,6 +93,14 @@ int (*union_dircheckp)(struct thread *td, struct vnode **, struct file *); int (*softdep_fsync_hook)(struct vnode *); /* + * The module initialization routine for POSIX asynchronous I/O will + * set this to the version of AIO that it implements. (Zero means + * that it is not implemented.) This value is used here by pathconf() + * and in kern_descrip.c by fpathconf(). + */ +int async_io_version; + +/* * Sync each mounted filesystem. */ #ifndef _SYS_SYSPROTO_H_ @@ -1823,7 +1831,12 @@ pathconf(td, uap) if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = VOP_PATHCONF(nd.ni_vp, SCARG(uap, name), td->td_retval); + + /* If asynchronous I/O is available, it works for all files. */ + if (uap->name == _PC_ASYNC_IO) + td->td_retval[0] = async_io_version; + else + error = VOP_PATHCONF(nd.ni_vp, uap->name, td->td_retval); vput(nd.ni_vp); return (error); } |