Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lock_read(9r) [osf1 man page]

lock_read(9r)															     lock_read(9r)

NAME
lock_read - General: Asserts a complex lock with read-only access SYNOPSIS
#include <kern/lock.h> void lock_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 assert a complex lock with read-only 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_read routine asserts a lock with read-only access for the resource associated with the specified lock structure pointer. The lock_read routine allows multiple kernel threads to access the resource read-only at the same time. When a read lock is asserted, the pro- tected resource is guaranteed not to change. To release a previously asserted read lock, call the lock_done routine. NOTES
You must call lock_init (once only) prior to calling lock_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 variables and in data structure members. RETURN VALUES
None FILES
SEE ALSO
Routines: lock_done(9r), lock_terminate(9r), lock_try_read(9r), lock_try_write(9r), lock_write(9r) Data Structures: lock(9s) lock_read(9r)

Check Out this Related Man Page

lock_init(9r)															     lock_init(9r)

NAME
lock_init - General: Initializes a complex lock SYNOPSIS
#include <kern/lock.h> void lock_init( lock_t lock_structptr, boolean_t can_sleep ); ARGUMENTS
Specifies a pointer to the complex lock structure, lock. 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. Specifies a Boolean value that indicates whether to allow kernel threads to block (sleep) if the complex lock is asserted. You can pass to this argument only the value TRUE (allow kernel threads to block if the lock is asserted). DESCRIPTION
The lock_init routine initializes a complex lock. You identify this lock by declaring a pointer to a complex lock structure and passing it as the first argument. The complex lock structure pointer must be initialized before you can assert read and write operations on the com- plex lock. RETURN VALUES
None FILES
SEE ALSO
Routines: lock_done(9r), lock_read(9r), lock_terminate(9r), lock_try_read(9r), lock_try_write(9r), lock_write(9r) Data Structures: lock(9s) lock_init(9r)
Man Page

12 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

setting num lock on at boot up

Once I knew how to set up a unix file so that the num lock would automatically be on after booting up. How exactly is that done? Unix has final control on the setting of the num lock from off or on to on at the end of the boot up process. Any help will be appreciated, especially if detailed. Oh... (0 Replies)
Discussion started by: jddxxx
0 Replies

4. UNIX for Dummies Questions & Answers

Passwd lock for 5days

Hi Admin, I need a help regarding to lock the user for 5 days.. for example i want to lock user account from Monday 1.00AM to Friday 1.00PM.. is there any method to do from Cron or passwd command. Regards, Prem :cool: (2 Replies)
Discussion started by: Prem
2 Replies

5. Red Hat

screen lock problem

hi friends i have a small problem,in my redhat enterprise linux system screen lock is not working if i click screen lock no action takes place... so is there any solution to fix this problem or any alternate method available please let me know.... waiting for replys....... thanks... (2 Replies)
Discussion started by: madhusudankh
2 Replies

6. UNIX for Dummies Questions & Answers

setting file access restriction

is there a way to "lock" an entire directory to where it currently resides for securtiy purposes? only certain users can access these data, however i want to prevent the possibility of transferring/duplicating the data to where other unauthorized users can access it. Any one who knows a good... (4 Replies)
Discussion started by: Deanne
4 Replies

7. UNIX for Dummies Questions & Answers

Text book / online resource for learning to program at system/kernel level

Is there any book/resource that one can refer to, to be able to write programs at kernel/system level.. I'm looking for a programming book that could serve as a guide to write kernel codes / system level programming etc.. I have Tannenbaum's Design and Implementation. It addresses theoretical... (2 Replies)
Discussion started by: vishwamitra
2 Replies

8. UNIX for Advanced & Expert Users

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... (1 Reply)
Discussion started by: lokeshsingla
1 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. UNIX for Dummies Questions & Answers

kernel giving access for multiple users to access files

hi all, i want to know y kernel is giving access for multiple users to access a file when one user may be the owner is executing that file. Because other user can manipulate that file when the other user is executing that file, it will give the unexpected result to owner . plz help me... (1 Reply)
Discussion started by: jimmyuk
1 Replies

11. Ubuntu

Help me to lock my system.

Hi All! I am not able to lock my Ubuntu 12.04 LXDE. Can anybody tell me the shortcut to lock the system. I have tried all conventional keyboard shortcuts as well as buttons. (2 Replies)
Discussion started by: nixhead
2 Replies

12. 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