lock(9s)lock(9s)NAME
lock - General: Contains complex lock-specific information
SYNOPSIS
The lock data structure is an opaque data structure; that is, its associated members are referenced and manipulated by the operating system
and not by the user of the complex lock mechanism. Therefore, this reference page omits a description of the lock data structure's associ-
ated members.
DESCRIPTION
The lock data structure is the complex lock structure that contains complex lock-specific information. A kernel module writer using the
complex lock method declares a pointer to a lock data structure and passes its address to the associated lock routines.
NOTES
The header file <lock.h> shows typedef statements that assign the alternate name lock_data_t for the complex lock structure and lock_t for
a pointer to the complex lock structure.
FILES SEE ALSO
Routines: lock_done(9r), lock_init(9r), lock_read(9r), lock_terminate(9r), lock_try_read(9r), lock_try_write(9r), lock_write(9r)
Data Structures: slock(9s)lock(9s)
Check Out this Related Man Page
lock_write(9r)lock_write(9r)NAME
lock_write - Asserts a complex lock with write access
SYNOPSIS
#include <kern/lock.h>
void lock_write(
lock_t lock_structptr );
ARGUMENTS
Specifies a pointer to the complex lock structure, lock. This is the lock structure associated with the resource on which you want to
assert a complex lock with write access. The lock structure is an opaque data structure; that is, its associated members are referenced and
manipulated by the operating system and not by the user of the complex lock mechanism.
DESCRIPTION
The lock_write routine asserts a lock with exclusive write access for the resource associated with the specified lock structure pointer.
This means that once a write lock is asserted, no other kernel thread can gain read or write access to the resource until it is released.
To release a complex write lock successfully asserted by lock_write, call the lock_done routine.
NOTES
You must call lock_init (once only) prior to calling lock_write to initialize the lock structure pointer for the resource. A resource,
from the kernel module's standpoint, is data that more than one kernel thread can manipulate. You can store the resource in global vari-
ables and in data structure members.
RETURN VALUES
None
FILES SEE ALSO
Routines: lock_done(9r), lock_read(9r), lock_terminate(9r), lock_try_read(9r), lock_try_write(9r)
Data Structures: lock(9s)lock_write(9r)
I found a lock file like this
lrwxrwxr-x 1 sskb apollo 16 Oct 22 22:00 lock -> hostname:2747
(pl. note that hostname is a number like 123.4.5.6)
but this was not shown in the file manager eventhough I had selected to show the hidden files.
I could not even read the... (4 Replies)
how can I lock my keyboard while I'm away from the computer without using lock command. What other commands gives me the option to lock keyboard device?
thanks (7 Replies)
I want to be able to lock a file for 60 minutes so that an automated monitoring program will not execute the script more that once an hour. I have never used a lock file but have heard that is what I need to use. Does anyone have any examples of how I would use this?
lock 60 filename.ksh ---?... (6 Replies)
Hello,
I need to implement a locking system in C. My problem is how to make the check if the lock file exist and locking it atomic operation.
I want to make something like this:
FILE* lock_fname;
lock_fname = fopen ( "file.lock", "r");
/*check if file exsists*/
if (lock_fname)
{
fclose... (7 Replies)
hello every one
i am working on a project to lock remote computer resources(hard drive, usb, cd- rom, folder etc). i have maintained connection using JAVA RMI and using JAVA JNI to lock resources, now i am really stuck up with C programme to do actual locking, i am using RHL-5 on admin computer... (7 Replies)
Hello,
We are having a problem with running dtterm off a RHEL server. Logging into an HP-UX server from a RHEL 5.1 desktop, setting DISPLAY and running dtterm, the caps lock does not work. We have been playing with xmodmap & stty but to no avail.
Any help appreciated.
mgb (7 Replies)
Hi Everybody..
I am using Moblin V2 which has nautilus file manager the one which is also used in Ubuntu.
I want to lock the access to file system such that i can only browse my home folder not other locations like /, /usr, /bin and all.
Or i want to create a partition of 10 or 15 GB so... (4 Replies)
I am trying to create a script that will take a very large, tab delimited file and then lock accounts.
File headers look like this
id desc server pass sudo lock
test Test user server01 67 no no
"Test user" is under the desc column
Basically if pass column is greater... (5 Replies)
hi all
this s quite a foolish problem. I seem to hav pressed some keys s.t in unix, my letters are comin in caps and with caps lock on, i am getting lowercase letters. :o
Pls help.
Also is there any reference or manual where i can check in case such problems arrise?
thanx in advance
curiosity (4 Replies)
Hi all,
I have a shell script that I schedule to run from 0700 - 1900, every 15minutes. For each run it creates a lock file and remove it on exit.
While there is a bit of a flaw to it where the lock file don't get remove if someone kills the script while it is running, I am fairly satisfied... (6 Replies)
I'm having a weird problem with a RHEL6 workstation. When the screen lock is activated manually the system will lock and the screens will go blank. Once I try to unlock the system, the monitor will just flicker and won't respond. I tried the combination CTRL, ALT, Backspace and it did not work,... (4 Replies)
Hi Team,
I have a requirement to access a shared resource from the user and interrupt context. What type of locking mechanism I have to use for this. Can any body give advice on this.
Thanks in advance.
-Shiva (4 Replies)
Hi,
I have a file with complex data without delimiter, have requirement to fetch the specific record based on some charcters.
here is my file data
... (12 Replies)