Lots of system service calls in the OpenVMS operating system allow you to optionally specify an event flag number (EFN). The documentation states that this is an optional parameter, and usually goes on to say:
Number of the event flag that is set when the $xxx request completes. The efn argument is a longword containing this number; however, $xxx uses only the low-order byte.
When the request is queued, $xxx clears the specified event flag. Then, when the request completes, the specified event flag is set.
In recent versions of the "System Services Reference Manual", an additional paragraph has been added to some of the more frequently used system services that says:
HP strongly recommends the use of the EFN$C_ENF "no event flag" value as the event flag if you are not using an event flag to externally synchronize with the completion of this system service call. The $EFNDEF macro defines EFN$C_ENF. For more information, see the HP OpenVMS Programming Concepts Manual.
And some of the system services even tell you that if you omit the optional EFN parameter, EFN zero, which is certainly a valid EFN, will be cleared and set when the service is called and then completes.
If the system service you are researching doesn't have that information, please just imagine that it's there every time you see the optional EFN parameter.
I can't stress this enough. If you omit this parameter, bad things can and will happen if you are dependent on knowing when events occur.
To state is simply, use EFN$C_ENF everywhere you don't explicitly need to know when an event flag sets, and use a specified event flag (allocated by lib$get_ef) when you do.
Posted at February 12, 2013 7:12 AMComments are closed