Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1307 → Rev 1306

/uspace/trunk/libc/generic/as.c
51,24 → 51,13
* @param size New requested size of the area.
* @param flags Currently unused.
*
* @return Zero on success or a code from @ref errno.h on failure.
* @return address on success, (void *) -1 otherwise.
*/
int as_area_resize(void *address, size_t size, int flags)
void *as_area_resize(void *address, size_t size, int flags)
{
return __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, (sysarg_t) size, (sysarg_t) flags);
return (void *) __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t ) address, (sysarg_t) size, (sysarg_t) flags);
}
 
/** Destroy address space area.
*
* @param address Virtual address pointing into the address space area being destroyed.
*
* @return Zero on success or a code from @ref errno.h on failure.
*/
int as_area_destroy(void *address)
{
return __SYSCALL1(SYS_AS_AREA_DESTROY, (sysarg_t ) address);
}
 
/** Prepare to accept address space area.
*
* @param id Task ID of the donor task.
121,7 → 110,6
*/
void *sbrk(ssize_t incr)
{
int rc;
void *res;
/* Check for invalid values */
if (incr < 0 && -incr > heapsize)
133,8 → 121,8
if (incr < 0 && incr+heapsize > heapsize)
return NULL;
 
rc = as_area_resize(&_heap, heapsize + incr,0);
if (rc != 0)
res = as_area_resize(&_heap, heapsize + incr,0);
if (!res)
return NULL;
/* Compute start of new area */