


     aio_read(rt.os/aio)VSRT 5.1.1 (The	Open Group)aio_read(rt.os/aio)



     NAME
	  rt.os/aio/aio_read - asynchronous read from a	file testset

     DESCRIPTION
	  Tests	the aio_read() function	for conformance	to System
	  Interfaces and Headers, Issue	5 Page:	aio_read().

     TESTS
     Compliance
	  1    If _POSIX_ASYNCHRONOUS_IO is defined or the
	       implementation supports the aio_read() function as
	       described in System Interfaces and Headers, Issue 5:
		 A successful call to aio_read() shall initiate	or
		 queue a request on behalf of the calling process to
		 read aiocbp->aio_nbytes from the file associated with
		 aiocbp->aio_fildes into the buffer pointed to by
		 aiocbp->aio_buf and return 0.

	  2    If _POSIX_ASYNCHRONOUS_IO and _POSIX_PRIORITIZED_IO are
	       defined or the implementation supports the aio_read()
	       function	as described in	System Interfaces and Headers,
	       Issue 5:
		 The request generated by a call to aio_read() from a
		 process whose scheduling policy is SCHED_FIFO or
		 SCHED_RR shall	be queued in priority order at a
		 priority equal	to the scheduling priority of the
		 process minus aiocbp->aio_reqprio for values of
		 aiocbp->aio_reqprio which lower the operation
		 priority, in the range	0 to {AIO_PRIO_DELTA_MAX}.

	  3    If _POSIX_ASYNCHRONOUS_IO and _POSIX_PRIORITIZED_IO are
	       defined or the implementation supports the aio_read()
	       function	as described in	System Interfaces and Headers,
	       Issue 5,	and the	implementation supports	prioritized
	       I/O on character	special	files:
		 Requests generated by calls to	aio_read() from
		 processes whose scheduling policy is SCHED_FIFO or
		 SCHED_RR with the same	priority to a character
		 special file shall be processed by the	underlying
		 device	in FIFO	order.

	  4    If _POSIX_ASYNCHRONOUS_IO is defined or the
	       implementation supports the aio_read() function as
	       described in System Interfaces and Headers, Issue 5:
		 Unless	aiocbp->aio_fildes is associated with a	device
		 which is incapable of seeking the request generated
		 by a call to aio_read() shall take place at the
		 absolute position in the file given by	aiocbp-
		 >aio_offset.

	  5    If _POSIX_ASYNCHRONOUS_IO is defined or the
	       implementation supports the aio_read() function as



     Page 1					    (printed 2/21/103)






     aio_read(rt.os/aio)VSRT 5.1.1 (The	Open Group)aio_read(rt.os/aio)



	       described in System Interfaces and Headers, Issue 5:
		 On a call to aio_read() when aiocbp-
		 >aio_sigevent.sigev_notify is SIGEV_NONE no
		 asynchronous notification shall be delivered when the
		 operation completes.

	  6    If _POSIX_ASYNCHRONOUS_IO is defined or the
	       implementation supports the aio_read() function as
	       described in System Interfaces and Headers, Issue 5:
		 On a call to aio_read() when aiocbp-
		 >aio_sigevent.sigev_notify is SIGEV_SIGNAL the	signal
		 specified in aiocbp->aio_sigevent.sigev_signo shall
		 be generated for the process when the operation
		 completes.

	  7    If _POSIX_ASYNCHRONOUS_IO and _POSIX_REALTIME_SIGNALS
	       are defined or the implementation supports the
	       aio_read() function as described	in System Interfaces
	       and Headers, Issue 5:
		 On a call to aio_read() when aiocbp-
		 >aio_sigevent.sigev_notify is SIGEV_SIGNAL and	the
		 SA_SIGINFO flag is set	for the	signal specified in
		 aiocbp->aio_sigevent.sigev_signo, the signal shall be
		 queued	for the	process	when it	is generated and the
		 value specified in aiocbp->aio_sigevent.sigev_value
		 shall be in the si_value component of the generated
		 signal.

	  8    If _POSIX_ASYNCHRONOUS_IO and _POSIX_REALTIME_SIGNALS
	       are defined or the implementation supports the
	       aio_read() function as described	in System Interfaces
	       and Headers, Issue 5:
		 On a call to aio_read() when aiocbp-
		 >aio_sigevent.sigev_notify is SIGEV_THREAD the
		 function in aiocbp-
		 >aio_sigevent.sigev_notify_function shall be called
		 with the value	of aiocbp->aio_sigevent.sigev_value as
		 a parameter when the operation	completes, executed in
		 an environment	as if it were the start_routine	for a
		 newly created thread with thread attributes specified
		 by aiocbp->aio_sigevent.sigev_notify_attributes.

	  9    If _POSIX_ASYNCHRONOUS_IO and _POSIX_REALTIME_SIGNALS
	       are defined or the implementation supports the
	       aio_read() function as described	in System Interfaces
	       and Headers, Issue 5:
		 On a call to aio_read() when aiocbp-
		 >aio_sigevent.sigev_notify is SIGEV_THREAD and
		 aiocbp->aio_sigevent.sigev_notify_attributes is NULL,
		 the function in aiocbp-
		 >aio_sigevent.sigev_notify_function shall be called
		 with the value	of aiocbp->aio_sigevent.sigev_value as



     Page 2					    (printed 2/21/103)






     aio_read(rt.os/aio)VSRT 5.1.1 (The	Open Group)aio_read(rt.os/aio)



		 a parameter when the operation	completes, executed in
		 an environment	as if it were the start_routine	for a
		 newly created thread with the detachstate attribute
		 set to	PTHREAD_CREATE_DETACHED.

	  10   If _POSIX_ASYNCHRONOUS_IO is defined or the
	       implementation supports the aio_read() function as
	       described in System Interfaces and Headers, Issue 5:
		 The aiocbp argument to	aio_read() shall be usable as
		 an argument to	aio_error() and	aio_return() in	order
		 to determine the error	and return status,
		 respectively, of the operation	while it is
		 proceeding.

     Deviance
	  11   If _POSIX_ASYNCHRONOUS_IO is defined or the
	       implementation supports the aio_read() function as
	       described in System Interfaces and Headers, Issue 5:
		 When aiocbp->aio_fildes is not	a valid	file
		 descriptor open for reading, either:
		   the aio_read() function shall return	-1 and set
		   errno to EBADF
			   or
		   the return status of	the asynchronous operation
		   shall be set	to -1 and its error status shall be
		   set to EBADF.

	  12   If _POSIX_ASYNCHRONOUS_IO is defined or the
	       implementation supports the aio_read() function as
	       described in System Interfaces and Headers, Issue 5:
		 When the offset implied by aiocbp->aio_offset would
		 be invalid, either:
		   the aio_read() function shall return	-1 and set
		   errno to EINVAL
			   or
		   the return status of	the asynchronous operation
		   shall be set	to -1 and its error status shall be
		   set to EINVAL.

	  13   If _POSIX_ASYNCHRONOUS_IO is defined or the
	       implementation supports the aio_read() function as
	       described in System Interfaces and Headers, Issue 5:
		 When aiocbp->aio_reqprio is not a valid value,
		 either:
		   the aio_read() function shall return	-1 and set
		   errno to EINVAL
			   or
		   the return status of	the asynchronous operation
		   shall be set	to -1 and its error status shall be
		   set to EINVAL.

	  14   If _POSIX_ASYNCHRONOUS_IO is defined or the



     Page 3					    (printed 2/21/103)






     aio_read(rt.os/aio)VSRT 5.1.1 (The	Open Group)aio_read(rt.os/aio)



	       implementation supports the aio_read() function as
	       described in System Interfaces and Headers, Issue 5:
		 When aiocbp->aio_nbytes is not	a valid	value, either:
		   the aio_read() function shall return	-1 and set
		   errno to EINVAL
			   or
		   the return status of	the asynchronous operation
		   shall be set	to -1 and its error status shall be
		   set to EINVAL.

	  15   If _POSIX_ASYNCHRONOUS_IO is not	defined	and the
	       implementation does not support the aio_read() function
	       as described in System Interfaces and Headers, Issue 5:
		 A call	to aio_read() shall return -1 and set errno to
		 ENOSYS.

     Untestable	Aspects
	  1    If _POSIX_ASYNCHRONOUS_IO and _POSIX_SYNCHRONIZED_IO
	       are defined or the implementation supports the
	       aio_read() function as described	in System Interfaces
	       and Headers, Issue 5:
		 When synchronized I/O is enabled on the file
		 associated with aiocbp->aio_fildes the	behavior of a
		 call to aio_read() is as per the definitions of
		 synchronized I/O data integrity and synchronized I/O
		 file integrity.
		 Reason	for omission: It is not	possible to determine
		 in a portable manner whether data has been written to
		 the file-system.

	  2    If _POSIX_ASYNCHRONOUS_IO and _POSIX_PRIORITIZED_IO are
	       defined or the implementation supports the aio_read()
	       function	as described in	System Interfaces and Headers,
	       Issue 5:
		 When prioritized requests to the same file generated
		 by calls to aio_read()	are blocked waiting for	a
		 resource, higher priority requests shall be granted
		 the resource before lower priority requests.
		 Reason	for omission: There is no portable test	method
		 for this requirement.

	  3    If _POSIX_ASYNCHRONOUS_IO is defined or the
	       implementation supports the aio_read() function as
	       described in System Interfaces and Headers, Issue 5:
		 A call	to aio_read() shall return -1 and set errno to
		 EAGAIN	when the requested asynchronous	I/O operation
		 is not	queued due to temporary	resource limitations.
		 Reason	for omission: This is no reliable test method
		 for this assertion.

     Notes
	  Tests	must be	run against a file type	which is capable of



     Page 4					    (printed 2/21/103)






     aio_read(rt.os/aio)VSRT 5.1.1 (The	Open Group)aio_read(rt.os/aio)



	  seeking and for which	the implementation supports the
	  necessary types of Realtime I/O and provides an appropriate
	  file for testing.

	  The existence	of such	a file is assumed as a prerequisite in
	  these	tests.

     RELEASE
	  Release VSRT 5.1.1
	  Copyright (c)	1997 X/Open Company Ltd., A member of The Open
	  Group.
	  All rights reserved











































     Page 5					    (printed 2/21/103)



