mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-17 08:00:32 +00:00
Linux: Add cachestat, fchmodat2 syscalls (#958)
This commit is contained in:
parent
69faf1b403
commit
cc5c5319bf
8 changed files with 287 additions and 1 deletions
34
libc/calls/cachestat.h
Normal file
34
libc/calls/cachestat.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_CALLS_CACHESTAT_H_
|
||||
#define COSMOPOLITAN_LIBC_CALLS_CACHESTAT_H_
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct cachestat_range {
|
||||
uint64_t off;
|
||||
uint64_t len;
|
||||
};
|
||||
|
||||
struct cachestat {
|
||||
/** Number of cached pages. */
|
||||
uint64_t nr_cache;
|
||||
/** Number of dirty pages */
|
||||
uint64_t nr_dirty;
|
||||
/** Number of pages marked for writeback. */
|
||||
uint64_t nr_writeback;
|
||||
/** Number of pages evicted from the cache. */
|
||||
uint64_t nr_evicted;
|
||||
/**
|
||||
* Number of recently evicted pages.
|
||||
* A page is recently evicted if its last eviction was recent enough that its
|
||||
* reentry to the cache would indicate that it is actively being used by the
|
||||
* system, and that there is memory pressure on the system.
|
||||
*/
|
||||
uint64_t nr_recently_evicted;
|
||||
};
|
||||
|
||||
int cachestat(int, struct cachestat_range *, struct cachestat *, uint32_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_CALLS_LANDLOCK_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue