Include the history of arm64 and riscv shipping without brk/sbrk.
Mention that sbrk(0) produces unreliable results.
(Per request in D6464).
Differential D15535
Indicate the brk/sbrk are deprecated and not portable. brooks on May 23 2018, 3:55 PM. Authored by Tags None Referenced Files
Subscribers
Details
Include the history of arm64 and riscv shipping without brk/sbrk. Mention that sbrk(0) produces unreliable results. (Per request in D6464).
Diff Detail
Event Timeline
Comment Actions I have one question. From what I see in the code for brk() and sbrk() got removed from the C library, but the system call sys_obreak still exists, correct? Comment Actions Are there any architecture-specific reasons for removal? (Something that riscv and aarch64 cannot do but amd64 and i386 can)? Maybe we should also hint at mmap(2) as a replacement for larger than zero sbrk(2). Comment Actions
Just a lack of backwards compatibility requirements (i.e., there are no existing FreeBSD binaries which make use of sbrk). Comment Actions Also, sbrk() is incompatible with (or at least a very poor fit with) a number of memory protection schemes. Among other things it defeats ASLR. Comment Actions I haven't tried to call it in assembly myself, it's just my reading of D6464: Remove sbrk on arm64 and some random grepping around the code, so don't take my word. So basically we are just taking the opportunity of the new architecture not to have to provide backward compatibility for it later?
|