


     shmctl(XPG4.os/ipcRelease 4.4.1 (The Open Groushmctl(XPG4.os/ipc)



     NAME
	  XPG4.os/ipc/shmctl - shared memory control operations.

     DESCRIPTION
	  Shmctl tests the shmctl() subroutine call interface for
	  conformance to the XSI System	Interfaces Page:shmctl()

     TESTS
     Compliance
	  1    When the	effective user ID of the caller	matches	the
	       user ID of the owner of the shared memory segment
	       associated with shmid and read permission is allowed
	       for the owner, then a call to
	       shmctl(shmid,IPC_STAT,buf) returns the status of	the
	       shared memory segment in	the buffer buf and returns
	       zero.

	  2    When the	effective user ID of the caller	matches	the
	       user ID of the creator of the shared memory segment
	       associated with shmid and read permission is allowed
	       for the owner, then a call to
	       shmctl(shmid,IPC_STAT,buf) returns the status of	the
	       shared memory segment in	the buffer buf and returns
	       zero.

	  3    When the	effective user ID does not match the owner or
	       creator of the shared memory segment and	the effective
	       group ID	or one of the supplementary group IDs of the
	       caller matches the group	ID of the owner	of the shared
	       memory segment associated with shmid and	read
	       permission is allowed for the group, then a call	to
	       shmctl(shmid,IPC_STAT,buf) returns the status of	the
	       shared memory segment in	the buffer buf and returns
	       zero.

	  4    When the	effective user ID does not match the owner or
	       creator of the shared memory segment and	the effective
	       group ID	or one of the supplementary group IDs of the
	       caller matches the group	ID of the creator of the
	       shared memory segment associated	with shmid and read
	       permission is allowed for the group, then a call	to
	       shmctl(shmid,IPC_STAT,buf) returns the status of	the
	       shared memory segment in	the buffer buf and returns
	       zero.

	  5    When the	effective user ID does not match the owner or
	       creator of the shared memory segment and	neither	the
	       effective group ID nor any of the supplementary group
	       IDs of the caller match the group ID of the owner or
	       creator of the shared memory segment associated with
	       shmid and read permission is allowed for	others,	then a
	       call to shmctl(shmid,IPC_STAT,buf) returns the status



     Page 1					    (printed 2/21/103)






     shmctl(XPG4.os/ipcRelease 4.4.1 (The Open Groushmctl(XPG4.os/ipc)



	       of the shared memory segment in the buffer buf and
	       returns zero.

	  6    When the	calling	process	has appropriate	privileges,
	       then a call to shmctl(shmid,IPC_STAT,buf) returns the
	       status of the shared memory segment in the buffer buf
	       and returns zero.

	  7    When the	effective user ID of the caller	matches	the
	       user ID of the owner of the shared memory segment
	       associated with shmid, then a call to
	       shmctl(shmid,IPC_SET,buf) sets the user ID, group ID,
	       and mode	of the shared memory segment referenced	by
	       shmid to	the corresponding values from the buffer buf
	       and returns zero.

	  8    When the	effective user ID of the caller	matches	the
	       user ID of the creator of the shared memory segment
	       associated with shmid, then a call to
	       shmctl(shmid,IPC_SET,buf) sets the user ID, group ID,
	       and mode	of the shared memory segment referenced	by
	       shmid to	the corresponding values from the buffer buf
	       and returns zero.

	  9    When the	calling	process	has appropriate	privileges,
	       then a call to shmctl(shmid,IPC_SET,buf)	sets the user
	       ID, group ID, and mode of the shared memory segment
	       referenced by shmid to the corresponding	values from
	       the buffer buf and returns zero.

	  10   When the	effective user ID of the caller	matches	the
	       user ID of the owner of the shared memory segment, then
	       a call to shmctl(shmid,IPC_RMID,buf) removes the	shared
	       memory identifier specified by shmid.

	  11   When the	effective user ID of the caller	matches	the
	       user ID of the creator of the shared memory segment,
	       then a call to shmctl(shmid,IPC_RMID,buf) removes the
	       shared memory identifier	specified by shmid.

	  12   When the	calling	process	has appropriate	privileges,
	       then a call to shmctl(shmid,IPC_RMID,buf) removes the
	       shared memory identifier	specified by shmid.

     Deviance
	  13   EACCES in errno and return -1 on	a call to
	       shmctl(shmid,IPC_STAT,buf) when the calling process
	       does not	have read permission.

	  14   EINVAL in errno and return -1 on	a call to
	       shmctl(shmid,IPC_STAT,buf) when the value of shmid is
	       set to an invalid value.



     Page 2					    (printed 2/21/103)






     shmctl(XPG4.os/ipcRelease 4.4.1 (The Open Groushmctl(XPG4.os/ipc)



	  15   EPERM in	errno and return -1 on a call to
	       shmctl(shmid,IPC_SET,buf) when the calling process does
	       not have	appropriate privileges and the effective user
	       ID does not match the user ID of	the owner or the
	       creator of the shared memory segment associated with
	       shmid.

	  16   EPERM in	'errno'	and return -1 on a call	to
	       shmctl(shmid,IPC_RMID,buf) when the calling process
	       does not	have appropriate privileges and	the effective
	       user ID does not	match the user ID of the owner or the
	       creator of the shared memory segment associated with
	       shmid.

	  17   If _XOPEN_SHM is	-1:
		   A call to shmctl() returns -1 and sets errno	to
		   ENOSYS.

     RELEASE
	  4.4.1	(06/09/97)
	  Copyright 1997, The Open Group
	  All Rights Reserved

































     Page 3					    (printed 2/21/103)



