home *** CD-ROM | disk | FTP | other *** search
-
- /* u4unlock.c (c)Copyright Sequiter Software Inc., 1987, 1988, 1989. All rights reserved.
-
- Returns
- 0 Normal
- -1 Error
- */
-
- #include "d4base.h"
- #include "u4error.h"
-
- #ifndef UNIX
- #include <io.h>
- #endif
- #ifndef TURBO
- #ifdef UNIX
- #include <sys/locking.h>
- #else
- #include <sys\locking.h>
- #endif
- #endif
- #include <stdlib.h>
-
- #include <errno.h>
-
-
- u4unlock( file_handle, o_set, num_bytes )
- int file_handle ;
- long o_set, num_bytes ;
- {
- int rc ;
-
- errno = 0 ;
-
- #ifdef TURBO
- rc = unlock( file_handle, o_set, num_bytes ) ;
- #else
- lseek( file_handle, o_set, 0 ) ;
- rc = locking( file_handle, LK_UNLCK, num_bytes) ;
- #endif
-
- if (rc < 0 && errno != EINVAL )
- {
- u4error( E_UNLOCK, (char *) 0 ) ;
- return( -1) ;
- }
-
- return 0 ;
- }
-
-