segbrk 825 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. .TH SEGBRK 2
  2. .SH NAME
  3. segbrk \- change memory allocation
  4. .SH SYNOPSIS
  5. .B #include <u.h>
  6. .br
  7. .B #include <libc.h>
  8. .PP
  9. .ta \w'\fLvoid* 'u
  10. .B
  11. int segbrk(void *saddr, void *addr)
  12. .PP
  13. .SH DESCRIPTION
  14. .I Segbrk
  15. sets the system's idea of the lowest unused location of a segment
  16. to
  17. .I addr
  18. rounded up to the next multiple of a page size, typically 4096 bytes.
  19. The segment is identified by
  20. .I saddr
  21. which may be any valid address within the segment.
  22. .PP
  23. A call to
  24. .I segbrk
  25. with a zero
  26. .I addr
  27. argument returns the address
  28. of the top of bss.
  29. .PP
  30. The system will prevent segments from overlapping and will not allow the
  31. length of the
  32. text, data, or stack segment to be altered.
  33. .SH SOURCE
  34. .B /sys/src/libc/9syscall
  35. .SH SEE ALSO
  36. .IR brk (2),
  37. .IR segattach (2),
  38. .IR segflush (2)
  39. .br
  40. .BR /proc/*/segment
  41. .SH DIAGNOSTICS
  42. Sets
  43. .IR errstr .