11-08-2011
Quote:
Originally Posted by
jjinno
If you answer the following question for me, I am pretty sure you will find at least the semaphore issue yourself:
What happens to the "full" semaphore when you find a file, and the file size is greater than 4096?
The full semaphore increments (sem_post) when a file is found after which the stage 2 tries to lock the mutex and stats the file for checking the size.
10 More Discussions You Might Find Interesting
1. Programming
At present, Iam working on Linux Framebuffer device console. I have a doubt sir. Please solve this.
*How to display a string or a character in Frame buffer in C language?
*What is the library file (is it <linux/fb.h> or other one?) used to do all I/O function manipulations like printing,... (0 Replies)
Discussion started by: chandra80
0 Replies
2. Shell Programming and Scripting
Hi,
I am accepting a string from user. compare this output with the awk output as below...
echo "\n\n\tDay : \c"
read day
awk '{ if($day == $2) { if ($mon == $1) { print "Yes" }}}' syslog.txt
I am getting the follwoing error
awk: Field $() is not correct.
The input line... (5 Replies)
Discussion started by: EmbedUX
5 Replies
3. Programming
Hey Guys
I am trying to implement the malloc function for my OS class and I am having a little trouble with it. I would be really grateful if I could get some hints on this problem.
So I am using a doubly-linked list as my data structure and I have to allocate memory for it (duh...). The... (1 Reply)
Discussion started by: Gambit_b
1 Replies
4. UNIX for Advanced & Expert Users
Hey Guys
Some of my friends have got together and we are trying to write a basic kernel similar to Linux. I am trying to implement the malloc function in C and I am using a doubly linked list as the primary data structure. I need to allocate memory for this link list (duh...) and I don't feel... (2 Replies)
Discussion started by: rbansal2
2 Replies
5. Linux
Hi
I'm trying to implement CAPWAP protocol for my application.i'm able to configure my server side but i'm getting error at client(WTP) side as IOCTL error.while running the command
#./WTP /mnt/cf/capwap/
: wlan2
Starting WTP...
# WTP Loads... (0 Replies)
Discussion started by: ran789
0 Replies
6. UNIX for Dummies Questions & Answers
Hi everybody,
i've been googling for ages now and gotten kinda desperate... The question, however, might be rather trivial for the experts: What is it exactly, i.e. physically, the POSIX function (for a file) "lseek" does? Does it trigger some kind of synchronization on disk? Is it just for the... (4 Replies)
Discussion started by: Humudituu
4 Replies
7. UNIX for Advanced & Expert Users
How can i implement Ipsec between two machines in linux_ ubuntu?
any link?? suggestion?? (0 Replies)
Discussion started by: elinaz
0 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
My problem is that when creating my producers and consumers, if I don't create an equal number of both, the... (12 Replies)
Discussion started by: digitalbrainiac
12 Replies
9. Programming
I have this code from a programming book:
#include <stdio.h>
#include <string.h>
char buf; /* input line buffer */
char* field; /* fields */
char* unquote( char* );
/* csvgetline: read and parse line, return field count */
/* sample input:... (3 Replies)
Discussion started by: totoro125
3 Replies
10. Shell Programming and Scripting
Could you please give your inputs on the below issue:
source.xml
<?xml version="1.0" encoding="UTF-16"?>
<P1 >
<C1 type="i"><2></C1>
<V1 type="string"><6.2></V1>
<D1 type="string">
<D2><1.0></D2>
<D2><2.0></D2>
</D1>
......................
......................
many more... (7 Replies)
Discussion started by: unme
7 Replies
LEARN ABOUT XFREE86
sem_post
SEM_POST(3) Linux Programmer's Manual SEM_POST(3)
NAME
sem_post - unlock a semaphore
SYNOPSIS
#include <semaphore.h>
int sem_post(sem_t *sem);
Link with -pthread.
DESCRIPTION
sem_post() increments (unlocks) the semaphore pointed to by sem. If the semaphore's value consequently becomes greater than zero, then
another process or thread blocked in a sem_wait(3) call will be woken up and proceed to lock the semaphore.
RETURN VALUE
sem_post() returns 0 on success; on error, the value of the semaphore is left unchanged, -1 is returned, and errno is set to indicate the
error.
ERRORS
EINVAL sem is not a valid semaphore.
EOVERFLOW
The maximum allowable value for a semaphore would be exceeded.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+-----------+---------------+---------+
|Interface | Attribute | Value |
+-----------+---------------+---------+
|sem_post() | Thread safety | MT-Safe |
+-----------+---------------+---------+
CONFORMING TO
POSIX.1-2001.
NOTES
sem_post() is async-signal-safe: it may be safely called within a signal handler.
EXAMPLE
See sem_wait(3).
SEE ALSO
sem_getvalue(3), sem_wait(3), sem_overview(7), signal-safety(7)
COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
Linux 2017-03-13 SEM_POST(3)