simple_lock_terminate(9r)simple_lock_terminate(9r)NAME
simple_lock_terminate - General: Terminates, using a simple lock
SYNOPSIS
#include <kern/lock.h>
void simple_lock_terminate(
simple_lock_t slock_ptr );
ARGUMENTS
Specifies a pointer to a simple lock structure. You can declare this simple lock structure by using the decl_simple_lock_data routine.
DESCRIPTION
The simple_lock_terminate routine determines that the kernel module is done using the simple lock permanently. The kernel module must free
the simple lock (that is, the kernel module does not hold the lock) before calling simple_lock_terminate. The kernel module must not refer-
ence the specified simple lock after calling simple_lock_terminate.
NOTES
You must call simple_lock_init (once only) prior to calling simple_lock_terminate to initialize the simple lock structure 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: decl_simple_lock_data(9r), simple_lock_init(9r), simple_lock_try(9r), simple_unlock(9r)
Data Structures: slock(9s)simple_lock_terminate(9r)
Check Out this Related Man Page
simple_lock_try(9r)simple_lock_try(9r)NAME
simple_lock_try - General: Tries to assert a simple lock
SYNOPSIS
#include <kern/lock.h>
boolean_t simple_lock_try(
simple_lock_t slock_ptr );
ARGUMENTS
Specifies a pointer to a simple lock structure. You can declare this simple lock structure by using the decl_simple_lock_data routine.
DESCRIPTION
The simple_lock_try routine tries to assert a lock with read and write access for the resource associated with the specified simple lock.
The main difference between this routine and simple_lock is that simple_lock_try returns immediately if the resource is already locked,
while simple_lock spins until the lock has been obtained. Thus, call simple_lock_try when you need a simple lock but the code cannot spin
until the lock is obtained.
To release a simple lock successfully asserted by simple_lock_try, call the simple_unlock routine.
RETURN VALUES
The simple_lock_try routine returns one of the following values: The simple_lock_try routine successfully asserted the simple lock. The
simple_lock_try routine failed to assert the simple lock.
FILES SEE ALSO
Routines: decl_simple_lock_data(9r), simple_lock(9r), simple_lock_init(9r), simple_lock_terminate(9r), simple_unlock(9r)
Data Structures: slock(9s)simple_lock_try(9r)
Hey. I'm just getting started with scripting and although i will admit i haven't searched the forum yet, i think it would be a waste of time. It really will be very simple.
I want to enter a list of arguments after my script with the last being the filename. (not the first, as this is part of... (3 Replies)
Can anyone direct me to a resource that explains scripting in simple terms?
I have visited many sites and browsed this forum and have yet to find simple explanations. (8 Replies)
Hi All,
Is there a max number of slabs that can be used per kernel module? I'm having a tough time finding out that kind of information, but the array 'node_zonelists' (mmzone.h) has a size of 5. I just want to avoid buffer overruns and other bad stuff.
Cheers,
Brendan (4 Replies)
Hi All,
I need to develop a kernel module which changes the IP address of a package according to its mac address. It would be a sort of L2 Nat.
Somebody know if I can do this using netfilter??
Thanks. (2 Replies)
Hi All ,
I am just a new bie in Unix/Linux .
With help of tips from 'here and there' , I just created a simple script to
1. declare one array and some global variables
2. read the schema names from user (user input) and want2proceed flag
3. if user want to proceed , keep reading user... (8 Replies)
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)
I have open suse kernel kernel 3.1.0-1.2-desktop on which I used kernel source 3.1.10-1.2 downloaded from kernel.org.
The module gets built.
While loading a kernel module I am getting Invalid module format error with description "first_driver: no symbol version for module_layout"
The... (5 Replies)
Hello
I have simple line of code here:
FILE *lockfp = fopen("/var/lock/subsys/processName", "w");
which is denied even running as root. The result is
locking failed for the following reason: Permission denied
How is this possible? Why is this happening?
Thanks for your... (4 Replies)
To load the driver at boot time I added my driver name in /etc/modules.
Next I copied the driver to /lib/modules/2.6.34.12/kernel/drivers/char/.
But when I reboot the machine the drriver does not get loaded.
What am I missing and how to load the driver at boot time? (9 Replies)
Hi All,
Here is the problem: I have done a c++ code in Visual Studio 2010, it's a simple project that only have one main function which takes 2 parameters: an integer and a file that stores data. Now, I am asked to write a shell script in linux to execute my main function. I asked my professor... (1 Reply)
I wanted to say LOL and punch my face when I saw post#11 (where Don_Cragun even reduced the string manipulation with a simple regex) in the thread https://www.unix.com/shell-programming-scripting/220553-add-0-start-filename-2.html
I mean, when things can be done with just a one liner, sometimes I... (6 Replies)