Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lock(9s) [osf1 man page]

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_try_read(9r)														 lock_try_read(9r)

NAME
lock_try_read - General: Tries to assert a complex lock with read-only access SYNOPSIS
#include <kern/lock.h> boolean_t lock_try_read( 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 try to assert a complex lock with read-only access. The lock structure is an opaque data structure; that is, its associated members are refer- enced and manipulated by the operating system and not by the user of the complex lock mechanism. DESCRIPTION
The lock_try_read routine tries to assert a complex lock (without blocking) with read-only access for the resource associated with the specified lock structure pointer. To release a complex lock with read-only access successfully asserted by lock_try_read, call the lock_done routine. NOTES
You must call lock_init (once only) prior to calling lock_try_read 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
The lock_try_read routine returns one of the following values: The attempt to acquire the read-only complex lock was successful. The attempt to acquire the read-only complex lock was unsuccessful. FILES
SEE ALSO
Routines: lock_done(9r), lock_terminate(9r), lock_try_write(9r), lock_write(9r) Data Structures: lock(9s) lock_try_read(9r)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

lock file!

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)
Discussion started by: sskb
4 Replies

2. UNIX for Dummies Questions & Answers

how to lock keyboard without using lock command

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)
Discussion started by: dianayun
7 Replies

3. UNIX for Dummies Questions & Answers

How can a file be locked for a certain time?

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)
Discussion started by: darthur
6 Replies

4. Solaris

lock user to directory in ftp

how can i lock a specific user to his home directory when he logs on to the computer with ftp? thanx! (3 Replies)
Discussion started by: eliraza6
3 Replies

5. SuSE

Opensuse mt command

do not have lock and unlock function, is any way to lock the tape drive under opensuse 10? thanks (4 Replies)
Discussion started by: lijiajin
4 Replies

6. Programming

Atomic lock file creation

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)
Discussion started by: tsurko
7 Replies

7. Programming

help with C programme to lock remote resources

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)
Discussion started by: zius_oram
7 Replies

8. HP-UX

Caps lock dtterm

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)
Discussion started by: mgb
7 Replies

9. UNIX for Dummies Questions & Answers

How to lock file system access

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)
Discussion started by: lokeshsingla
4 Replies

10. Shell Programming and Scripting

Large password lock script

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)
Discussion started by: Gibby13
5 Replies

11. UNIX for Dummies Questions & Answers

Caps lock problem

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)
Discussion started by: curiosity
4 Replies

12. Shell Programming and Scripting

How to check/compare lock file?

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)
Discussion started by: newbie_01
6 Replies

13. Red Hat

Problem with screen lock

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)
Discussion started by: goose25
4 Replies

14. UNIX for Advanced & Expert Users

Linux lock problem

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)
Discussion started by: shivakoteswarra
4 Replies

15. Shell Programming and Scripting

Search the specific content from the complex file

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)
Discussion started by: Riverstone
12 Replies