home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume32 / xbbs / part01 / locking.h < prev   
C/C++ Source or Header  |  1992-09-08  |  2KB  |  50 lines

  1. /*
  2.  
  3. ####### #     # #       #     #         ####### ####### ######
  4. #     # ##    # #        #   #          #       #     # #     #
  5. #     # # #   # #         # #           #       #     # #     #
  6. #     # #  #  # #          #            #####   #     # ######
  7. #     # #   # # #          #            #       #     # #   #
  8. #     # #    ## #          #            #       #     # #    #
  9. ####### #     # #######    #            #       ####### #     #
  10.  
  11. #     # ####### #     #         #     #
  12. ##    # #     # ##    #          #   #   ######  #    #     #    #    #
  13. # #   # #     # # #   #           # #    #       ##   #     #     #  #
  14. #  #  # #     # #  #  #  #####     #     #####   # #  #     #      ##
  15. #   # # #     # #   # #           # #    #       #  # #     #      ##
  16. #    ## #     # #    ##          #   #   #       #   ##     #     #  #
  17. #     # ####### #     #         #     #  ######  #    #     #    #    #
  18.  
  19.  
  20.           ####    #   #   ####    #####  ######  #    #   ####
  21.          #         # #   #          #    #       ##  ##  #
  22.           ####      #     ####      #    #####   # ## #   ####
  23.               #     #         #     #    #       #    #       #
  24.          #    #     #    #    #     #    #       #    #  #    #
  25.           ####      #     ####      #    ######  #    #   ####
  26.  
  27.    This as an attempt to emulate the 'locking' subroutine for non-Xenix
  28.    systems. This has not been tested; however, it should work. One of
  29.    the main differences is that Xenix can lock a file for writing;
  30.    however, it can still be read ( LK_RLCK and LK_NBRLCK ). The only
  31.    likely difference would be delays during a message read while
  32.    another user is writing into the same message base.
  33.    
  34.    *************** ONLY FOR NON-XENIX SYSTEMS ********************
  35.    This file should be added to the /usr/include/sys directory as locking.h
  36.    *************** ONLY FOR NON-XENIX SYSTEMS ********************
  37.  
  38.    Please report back to me how this emulation performs.
  39.    Sanford Zelkovitz XBBS 714-821-9671
  40.    ...........!ihnp4!hermix!ucla-an!alphacm!{root|sandy}
  41.    ...........!ucbvax!ucivax!mickey!alphacm!{root|sandy}
  42. */
  43. #include "/usr/include/unistd.h"
  44. #define LK_UNLCK F_ULOCK
  45. #define LK_LOCK F_LOCK
  46. #define LK_NBLCK F_TLOCK
  47. #define LK_RLCK F_LOCK
  48. #define LK_NBRLCK F_TLOCK
  49. #define locking lockf
  50.