Sophie

Sophie

distrib > Mandriva > 2011.0 > i586 > by-pkgid > 97f75e9940e57f2bde7b60c25f8c29b7 > files > 213

maradns-1.4.06-2.i586.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>