physmem: Port better to Linux.
commit19198053107308e19de1a627fb8bb8667640d6e7
authorBruno Haible <bruno@clisp.org>
Wed, 24 Apr 2024 18:24:37 +0000 (24 20:24 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 24 Apr 2024 18:24:37 +0000 (24 20:24 +0200)
treea8a41dfa692145459272fac6ebac8f8d4104ac49
parentee85acd70c1998851f7aa3a8fc8c533939b0df8b
physmem: Port better to Linux.

* lib/physmem.h (physmem_total, physmem_available): Add documentation.
(physmem_claimable): New declaration.
* lib/physmem.c: Include <fcntl.h>, <stdio.h>, full-read.h.
(get_meminfo): New function.
(physmem_claimable): Renamed from physmem_available. Add logic for
aggressivity > 0.
(physmem_available): New function.
* modules/physmem (Depends-on): Add full-read.
ChangeLog
lib/physmem.c
lib/physmem.h
modules/physmem