| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/physmem.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | - | |||||||||||||
| 7 | - | |||||||||||||
| 8 | - | |||||||||||||
| 9 | double | - | ||||||||||||
| 10 | physmem_total (void) | - | ||||||||||||
| 11 | { | - | ||||||||||||
| 12 | - | |||||||||||||
| 13 | { | - | ||||||||||||
| 14 | double pages = sysconf ( | - | ||||||||||||
| 15 | _SC_PHYS_PAGES | - | ||||||||||||
| 16 | ); | - | ||||||||||||
| 17 | double pagesize = sysconf ( | - | ||||||||||||
| 18 | _SC_PAGESIZE | - | ||||||||||||
| 19 | ); | - | ||||||||||||
| 20 | if (0 <= pages
| 0-685 | ||||||||||||
| 21 | return executed 685 times by 1 test: pages * pagesize;return pages * pagesize;Executed by:
executed 685 times by 1 test: return pages * pagesize;Executed by:
| 685 | ||||||||||||
| 22 | } | - | ||||||||||||
| 23 | - | |||||||||||||
| 24 | - | |||||||||||||
| 25 | - | |||||||||||||
| 26 | { | - | ||||||||||||
| 27 | struct sysinfo si; | - | ||||||||||||
| 28 | if (sysinfo(&si) == 0
| 0 | ||||||||||||
| 29 | return never executed: (double) si.totalram * si.mem_unit;return (double) si.totalram * si.mem_unit;never executed: return (double) si.totalram * si.mem_unit; | 0 | ||||||||||||
| 30 | } | - | ||||||||||||
| 31 | return never executed: 64 * 1024 * 1024;return 64 * 1024 * 1024;never executed: return 64 * 1024 * 1024; | 0 | ||||||||||||
| 32 | } | - | ||||||||||||
| 33 | - | |||||||||||||
| 34 | - | |||||||||||||
| 35 | double | - | ||||||||||||
| 36 | physmem_available (void) | - | ||||||||||||
| 37 | { | - | ||||||||||||
| 38 | - | |||||||||||||
| 39 | { | - | ||||||||||||
| 40 | double pages = sysconf ( | - | ||||||||||||
| 41 | _SC_AVPHYS_PAGES | - | ||||||||||||
| 42 | ); | - | ||||||||||||
| 43 | double pagesize = sysconf ( | - | ||||||||||||
| 44 | _SC_PAGESIZE | - | ||||||||||||
| 45 | ); | - | ||||||||||||
| 46 | if (0 <= pages
| 0-696 | ||||||||||||
| 47 | return executed 696 times by 2 tests: pages * pagesize;return pages * pagesize;Executed by:
executed 696 times by 2 tests: return pages * pagesize;Executed by:
| 696 | ||||||||||||
| 48 | } | - | ||||||||||||
| 49 | - | |||||||||||||
| 50 | - | |||||||||||||
| 51 | - | |||||||||||||
| 52 | { | - | ||||||||||||
| 53 | struct sysinfo si; | - | ||||||||||||
| 54 | if (sysinfo(&si) == 0
| 0 | ||||||||||||
| 55 | return never executed: ((double) si.freeram + si.bufferram) * si.mem_unit;return ((double) si.freeram + si.bufferram) * si.mem_unit;never executed: return ((double) si.freeram + si.bufferram) * si.mem_unit; | 0 | ||||||||||||
| 56 | } | - | ||||||||||||
| 57 | return never executed: physmem_total () / 4;return physmem_total () / 4;never executed: return physmem_total () / 4; | 0 | ||||||||||||
| 58 | } | - | ||||||||||||
| Switch to Source code | Preprocessed file |