Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Novlib 3.30 Online Reference - <b> semopen()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SemOpen()
------------------------------------------------------------------------------
 Purpose:
 Open a semaphore.

 Syntax:
 dwSemID = SemOpen( lpszSemName )

 Parameters:
 lpszSemName The semaphore name.
 wValue      The initial semaphore value.

 Returns:
 A numeric value (unsigned long int).

 Description:
 SemOpen() returns the semaphore ID number if the semaphore specified by
 lpszSemName is successfully opened.

 Returns NOVERRLONG if an error occurs. If no other workstations have the
 specified semaphore open then its value is set to wValue. If the sempahore
 is already open on another workstation wValue is ignored.
 The initial semaphore value wValue must be in the range 1 to 127.

 Example:
 // To open a semaphore called "UPDATE_SEM" with an initial value of 24:
 dwSemID = SemOpen( "UPDATE_SEM", 24 )
  if ( NWErrorGet() = 0 )
    ? "Semaphore opened successfully"
 endif

 Notes:
 The ID number should be saved if the semaphore is to be accessed
 again using the other semaphore functions.

 Note for CA-Clipper:
 IMPORTANT - both positive and negative values are valid semaphore handles,
 except the value NOVERRLONG. Valid semaphore handles can be in the range
 -2147483647 to +2147483647.

See Also: SemClose() SemUsrGet() SemValGet()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson