lkml.org 
[lkml]   [2005]   [Nov]   [10]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
/
DateWed, 9 Nov 2005 22:22:23 -0800
FromAndrew Morton <>
SubjectRe: [PATCH] Expose SHM_HUGETLB in shmctl(id, IPC_STAT, ...)
Arun Sharma <arun.sharma@google.com> wrote:
>
> Allow shmctl to find out if a shmid corresponds to a HUGETLB segment
> 
>  Signed-off-by: Arun Sharma <arun.sharma@google.com>
>  Acked-by: Rohit Seth <rohit.seth@intel.com>
> 
>  --- a/ipc/shm.c	Tue Nov  8 20:58:38 2005
>  +++ b/ipc/shm.c	Wed Nov  9 10:26:37 2005
>  @@ -197,7 +197,7 @@
>   		return -ENOMEM;
> 
>   	shp->shm_perm.key = key;
>  -	shp->shm_flags = (shmflg & S_IRWXUGO);
>  +	shp->shm_flags = (shmflg & (S_IRWXUGO | SHM_HUGETLB));
>   	shp->mlock_user = NULL;
> 
>   	shp->shm_perm.security = NULL;

I dunno.  The manpage says:

       The highlighted fields in the member shm_perm can be set:

           struct ipc_perm {
       ...
               ushort mode;  /* lower 9 bits of access modes */
       ...
           };
So if an application used to do:

	if (perm.mode == 0666)
it will now break, because we've gone and set bit 9 on hugetlb segments.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-10 11:04    [W:1.675 / U:0.070 seconds]
©2003-2008 Jasper Spaans