shithub: riscv

Download patch

ref: 7be7d0681f567e97fd37f937c2e5e486d6d74eab
parent: afe450d3810ed0f66cff46fe0fe0e70520d2c14b
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Dec 16 16:06:51 EST 2015

kernel: use uintptr for ibrk() return value (for base >2GB) and clarify segbrk(2)

--- a/sys/man/2/segbrk
+++ b/sys/man/2/segbrk
@@ -24,8 +24,8 @@
 .I segbrk
 with a zero
 .I addr
-argument returns the address
-of the top of bss.
+argument returns the base address of the segment without
+altering its size.
 .PP
 The system will prevent segments from overlapping and will not allow the
 length of the
@@ -46,13 +46,6 @@
 .B (void*)-1
 on error.
 .SH BUGS
-.I Segbrk
-is not fully defined or implemented.
-In particular,
-it cannot always return the top of bss
-when called with a zero
-.I addr
-argument.
 The
 .I segbrk
 system call may go away or be re-implemented
--- a/sys/src/9/port/segment.c
+++ b/sys/src/9/port/segment.c
@@ -376,7 +376,7 @@
 		ccloseq(c);	/* does not block */
 }
 
-long
+uintptr
 ibrk(uintptr addr, int seg)
 {
 	Segment *s, *ns;