Sponsored Content
Special Forums Windows & DOS: Issues & Discussions Download Free personal firewallls Post 54779 by zazzybob on Tuesday 24th of August 2004 08:06:56 AM
Old 08-24-2004
Ahem. What is the point of the useless poll at the top of this thread? Smilie
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

free download indigo perl for windows

i want test perl program with indigo perl before i transfer it to the web, where i could get a free one software (2 Replies)
Discussion started by: zeoous
2 Replies

2. UNIX for Dummies Questions & Answers

Any URL'S for free Unix Download

Hi, Can anyone please suggest me a URL where I can download some unix OS free of cost?? Thanks, Kumar (4 Replies)
Discussion started by: yelamarthi
4 Replies

3. Linux

Where can I download the original Linux code for free?

Where can I download the original Linux code for free? (1 Reply)
Discussion started by: Super Apollo
1 Replies

4. UNIX for Dummies Questions & Answers

Where to download this free Unix database

Hi Folks, I was looking around some web sites and found out that there is/was this free databse for Unix called RDB by Walter Hobbs, which uses ASCII text files for its databases and uses Unix commands to manipulate them. Unfortunately, I can no longer access the ftp site mentioned on the web... (0 Replies)
Discussion started by: rooseter
0 Replies

5. OS X (Apple)

Free download for Mac os?

Does Any body knows where can I get free download for mac OS. Any version is OK.:o (4 Replies)
Discussion started by: sackNumchai
4 Replies

6. UNIX for Dummies Questions & Answers

Linux free download

Hello, I am not sure where to post this questions... I have Windows XP in my home computer. I need to install Linux on my home computer for learning purpose. Can one please recommend any free download link to download free linux... Any help is appreciated... Thank you... (1 Reply)
Discussion started by: govindts
1 Replies

7. UNIX for Dummies Questions & Answers

Free OS download

Could any one tell me where I can download Unix, linux,solaris and red hat OS (4 Replies)
Discussion started by: prasadg034
4 Replies
LIBDLM(3)						     Library Functions Manual							 LIBDLM(3)

NAME
libdlm - dlm_get_fd, dlm_dispatch, dlm_pthread_init, dlm_ls_pthread_init, dlm_cleanup SYNOPSIS
#include <libdlm.h> int dlm_pthread_init(); int dlm_ls_pthread_init(dlm_lshandle_t lockspace); int dlm_pthread_cleanup(); int dlm_get_fd(void); int dlm_dispatch(int fd); link with -ldlm DESCRIPTION
libdlm provides the programmatic userspace interface to the Distributed Lock manager. It provides all the calls you need to manipulate locks & lockspaces libdlm can be used in pthread or non-pthread applications. For pthread applications simply call the following function before doing any lock operations. If you're using pthreads, remember to define _REENTRANT at the top of the program or using -D_REENTRANT on the compile line. pthreads is the normal way of using the DLM. This way you simply initialize the DLM's thread and all the AST routines will be delivered in that thread. You just call the dlm_lock() etc routines in the main line of your program. If you don't want to use pthreads or you want to handle the dlm callback ASTs yourself then you can get an FD handle to the DLM device and call dlm_dispatch() on it whenever it becomes active. That was ASTs will be delivered in the context of the thread/process that called dlm_dispatch(). int dlm_pthread_init() Creates a thread to receive all lock ASTs. The AST callback function for lock operations will be called in the context of this thread. If there is a potential for local resource access conflicts you must provide your own pthread-based locking in the AST routine. int dlm_ls_pthread_init(dlm_lshandle_t lockspace) As dlm_pthread_init but initializes a thread for the specified lockspace. int dlm_pthread_cleanup() Cleans up the default lockspace threads after use. Normally you don't need to call this, but if the locking code is in a dynamically load- able shared library this will probably be necessary. For non-pthread based applications the DLM provides a file descriptor that the program can feed into poll/select. If activity is detected on that FD then a dispatch function should be called: int dlm_get_fd() Returns a file-descriptor for the DLM suitable for passing in to poll() or select(). int dlm_dispatch(int fd) Reads from the DLM and calls any AST routines that may be needed. This routine runs in the context of the caller so no extra locking is needed to protect local resources. libdlm_lt There also exists a "light" version of the libdlm library called libdlm_lt. This is provided for those applications that do not want to use pthread functions. If you use this library it is important that your application is NOT compiled with -D_REENTRANT or linked with libpthread. EXAMPLES
Create a lockspace and start a thread to deliver its callbacks: dlm_lshandle_t ls; ls = dlm_create_lockspace("myLS", 0660); dlm_ls_pthread_init(ls); ... status = dlm_ls_lock(ls, ... ); Using poll(2) to wait for and dispatch ASTs static int poll_for_ast(dlm_lshandle_t ls) { struct pollfd pfd; pfd.fd = dlm_ls_get_fd(ls); pfd.events = POLLIN; while (!ast_called) { if (poll(&pfd, 1, 0) < 0) { perror("poll"); return -1; } dlm_dispatch(dlm_ls_get_fd(ls)); } ast_called = 0; return 0; } SEE ALSO
libdlm(3), dlm_lock(3), dlm_unlock(3), dlm_open_lockspace(3), dlm_create_lockspace(3), dlm_close_lockspace(3), dlm_release_lockspace(3) libdlm functions July 5, 2007 LIBDLM(3)
All times are GMT -4. The time now is 09:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy