Subject: Re: CVS commit: src/sys/compat/linux/common
To: None <njoly@netbsd.org>
From: Mindaugas R. <rmind@NetBSD.org>
List: source-changes
Date: 01/28/2008 19:11:45
> Module Name:	src
> Committed By:	njoly
> Date:		Mon Jan 28 14:05:32 UTC 2008
> 
> Modified Files:
> 	src/sys/compat/linux/common: linux_ipc.c
> 
> Log Message:
> shmctl fixes.
> 
> - SHM_STAT take an index as input, and return the corresponding shmid.
> - IPC_INFO and SHM_INFO returns the highest used index.
> - SHM_INFO expected the total used pages (not bytes) in shm_tot field
>   of struct shm_info.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -r1.42 -r1.43 src/sys/compat/linux/common/linux_ipc.c

Actually, this code is not MP-safe, that is, usage of shmsegs without
shm_lock held. Additionally, it does not take into account the case of
reallocation. Usage of shmsegs/shm_lock in compat code do not look good,
perhaps some cases might be moved to the native module? I am not sure..

> Modified Files:
> 	src/sys/compat/linux/common: linux_shm.h
> 
> Log Message:
> Update struct linux_shmid64_ds for 64bits archs.
> - shm_segsz should be of type size_t, not int.

Why l_shm_segsz in struct linux_shmid_ds is not size_t too?

-- 
Best regards,
Mindaugas
www.NetBSD.org