Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lock_init(9r) [osf1 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)

Check Out this Related Man Page

lock_terminate(9r)														lock_terminate(9r)

NAME
lock_terminate - General: Terminates, using a complex lock SYNOPSIS
#include <kern/lock.h> void lock_terminate( lock_t lock_structptr ); 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. DESCRIPTION
The lock_terminate routine determines that the driver is done using the complex lock forever. The complex lock must be free (that is, the driver does not hold the lock) before calling lock_terminate. The kernel module must not reference the specified complex lock after calling lock_terminate. NOTES
You must call lock_init (once only) prior to calling lock_terminate 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
Kernel routines: lock_done(9r), lock_init(9r), lock_try_read(9r), lock_try_write(9r), lock_write(9r) Data Structures: lock(9s) lock_terminate(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

host lock up

hey fellows, hope you can help me, in advance thanks. I work on a sco unix 3.2 system and I've had a host lock up error message, I wan to know if there is a releasse note for an upgrade where I can see this bug is reported and fixed. Can somebody help me? THANKS!!! Thank you very much... (1 Reply)
Discussion started by: alex_slb
1 Replies

4. Solaris

lock time delay

I have a Sol system. The lock timeout is default 15 minutes. I tried to make it longer but cannot by lock -t timeout Anyon can tell me the cmd in solai for this please. A thank in advance (2 Replies)
Discussion started by: part-time-user
2 Replies

5. UNIX for Dummies Questions & Answers

composing a variable name from another variable;

Hi Guys, I have the below; case $1 in checkvob) checkvob_log=$log_loc/cchealth/$1/$1.$date_stamp.$$ ;; dbcheck) dbcheck_log=$log_loc/cchealth/$1/$1.$date_stamp.$$ ;; lock) lock_log=$log_loc/cchealth/$1/$1.$date_stamp.$$ ;; ... (2 Replies)
Discussion started by: topcat8
2 Replies

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

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

8. HP-UX

where I can set login fail ,lock time

where I can set login fail ,lock time thanks (2 Replies)
Discussion started by: alert0919
2 Replies

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

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

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

12. Programming

Using General Data Structure Library (GDSL)

Dear All, I would appreciate if some one could please post a few examples using GDSL library. The library provides general data structure operations. I am having confusion using list data structure regarding arguments. Would appreciate your kind response. with regards, Usman (2 Replies)
Discussion started by: usman_minhas
2 Replies

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

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

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