sbrk
{{Expansion depth limit exceeded| left =
| #default = }}
{{Expansion depth limit exceeded| {{{Expansion depth limit exceeded}}}
| [[File:{{Expansion depth limit exceeded| speedy = Ambox speedy deletion.png
| delete = Ambox deletion.png
| content = Ambox content.png
| style = Edit-clear.svg
| move = Ambox move.png
| protection = Ambox protection.png
| notice
| #default = Ambox notice.png
}} | {{Expansion depth limit exceeded| left = 20x20px
| #default = 40x40px
}} |link=|alt=]]
}}{{Expansion depth limit exceeded| left =
| #default = |
{{{Expansion depth limit exceeded}}} |
Expression error: Unrecognized punctuation character "{".
{{Expansion depth limit exceeded| left =
| #default = }}
{{Expansion depth limit exceeded| {{{Expansion depth limit exceeded}}}
| [[File:{{Expansion depth limit exceeded| speedy = Ambox speedy deletion.png
| delete = Ambox deletion.png
| content = Ambox content.png
| style = Edit-clear.svg
| move = Ambox move.png
| protection = Ambox protection.png
| notice
| #default = Ambox notice.png
}} | {{Expansion depth limit exceeded| left = 20x20px
| #default = 40x40px
}} |link=|alt=]]
}}{{Expansion depth limit exceeded| left =
| #default = |
{{{Expansion depth limit exceeded}}} |
[[Category:{{Expansion depth limit exceeded|{{{Expansion depth limit exceeded}}}|{{{Expansion depth limit exceeded}}}}}]]
{{Expansion depth limit exceeded| left =
| #default = }}
{{Expansion depth limit exceeded| {{{Expansion depth limit exceeded}}}
| [[File:{{Expansion depth limit exceeded| speedy = Ambox speedy deletion.png
| delete = Ambox deletion.png
| content = Ambox content.png
| style = Edit-clear.svg
| move = Ambox move.png
| protection = Ambox protection.png
| notice
| #default = Ambox notice.png
}} | {{Expansion depth limit exceeded| left = 20x20px
| #default = 40x40px
}} |link=|alt=]]
}}{{Expansion depth limit exceeded| left =
| #default = |
{{{Expansion depth limit exceeded}}} |
Expression error: Unrecognized punctuation character "{".
{{
| type = style | image = | imageright = | style = | textstyle = | text = {{Expansion depth limit exceeded|U|T|t}}{{Expansion depth limit exceeded| =his article|Talk=he article|his page}} may be too technical for most readers to understand. Please improve {{Expansion depth limit exceeded|U|T|t}}{{Expansion depth limit exceeded| =his article|Talk=he article|his page}} to make it accessible to non-experts, without removing the technical details. (August 2009) | small = | smallimage = | smallimageright = | smalltext = }}[[Category:{{Expansion depth limit exceeded|{{{Expansion depth limit exceeded}}}|{{{Expansion depth limit exceeded}}}}}]][[Category:{{Expansion depth limit exceeded|{{{Expansion depth limit exceeded}}}|{{{Expansion depth limit exceeded}}}}}]]
The brk or sbrk subroutine changes data segment space allocation. Standard C Library (libc.a)
The brk and sbrk subroutines dynamically change the amount of space allocated for the data segment of the calling process. (For information about segments, see the exec subroutine. For information about the maximum amount of space that can be allocated, see the ulimit and getrlimit subroutines.)
The change is made by resetting the break value of the process, which determines the maximum space that can be allocated. The break value is the address of the first location beyond the current end of the data region. The amount of available space increases as the break value increases. The available space is initialized to a value of 0 at the time it is used. The break value can be automatically rounded up to a size appropriate for the memory management architecture.
The brk subroutine sets the break value to the value of the EndDataSegment parameter and changes the amount of available space accordingly.
The sbrk subroutine adds to the break value the number of bytes contained in the Increment parameter and changes the amount of available space accordingly. The Increment parameter can be a negative number, in which case the amount of available space is decreased.
- Parameters
- EndDataSegment Specifies the effective address of the maximum available data.
- Increment Specifies any integer.
- Return Values
Upon successful completion, the brk subroutine returns a value of 0, and the sbrk subroutine returns the old break value. If either subroutine is unsuccessful, a value of -1 is returned and the errno global variable is set to indicate the error.
- Error codes
The brk subroutine and the sbrk subroutine are unsuccessful and the allocated space remains unchanged if one or more of the following are true:
- ENOMEM The requested change allocates more space than is allowed by a system-imposed maximum. (For information on the system-imposed maximum on memory space, see the ulimit system call.)
- ENOMEM The requested change sets the break value to a value greater than or equal to the start address of any attached shared-memory segment. (For information on shared memory operations, see the shmat subroutine.)
Syntax
#include <unistd .h> int brk ( EndDataSegment) char *EndDataSegment; void *sbrk ( Increment) intptr_t Increment;
External links
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...