Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40472
b: refs/heads/master
c: b428b51
h: refs/heads/master
v: v3
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Oct 30, 2006
1 parent 6b3c230 commit 4a034b1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bbb5bbb037812ba36d638014a93134148a568684
refs/heads/master: b428b51ed9a4ff8445ea50769961f948480c1d36
3 changes: 3 additions & 0 deletions trunk/arch/um/os-Linux/sys-i386/tls.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include <errno.h>
#include <linux/unistd.h>

#include <sys/syscall.h>
#include <unistd.h>

#include "sysdep/tls.h"
#include "user_util.h"

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/um/os-Linux/tls.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <errno.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <asm/ldt.h>
#include "sysdep/tls.h"
#include "uml-config.h"
Expand Down
11 changes: 7 additions & 4 deletions trunk/arch/um/sys-i386/unmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@

#include <linux/mman.h>
#include <asm/unistd.h>
#include <sys/syscall.h>

static int errno;

static inline _syscall2(int,munmap,void *,start,size_t,len)
static inline _syscall6(void *,mmap2,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset)
int switcheroo(int fd, int prot, void *from, void *to, int size)
{
if (syscall(__NR_munmap, to, size) < 0){
if(munmap(to, size) < 0){
return(-1);
}
if (syscall(__NR_mmap2, to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1 ){
if(mmap2(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1 ){
return(-1);
}
if (syscall(__NR_munmap, from, size) < 0){
if(munmap(from, size) < 0){
return(-1);
}
return(0);
Expand Down
11 changes: 7 additions & 4 deletions trunk/arch/um/sys-x86_64/unmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@

#include <linux/mman.h>
#include <asm/unistd.h>
#include <sys/syscall.h>

static int errno;

static inline _syscall2(int,munmap,void *,start,size_t,len)
static inline _syscall6(void *,mmap,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset)
int switcheroo(int fd, int prot, void *from, void *to, int size)
{
if (syscall(__NR_munmap, to, size) < 0){
if(munmap(to, size) < 0){
return(-1);
}
if (syscall(__NR_mmap, to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1){
if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) == (void*) -1){
return(-1);
}
if (syscall(__NR_munmap, from, size) < 0){
if(munmap(from, size) < 0){
return(-1);
}
return(0);
Expand Down

0 comments on commit 4a034b1

Please sign in to comment.