Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > c21ce21ed2b9178641591b8b861ea839 > files > 100

maradns-1.3.07.09-8.fc16.i686.rpm

.\" Process this file with
.\" groff -man -Tascii cryptday.1
.\"
.TH js_unlock 3 "October 2000" JS "js library reference"
.\" We don't want hyphenation (it's too ugly)
.\" We also disable justification when using nroff
.hy 0
.if n .na
.SH NAME
js_unlock \- Place an exclusive lock on an open file
.SH SYNOPSIS
.nf
.B #include "JsStr.h"
.sp
.B "int js_unlock(js_file *desc)"
.fi
.SH DESCRIPTION
.B js_unlock
is a function that removes an exclusive lock on an open file.
.SH ARGUMENTS
.B desc
is a pointer to an open file object.
.SH "RETURN VALUE"
.B js_unlock
returns 
.I JS_SUCCESS.
.SH NOTES
.B js_unlock
uses
.B flock
to unlock the file.
.SH EXAMPLE
The following locks, writes to, then unlocks the file "filename":

.nf
	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);
.fi
.SH AUTHOR
Sam Trenholme <kiwi-zttfryb@koala.samiam.org>