3 ms·
brk() is undefined behavior if mmap is ever called.
by aidenn0 7y ago
brk() is undefined behavior if mmap is ever called.
- megous 7y agoHow so? Both syscalls are invoked pretty frequently together in the same program.
- emilfihlman 7y agoCan you post a definite source supporting this?
- luke0016 7y agoThere isn't one, because it's wrong. Source: run strace on almost any useful Linux command (e.g. ls, sort, which, ...), you'll see it makes calls to both brk() and mmap().
- toast0 7y agoThe OP admitted it was wrong, but just because everyone does it doesn't mean it's not undefined behavior.
- chrisseaton 7y agoWow that's news to me - can you point me at the documentation for that?
- aidenn0 7y agoI was wrong, it's only if you use MAP_FIXED to map an overlapping area.