|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1928 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 1928.
Report 1928 Actions
Problem Report Number 1928 Submitter's Classification Test Suite problem State Resolved Resolution Rejected (REJ) Problem Resolution ID REJ.X.0564 Raised 2000-10-23 08:00 Updated 2003-03-13 08:00 Published null Product Standard Internationalised System Calls and Libraries Extended V2 (UNIX 98) Certification Program The Open Brand certification program Test Suite VSX4 version 4.4.5 Test Identification POSIX.os/files/fstat 1 Problem Summary PG5R.007 In this case test is expecting that when we write to one end of pipe (fd[1]) time stamps on the other end (fd[0]) be updated. According to the CAE specification Issue 5: volume 1 page 34, "However, si... Problem Text
In this case test is expecting that when we write to one end
of pipe (fd[1]) time stamps on the other end (fd[0]) be
updated.
According to the CAE specification Issue 5: volume 1 page 34,
"However, since pipes may be STREAMS-based, a STREAM can be a
full-duplex connection between two processes"
When pipes are full-duplex you cannot have a single shared stat
structure because that design would imply a single buffer exists
for the pipe.
So, when specification states that streams based pipes are
full-duplex, it is not correct for the tests to expect what
amounts to half-duplex behavior in both design and implementation.
Also, we think that the behaviour expected by VSX4 tests is not
specified in the specification and request for a waiver.Test Output
************************************************************************
/tset/POSIX.os/files/fstat/T.fstat 1 Failed
Test Description:
A call to fstat() stores information about the file associated with
the named file descriptor in the area pointed to by buf and returns
a value of zero.
Posix Ref: Component FSTAT Assertion 5.6.2.2-04(A)
Posix Ref: Component FSTAT Assertion 5.6.2.2-05(A)
Posix Ref: Component FSTAT Assertion 5.6.2.2-06(A)
Posix Ref: Component FSTAT Assertion 5.6.2.2-07(A)
Posix Ref: Component FSTAT Assertion 5.6.2.2-08(A)
Posix Ref: Component FSTAT Assertion 5.6.2.2-09(A)
Posix Ref: Component FSTAT Assertion 5.6.2.2-10(A)
Posix Ref: Component FSTAT Assertion 5.6.2.2-11(A)
Posix Ref: Component FSTAT Assertion 5.6.2.2-12(A)
Posix Ref: Component FSTAT Assertion 5.6.2.2-13(A)
Test Strategy:
CHECK st_dev, st_ino, S_ISREG(st_mode), st_size, st_atime, st_mtime
and st_ctime for a regular file as follows:
CREATE file using crfile() - (genlib)
OBTAIN time using time()
SLEEP for 2 seconds using sleep()
WRITE data to file using write()
CLOSE file descriptor using close()
OBTAIN time using time()
SLEEP for 1 second using sleep()
OBTAIN file status information for "." and ".." using stat()
OPEN file using open() with a time out
OBTAIN file status information for test file using fstat()
VERIFY that fstat() returned 0
VERIFY that st_dev is the same as for "." and ".."
VERIFY that st_ino is different from "." and ".."
VERIFY that file is a regular file using S_ISREG()
VERIFY that st_size is the same as the number of bytes written to
the file
VERIFY that st_atime is set to the value when time() was first
called
VERIFY that st_mtime and st_ctime are set to the value when time()
was subsequently called
UNLINK file
CHECK st_mode permission bits as follows:
CREATE file using crfile() - (genlib)
FOR each portable file nane with each of the file modes and it's
complement:
CHANGE the mode of the current portable filename using chmod()
with the current file mode
OBTAIN file status information using fstat()
VERIFY that fstat() returned 0 and errno was not set
VERIFY that st_mode is the same as the current mode
UNLINK file
CHECK st_uid and st_gid as follows:
CREATE child process using cppair()
CREATE subprogram using execve passing as parameters: the
Program name, the file name, the group and user ids for vsxg1 and vsx1
CREATE file using creat() with read, write and execute
permissions for user, group and others owned by user vsx1 and
group vsxg1
OBTAIN file status information using fstat()
VERIFY that fstat() returned 0 and errno was not set
VERIFY that st_uid and st_gid are set to vsx1 and vsxg1
CHECK st_nlink as follows:
CREATE file using crfile() - (genlib)
OBTAIN file status information using fstat()
VERIFY that fstat() returned 0 and errno was not set
VERIFY that the number of links to the file is one
LINK to file using link()
OBTAIN file status information using fstat()
VERIFY that fstat() returned 0 and errno was not set
VERIFY that the number of links to the file is two
CLOSE file descriptor using close()
UNLINK file
CHECK that S_ISDIR(st_mode) refers to a directory as follows:
CREATE directory using crdir()
OBTAIN file status information using fstat()
VERIFY that fstat() returned 0 and errno was not set
VERIFY that file is a directory using S_ISDIR()
WHEN not testing the XNFS specification:
CHECK that S_ISFIFO(st_mode) refers to a FIFO as follows:
CREATE FIFO using mkfifo()
OBTAIN file status information using fstat()
VERIFY that fstat() returned 0 and errno was not set
VERIFY that file is a directory using S_ISFIFO()
WHEN not testing the XNFS specification:
CHECK st_size, st_atime, st_mtime and st_ctime as follows:
CREATE pipe using pipe()
CALL fstat() to force timestamp update
OBTAIN time using time()
SLEEP for 2 seconds using sleep()
WRITE data to file using write()
CALL fstat() to force timestamp update
OBTAIN time using time()
SLEEP for 1 second using sleep()
OBTAIN file status information using fstat()
VERIFY that fstat() returned 0 and errno was not set
VERIFY that st_atime is set to the value when time() was first
called
VERIFY that st_mtime is set to the value when time() was
subsequently called
VERIFY that st_ctime is set to the value when time() was
subsequently called
CLOSE both file descriptors using close()
Test Information:
fstat() on pipe set st_mtime incorrectly: expected 971125622,
observed 971125620
fstat() on pipe set st_ctime incorrectly: expected 971125622,
observed 971125620
************************************************************************Review Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
The behaviour expected by the test is definitely required by the
specification. It derives from the definition of "pipe" in XBD5:
"An object accessed by one of the pair of file descriptors created
by the pipe() function. Once created, the file descriptors can be
used to manipulate it, and it behaves identically to a FIFO special
file when accessed in this way."
together with the definition of "file times update" in XBD5:
"Each file has three associated time values that are updated when
file data has been accessed, file data has been modified, or file
status has been changed, respectively. These values are returned in
the file characteristics structure, as described in <sys/stat.h>."
Since FIFOs are "files", they have "three associated time values",
and these same three values are returned by calling stat() on the
file name or by calling fstat() on any fd that is open to the FIFO,
regardless of whether the fd was opened for reading or writing.
The definition of "pipe" requires that the pair of fd's returned by
pipe() behave identically to a pair of fd's open for reading and
writing, respectively, to a FIFO. Since an fstat() on the FIFO's
reading fd and an fstat() on the FIFO's writing fd return the same
timestamps (the "three associated time values"), the same must be
true for the pipe's reading fd and writing fd, as the test expects.
The quoted definition of "pipe" was in POSIX.1-1988 and has remained
unchanged in all the specifications derived from it. Implementations
with STREAMS-based pipes had to comply with this definition during
the several years before STREAMS were added to XSH, and so there was
no reason to change the specification at that time to allow a
different behaviour for STREAMS-based pipes. (Anyway, would any
vendors have wanted to be only UNIX95 compliant, and not POSIX.1
and XPG4 compliant?)
If the claim that "when pipes are full-duplex you cannot have a single
shared stat structure" is true, then perhaps the many existing
implementations that have STREAMS-based pipes and that pass this
test have some internal mechanism whereby the relevant timestamps in
both of the stat structures are marked for update when the pipe is
read or written. That is just speculation, but whatever means they
use, the point is that the problem of how to make STREAMS-based pipes
have POSIX-conforming timestamps was solved some ten or more years ago.
It is recommended that this request is refused.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Rejected (REJ) Review Conclusion
This request is refused.
Problem Reporting System Options:
- View Report 1928
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority