Skip to content

Commit

Permalink
Add syscall 136 personality
Browse files Browse the repository at this point in the history
  • Loading branch information
krystophny committed Feb 17, 2020
1 parent 2f5ce68 commit dfb9f66
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions kernel/calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ syscall_t syscall_table[] = {
[125] = (syscall_t) sys_mprotect,
[132] = (syscall_t) sys_getpgid,
[133] = (syscall_t) sys_fchdir,
[136] = (syscall_t) sys_personality,
[140] = (syscall_t) sys__llseek,
[141] = (syscall_t) sys_getdents,
[142] = (syscall_t) sys_select,
Expand Down
1 change: 1 addition & 0 deletions kernel/calls.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ dword_t sys_getcwd(addr_t buf_addr, dword_t size);
dword_t sys_chdir(addr_t path_addr);
dword_t sys_chroot(addr_t path_addr);
dword_t sys_fchdir(fd_t f);
dword_t sys_personality(dword_t pers);
int task_set_thread_area(struct task *task, addr_t u_info);
int sys_set_thread_area(addr_t u_info);
int sys_set_tid_address(addr_t blahblahblah);
Expand Down
9 changes: 9 additions & 0 deletions kernel/getset.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,12 @@ int_t sys_capset(addr_t header_addr, addr_t data_addr) {
STRACE("capset(%#x, %#x)", header_addr, data_addr);
return 0;
}

// minimal version according to Linux sys/personality.h
dword_t sys_personality(dword_t pers) {
if (pers == 0xffffffff) // get personality, return default (Linux)
return 0x00000000;
if (pers == 0x00000000) // set personality to Linux
return 0x00000000;
return -1; // otherwise return error
}

0 comments on commit dfb9f66

Please sign in to comment.