Sponsored Content
Full Discussion: A simple C program query ...
Top Forums Programming A simple C program query ... Post 302569251 by agama on Sunday 30th of October 2011 11:30:16 AM
Old 10-30-2011
Is it possible that the lock should have already been captured and this code is just ensuring that it has the lock? In that context, the code is correct -- it's a bug if the lock wasn't obtained before invoking ext3_write_super.

If the lock is already held, then the return is 0, and thus it is safe to do the work that the function wants to do.

This might not be the case, but assuming you've posted the whole ext3_write_super function, which does not release the mutex, that'd be my guess.
 

10 More Discussions You Might Find Interesting

1. Programming

QUESTION...simple program?

I am new to the unix/linux environment. AND........ I need to create a mini shell..that displays prompt (i.e., READY:$), accepts a command from std-in, and prints the command and any parameters passed to it. HELP!!!! (8 Replies)
Discussion started by: jj1814
8 Replies

2. UNIX for Dummies Questions & Answers

simple sed query

hi, i would like to replace a string in a series of files with another string, without outputting to new files. is this possible? i've tried using sed, and started by trying to alter the contents of one file... sed 's/string1/string2/g' file.txt but while this does the replacement on... (2 Replies)
Discussion started by: schmark
2 Replies

3. UNIX for Dummies Questions & Answers

Simple loop query

Hi All Just started with shell scripts and am stumped by, what is to most of you no doubt, a simple issue. All I'm trying to do is prompt a user for input and writing to a log file. If the user types the word 'stop', then the program should halt. If the word typed is 'clear', then the log file... (2 Replies)
Discussion started by: kutz13
2 Replies

4. Shell Programming and Scripting

A simple query on unix shell script

I want to write a script to go to particular path in file and run shell script from there. what will be shell script for the same. (2 Replies)
Discussion started by: shekhar_ssm
2 Replies

5. Shell Programming and Scripting

pro*c program for sql query

Hi all, I have sql query as follows. Please write a pro*c program for the following query. select sp1.cost_change ||','|| sp1.cost_change_desc ||','|| sp1.reason ||','|| to_char(sp1.active_date,'DD-MON-YYYY HH24:MI:SS') ||','|| sp1.status ||','|| sp1.cost_change_origin... (0 Replies)
Discussion started by: user71408
0 Replies

6. Shell Programming and Scripting

Need Help !!! simple query

Dear, I have a alarm text file, containing minor and major alarms, i am intrested in Mojor alarm with its alarm header and next four lines in seperate file.... Can anybody help me with this below is the alarm file output. :SEV="MAJOR": Object-Instance % unit-type % bts nbr % 25 ... (5 Replies)
Discussion started by: Danish Shakil
5 Replies

7. Programming

Xlib simple program.

I don't know if it is right to ask you this. Can someone help me write a simple Xlib program,with button on it,and all that button do is switch 2 messages. I have tried and tried,but never get past Hello World. Can someone help me please? ---------- Post updated at 10:17 PM ---------- Previous... (2 Replies)
Discussion started by: megane16v
2 Replies

8. Shell Programming and Scripting

simple program help required

The circumfrence of a circle is #!/usr/bin/perl print 2 * 3.141592654 * 12.50 \n"; # pi= 3.141592654 # r= 12.50 I need a simple program showing me all the steps..to modify the above to prompt for and accept a radius from the person running the... (3 Replies)
Discussion started by: Q2wert
3 Replies

9. Shell Programming and Scripting

Help with simple program. (beginner)

Hey all, Writing a program that searches for a username and if they are online creates a 'beep' and sends the username and date to a log file. the error i am getting is: paul.obrien16@aisling:~/os$ bash checklogin : command not found Enter username paul.obrien16 ': not a valid... (2 Replies)
Discussion started by: sexyladywall
2 Replies

10. Shell Programming and Scripting

From perl program query is not executed.

I have tried executing one particular query through perl.But I am unable to get the result. When I tried to execute the sysdate query its working when I executed my perl code. The below query doesn't work. QUERY 1:my $sql ="select name from tab where rownum <6"; Received ora error... (23 Replies)
Discussion started by: ramkumar15
23 Replies
PTHREAD_RWLOCK_UNLOCK(3)				   BSD Library Functions Manual 				  PTHREAD_RWLOCK_UNLOCK(3)

NAME
pthread_rwlock_unlock -- release a read/write lock SYNOPSIS
#include <pthread.h> int pthread_rwlock_unlock(pthread_rwlock_t *lock); DESCRIPTION
The pthread_rwlock_unlock() function is used to release the read/write lock previously obtained by pthread_rwlock_rdlock(), pthread_rwlock_wrlock(), pthread_rwlock_tryrdlock(), or pthread_rwlock_trywrlock(). RETURN VALUES
If successful, the pthread_rwlock_unlock() function will return zero. Otherwise an error number will be returned to indicate the error. The results are undefined if lock is not held by the calling thread. ERRORS
The pthread_rwlock_unlock() function may fail if: [EINVAL] The value specified by lock is invalid. [EPERM] The current thread does not own the read/write lock. SEE ALSO
pthread_rwlock_rdlock(3), pthread_rwlock_wrlock(3) STANDARDS
The pthread_rwlock_unlock() function is expected to conform to Version 2 of the Single UNIX Specification (``SUSv2''). HISTORY
The pthread_rwlock_unlock() function first appeared in FreeBSD 3.0. BSD
August 4, 1998 BSD
All times are GMT -4. The time now is 01:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy