diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-09-21 14:40:24 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-09-21 14:40:24 +0000 |
commit | 04e9ee5f15adf50cc7679ee55078a4720c3b9acb (patch) | |
tree | fe8ac3c42202cc4c4b854b76435e0213f2a55155 /winsup/cygserver/sysv_shm.cc | |
parent | 0ae97cf7dd73fdd33d5efed0e5cff7bd63f70fe7 (diff) | |
download | newlib-04e9ee5f15adf50cc7679ee55078a4720c3b9acb.zip newlib-04e9ee5f15adf50cc7679ee55078a4720c3b9acb.tar.gz newlib-04e9ee5f15adf50cc7679ee55078a4720c3b9acb.tar.bz2 |
* sysv_shm.cc (vm_object_reference): remove Cygwin specific define.
(vm_map_find): Ditto.
(vm_map_inherit): Ditto.
(kern_shmat): On Cygwin, take shmaddr just as is. Don't call vm
system calls on Cygwin. Add comment.
Diffstat (limited to 'winsup/cygserver/sysv_shm.cc')
-rw-r--r-- | winsup/cygserver/sysv_shm.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/winsup/cygserver/sysv_shm.cc b/winsup/cygserver/sysv_shm.cc index 5daeb5c..02ad700 100644 --- a/winsup/cygserver/sysv_shm.cc +++ b/winsup/cygserver/sysv_shm.cc @@ -80,10 +80,7 @@ __FBSDID("$FreeBSD: /repoman/r/ncvs/src/sys/kern/sysv_shm.c,v 1.89 2003/11/07 04 #define vm_object_clear_flag(a,b) #define vm_object_set_flag(a,b) #define VM_OBJECT_UNLOCK(a) -#define vm_object_reference(a) #define vm_map_remove(a,b,c) KERN_SUCCESS -#define vm_map_find(a,b,c,d,e,f,g,h,i) KERN_SUCCESS -#define vm_map_inherit(a,b,c,d) typedef int vm_prot_t; #endif /* __CYGWIN__ */ @@ -383,6 +380,13 @@ kern_shmat(struct thread *td, int shmid, const void *shmaddr, int shmflg) prot |= VM_PROT_WRITE; flags = MAP_ANON | MAP_SHARED; debug_printf ("shmaddr: %x, shmflg: %x", shmaddr, shmflg); +#ifdef __CYGWIN__ + /* The alignment checks have already been made in the Cygwin DLL + and shmat's only job is to keep record of the attached mem. + These checks break shm on 9x since MapViewOfFileEx apparently + returns memory which isn't aligned to SHMLBA. Go figure! */ + attach_va = (vm_offset_t)shmaddr; +#else if (shmaddr) { flags |= MAP_FIXED; if (shmflg & SHM_RND) { @@ -390,7 +394,6 @@ kern_shmat(struct thread *td, int shmid, const void *shmaddr, int shmflg) } else if (((vm_offset_t)shmaddr & (SHMLBA-1)) == 0) { attach_va = (vm_offset_t)shmaddr; } else { - debug_printf ("Odd shmaddr: EINVAL"); error = EINVAL; goto done2; } @@ -399,12 +402,8 @@ kern_shmat(struct thread *td, int shmid, const void *shmaddr, int shmflg) * This is just a hint to vm_map_find() about where to * put it. */ -#ifdef __CYGWIN__ - attach_va = 0; -#else attach_va = round_page((vm_offset_t)p->p_vmspace->vm_taddr + maxtsiz + maxdsiz); -#endif } shm_handle = shmseg->shm_internal; @@ -417,6 +416,7 @@ kern_shmat(struct thread *td, int shmid, const void *shmaddr, int shmflg) } vm_map_inherit(&p->p_vmspace->vm_map, attach_va, attach_va + size, VM_INHERIT_SHARE); +#endif shmmap_s->va = attach_va; shmmap_s->shmid = shmid; |