Problem Report Number |
1611 |
Submitter's Classification |
Specification problem |
State |
Resolved |
Resolution |
Permanent Interpretation (PIN) |
Problem Resolution ID |
PIN.X.0168 |
Raised |
1996-08-09 08:00 |
Updated |
2003-03-13 08:00 |
Published |
1996-08-20 08:00 |
Product Standard |
Internationalised System Calls and Libraries Extended (UNIX 95) |
Certification Program |
The Open Brand certification program |
Test Suite |
VSU version 4.1.0 |
Test Identification |
CAPI.os/genuts/sbrk 1 2 |
Specification |
System Interfaces and Libraries Issue 4 Version 2 |
Location in Spec |
See Problem Text |
Problem Summary |
PIN4U.00034 This test may fail on implementations that perform some type of rounding on the requested sbrk() increment. |
Problem Text |
Our implementation of sbrk() works on 8 byte boundaries. This means that more bytes can get allocated than asked for. We consider this an enhancement since it guarantees that at least the requested amount of space is added to the data segment or at most, the requested amount of space is removed from the data seqment. The tests need to be aware of this and allow for this.
As further argument, The X/Open specification states the following under DESCRIPTION:
The brk() and sbrk() functions are used to change the amount of space allocated for the calling process. The change is made by resetting the process' break value and allocating the appropriate amount of space.
In addition, under APPLICATION USAGE, the following statement is made:
It is unspecified whether the pointer returned by sbrk() is aligned suitably for any purpose.
Again, our implementation of sbrk is allocating the appropriate amount of space insuring that the the pointer returned by sbrk() is aligned suitably.
|
Test Output |
TEST CASE: sbrk
TEST PURPOSE #1 A successful call to void *sbrk(int incr) when incr is positive shall increase the break value (the address at which dynamic memory allocation starts) for the calling process by incr bytes, set the newly allocated space to 0, and return the old break value. PREP: Determine original break value TEST: sbrk(830) returns original break value TEST: Break value set ERROR: Break value set to 2f988 expected 2f986 1 FAIL
TEST PURPOSE #2 A successful call to void *sbrk(int incr) when incr is negative shall decrease the break value (the address at which dynamic memory allocation starts) for the calling process by the absolute value of incr bytes and return the old break value. PREP: Allocate a large piece of memory for negative sbrk()s TEST: sbrk(-830) returns original break value TEST: New break value set ERROR: Break value set to 3f178 expected 3f172 2 FAIL
|