delorie.com/djgpp/doc/libc/libc_539.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

lock

Syntax

 
#include <io.h>

int lock(int fd, long offset, long length);

Description

Locks a region in file fd using MS-DOS file sharing interface. The region of length bytes, starting from offset, will become entirely inaccessible to other processes. If multiple locks are used on a single file they must be non-overlapping. The lock must be removed before the file is closed.

This function will fail unless share, or a network software providing similar interface, is installed. This function is compatible with Borland C++ function of the same name.

See section unlock.

Return Value

Zero if successful, nonzero if not.

Portability

ANSI/ISO C No
POSIX No


  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004