Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/kernel_supplement.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ struct rr_input_mask {
#ifndef MADV_COLLAPSE
#define MADV_COLLAPSE 25
#endif
#ifndef MADV_GUARD_INSTALL
#define MADV_GUARD_INSTALL 102
#endif
#ifndef MADV_GUARD_REMOVE
#define MADV_GUARD_REMOVE 103
#endif

#ifndef BUS_MCEERR_AR
#define BUS_MCEERR_AR 4
Expand Down
4 changes: 4 additions & 0 deletions src/record_syscall.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5245,6 +5245,10 @@ static Switchable rec_prepare_syscall_arch(RecordTask* t,
t->set_regs(r);
break;
}
case MADV_GUARD_INSTALL:
case MADV_GUARD_REMOVE:
syscall_state.emulate_result(-EINVAL);
break;
default:
syscall_state.expect_errno = EINVAL;
break;
Expand Down
2 changes: 2 additions & 0 deletions src/test/madvise_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ int main(void) {
DO_MADVISE(MADV_POPULATE_READ);
DO_MADVISE(MADV_POPULATE_WRITE);
DO_MADVISE(MADV_COLLAPSE);
DO_MADVISE(MADV_GUARD_INSTALL);
DO_MADVISE(MADV_GUARD_REMOVE);

atomic_puts("EXIT-SUCCESS");

Expand Down
6 changes: 6 additions & 0 deletions src/test/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,12 @@ struct open_how {
#ifndef MADV_COLLAPSE
#define MADV_COLLAPSE 25
#endif
#ifndef MADV_GUARD_INSTALL
#define MADV_GUARD_INSTALL 102
#endif
#ifndef MADV_GUARD_REMOVE
#define MADV_GUARD_REMOVE 103
#endif

#ifndef F_OFD_GETLK
#define F_OFD_GETLK 36
Expand Down