You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
505 B
30 lines
505 B
/*
|
|
* PerlXS module for managing file locks
|
|
*
|
|
* (c) 2007 Pavel Charvat <pchar@ucw.cz>
|
|
*/
|
|
|
|
#include "EXTERN.h"
|
|
#include "perl.h"
|
|
#include "XSUB.h"
|
|
|
|
#include <unistd.h>
|
|
#include <fcntl.h>
|
|
|
|
|
|
MODULE = UCW::Filelock PACKAGE = UCW::Filelock
|
|
|
|
PROTOTYPES: ENABLED
|
|
|
|
int
|
|
fcntl_lock(IN int fd, IN int cmd, IN int type, IN int whence, IN int start, IN int len)
|
|
CODE:
|
|
struct flock fl;
|
|
fl.l_type = type;
|
|
fl.l_whence = whence;
|
|
fl.l_start = start;
|
|
fl.l_len = len;
|
|
|
|
RETVAL = fcntl(fd, cmd, &fl);
|
|
OUTPUT:
|
|
RETVAL
|
|
|