js_unlock(3)

NAME
js_unlock - Place an exclusive lock on an open file

SYNOPSIS
#include JsStr.h

int js_unlock(js_file *desc)

DESCRIPTION
js_unlock is a function that removes an exclusive lock on an open file.

ARGUMENTS
desc is a pointer to an open file object.

RETURN VALUE
js_unlock returns JS_SUCCESS.

NOTES
js_unlock uses flock to unlock the file.

EXAMPLE
The following locks, writes to, then unlocks the file "filename":

	js_string *foo;
	js_file *bar;
	foo = js_create(256,1);
	js_str2js(foo,"filename",8,1);
	js_open_append(foo,bar);
	js_lock(bar);
	js_write(bar,foo,3);
	js_unlock(bar);

AUTHOR
Sam Trenholme <kiwi-zttfryb@koala.samiam.org>