


     writev_L(LSB.os/ioprRelease 1I1 (UniSoft Lwritev_L(LSB.os/ioprim)



     NAME
	  LSB.os/ioprim/writev_L - write on a file test	case

     DESCRIPTION
	  This test case tests the writev() system call	interface for
	  conformance to parts of The Open Group's CAE Specification:
	  System Interfaces and	Headers, page:writev()

     TESTS
	  1    A successful call to write(fildes, iov, iovcnt) gathers
	       data from the buffers specified in the array of iovec
	       structures referenced by	iov[0] through
	       iov[iovcnt - 1],	writes the data	to the open file
	       associated with fildes and returns the number of	bytes
	       written.
	       In each of these	iovec structures, the iov_base member
	       points to the start of the buffer from which data is to
	       be gathered, and	the iov_len member specifies the
	       number of bytes to gather.
	       When fildes refers to a regular file and	a call to
	       write(fildes, iov, iovcnt) has returned successfully,
	       then a successful read()	from any byte position that
	       was modified by the previous writev() call returns the
	       data written to that position by	that writev() call
	       until such byte positions are again modified.

	  2    When the	values of all the iov_len members are zero,
	       then a call to write(fildes, iov, iovcnt), returns
	       zero, the file pointer associated with fildes is	not
	       moved and and the st_atime, st_ctime and	st_mtime
	       fields are not updated.	This happens whether the file
	       referenced by fildes is created using creat() or	open()
	       with O_APPEND set.

	  3    When the	file type associated with fildes is capable of
	       seeking,	then write(fildes, iov,	iovcnt)	starts writing
	       from the	current	file offset associated with fildes.

	  4    On return from the write(fildes,	iov, iovcnt) system
	       call the	file pointer associated	with fildes is
	       incremented by the number of bytes actually written.

	  5    After a successful call to write(fildes,	iov, iovcnt)
	       when the	file offset is greater than the	length of the
	       file, the length	of the file is updated to the value of
	       the file	offset.

	  6    On files	which do not support seeking, the write
	       operation shall start from the current file position.

	  7    When the	file status flag O_APPEND is set, then the
	       file pointer will be set	to the end of the file prior



     Page 1					    (printed 2/21/103)






     writev_L(LSB.os/ioprRelease 2I2 (UniSoft Lwritev_L(LSB.os/ioprim)



	       to each write.
	       Testing Requirement(s): Test for	files opened in
	       O_WRONLY	and O_RDWR modes.

	  8    For file	types other than pipe or FIFO, when a write
	       operation is interrupted	by a signal, the number	of
	       bytes successfully written so far is returned,
				      otherwise
	       -1 is returned and errno	is set to EINTR.

	  9    When the	file's type is a pipe or a FIFO, the
	       O_NONBLOCK flag is set, the sum of the iov_len members
	       is greater than {PIPE_BUF} and no data can be written
	       to the file, then a call	to write(fildes, iov, iovcnt)
	       returns a value of -1, sets errno to EAGAIN and
	       transfers no data.

	  10   When the	write operation	is carried out on a pipe or
	       FIFO, then the data is always appended to the end of
	       it.

	  11   When fildes refers to a pipe or FIFO, the O_NONBLOCK
	       flag is set and the sum of the iov_len members is less
	       than or equal to	{PIPE_BUF}, then a call	to
	       write(fildes, iov, iovcnt) writes the requested number
	       of bytes	to the file and	return the number of bytes
	       written.

	  12   When fildes refers to a pipe or FIFO, the O_NONBLOCK
	       flag is clear and the sum of the	iov_len	members	is
	       less than or equal to {PIPE_BUF}, then a	call to
	       write(fildes, iov, iovcnt) blocks until space is
	       available to complete the write operation.

	  13   When fildes refers to a pipe or FIFO, the O_NONBLOCK
	       flag is set, the	sum of the iov_len members is greater
	       than {PIPE_BUF} and at least one	byte can be written,
	       then a call to write(fildes, iov, iovcnt) transfers
	       what it can and returns the number of bytes written.

	       In XPG3 mode, writev() may also return -1, set errno to
	       EAGAIN and transfer no data.

	  14   When fildes refers to an	empty pipe or FIFO, the
	       O_NONBLOCK flag is set and the sum of the iov_len
	       members is greater than {PIPE_BUF} bytes, then a	call
	       to write(fildes,	iov, iovcnt) transfers at least
	       {PIPE_BUF} bytes.

	  15   When a call to writev() writes data to a	file, then the
	       time fields st_ctime and	st_mtime are marked for
	       update.



     Page 2					    (printed 2/21/103)






     writev_L(LSB.os/ioprRelease 3I3 (UniSoft Lwritev_L(LSB.os/ioprim)



	  16   If there	is not enough space in the output device, then
	       only as many bytes as there are room for	will be
	       written.

	  17   When a regular file already contains data at the
	       position	referenced by a	successful call	to writev(),
	       then the	data at	the position referenced	are
	       overwritten.

	  18   When fildes refers to a pipe or FIFO, the O_NONBLOCK
	       flag is set, the	sum of the iov_len members is less
	       than or equal to	{PIPE_BUF} and there is	insufficient
	       space in	the pipe or FIFO, then a call to
	       write(fildes, iov, iovcnt) returns -1 with errno	set to
	       EAGAIN.

	  19   When fildes does	not refer to an	open file, then	a call
	       to write(fildes,	iov, iovcnt) returns -1	with errno set
	       to EBADF.

	  20   When fildes refers to a file that is not	open for
	       writing,	then a call to write(fildes, iov, iovcnt)
	       returns -1 with errno set to EBADF.

	  21   When a signal is	caught by writev() before any data has
	       been transferred, then the call returns -1 with errno
	       set to EINTR.

	  22   If _POSIX_JOB_CONTROL is	supported:
		   When	the calling process is in a background process
		   group which is orphaned, the	process	is neither
		   blocking nor	ignoring the SIGTTOU signal and	fildes
		   refers to the controlling terminal, then a call to
		   write(fildes, iov, iovcnt) returns -1 with errno
		   set to EIO.

	  23   When fildes refers to a pipe which is not open for
	       reading by any process, then a call to
	       write(fildes, iov, iovcnt) sends	a SIGPIPE to the
	       calling process and returns -1 with errno set to	EPIPE.

	  24   When fildes refers to a file whose size exceeds the
	       system's	maximum	file size limit, then a	call to
	       write(fildes, iov, iovcnt) returns -1 with errno	set to
	       EFBIG.

	  25   When fildes refers to a file which resides on a device
	       which has no free space left, then a call to
	       write(fildes, iov, iovcnt) returns -1 with errno	set to
	       ENOSPC.

	  26   When writing the	requested number of bytes would	cause



     Page 3					    (printed 2/21/103)






     writev_L(LSB.os/ioprRelease 4I4 (UniSoft Lwritev_L(LSB.os/ioprim)



	       the file	size limit to be exceeded, then	writev()
	       writes only as many bytes as there are room for.

	  27   When iovcnt is less than	or equal to 0, then a call to
	       write(fildes, iov, iovcnt) returns -1 with errno	set to
	       EINVAL.

	  28   When iovcnt is greater than {IOV_MAX}, then a call to
	       write(fildes, iov, iovcnt) returns -1 with errno	set to
	       EINVAL.

	  29   When one	of the iov_len values is negative, then	a call
	       to write(fildes,	iov, iovcnt) returns -1	with errno set
	       to EINVAL.

	  30   When the	sum of the iov_len values overflows a ssize_t,
	       then a call to write(fildes, iov, iovcnt) returns -1
	       and sets	errno to EINVAL.

     RELEASE
	  LSB-os %I% (%E%)


































     Page 4					    (printed 2/21/103)



