


     semget(XPG4.os/ipcRelease 4.4.1 (The Open Grousemget(XPG4.os/ipc)



     NAME
	  XPG4.os/ipc/semget - get set of semaphores.

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

     TESTS
     Compliance
	  1    When key	specifies an existing semaphore	set, then a
	       successful call to semget(key,nsems,semflag) shall
	       return the semaphore identifier associated with key.

	  2    When key	is equal to IPC_PRIVATE, then a	successful
	       call to semget(key,nsems,semflag) creates a new set of
	       nsems semaphores	with
	       a. sem_perm.cuid	and sem_perm.uid set equal to the
	       effective user ID of the	calling	process
	       b. sem_perm.cgid	and sem_perm.gid set equal to the
	       effective group ID of the calling process
	       c. the access permission	bits in	sem_perm.mode set
	       equal to	the access permissions specified in semflag
	       d. sem_nsems set	equal to nsems
	       e. sem_otime set	to 0
	       f. sem_ctime set	equal to the current time.

	  3    When key	does not already have a	semaphore associated
	       with it and semflag & IPC_CREAT is true,	then a
	       successful call to semget(key,nsems,semflag) creates a
	       new set of nsems	semaphores with
	       a. sem_perm.cuid	and sem_perm.uid set equal to the
	       effective user ID of the	calling	process
	       b. sem_perm.cgid	and sem_perm.gid set equal to the
	       effective group ID of the calling process
	       c. the access permission	bits in	sem_perm.mode set
	       equal to	the access permissions specified in semflag
	       d. sem_nsems set	equal to nsems
	       e. sem_otime set	to 0
	       f. sem_ctime set	equal to the current time.

	  4    When key	already	has a semaphore	associated with	it and
	       the IPC_CREAT bit is set	in semflag and the IPC_EXCL
	       bit is not set, then a successful call to
	       semget(key,nsems,semflag) shall return the semaphore
	       identifier associated with key.

     Deviance
	  5    EACCES in errno and return -1 on	a call to
	       semget(key,nsems,semflag) on an existing	semaphore when
	       the caller does not have	access permission for the
	       operation specified in the low order 9 bits of semflg.




     Page 1					    (printed 2/21/103)






     semget(XPG4.os/ipcRelease 4.4.1 (The Open Grousemget(XPG4.os/ipc)



	  6    EINVAL in errno and return -1 on	a call to
	       semget(key,nsems,semflag) when nsems is less than or
	       equal to	0.

	  7    EINVAL in errno and return -1 on	a call to
	       semget(key,nsems,semflag) when a	semaphore exists for
	       key but the number of semaphores	in the set associated
	       with it is less than nsems.

	  8    ENOENT in errno and return -1 on	a call to
	       semget(key,nsems,semflag) when the semaphore set	does
	       not currently exist and IPC_CREAT is not	set in semflg.

	  9    EEXIST in 'errno' and return -1 on a call to
	       semget(key,nsems,semflag) when the semaphore set	exists
	       and both	the IPC_CREAT  and IPC_EXCL bits are set in
	       semflg.

     Untestable	Aspects
	  1    EINVAL in errno and return -1 on	a call to
	       semget(key,nsems,semflag) when nsems is greater than
	       the system defined limit.
	       Reason: This requires knowledge of a system defined
	       limit which cannot be obtained from the system. If this
	       is static, it can be obtained from a parameter,
	       otherwise this is untestable.

	  2    ENOPSC in errno and return -1 on	a call to
	       semget(key,nsems,semflag) when the number of semaphores
	       allowed by the system is	exceeded.
	       Reason: This requires knowledge of a system defined
	       limit which cannot be obtained from the system. If this
	       is static, it can be obtained from a parameter,
	       otherwise this is untestable.

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
















     Page 2					    (printed 2/21/103)



