support madvise(MADV_REMOVE) partially
This MADV_REMOVE works with a mapping which is - created with shmat() and - not sharing memobj with other mappings.
This commit is contained in:
@@ -31,6 +31,7 @@ enum {
|
||||
/* for memobj.flags */
|
||||
MF_HAS_PAGER = 0x0001,
|
||||
MF_SHMDT_OK = 0x0002,
|
||||
MF_IS_REMOVABLE = 0x0004,
|
||||
};
|
||||
|
||||
struct memobj {
|
||||
@@ -120,6 +121,11 @@ static inline int memobj_has_pager(struct memobj *obj)
|
||||
return !!(obj->flags & MF_HAS_PAGER);
|
||||
}
|
||||
|
||||
static inline int memobj_is_removable(struct memobj *obj)
|
||||
{
|
||||
return !!(obj->flags & MF_IS_REMOVABLE);
|
||||
}
|
||||
|
||||
int fileobj_create(int fd, struct memobj **objp, int *maxprotp);
|
||||
struct shmid_ds;
|
||||
int shmobj_create(struct shmid_ds *ds, struct memobj **objp);
|
||||
|
||||
Reference in New Issue
Block a user