Sponsored Content
Full Discussion: C: error in wait system call
Top Forums Programming C: error in wait system call Post 302580648 by fpmurphy on Friday 9th of December 2011 06:29:56 AM
Old 12-09-2011
What OS and version are you on? Cygwin? What compiler version are you using and how are you compiling this program?
 

10 More Discussions You Might Find Interesting

1. Programming

wait system call

hi there, i had some trivial questions about this program here. i am kinda confused with these, hope you can help me to understand here. :) #include<stdio.h> #include<sys/wait.h> #include<sys/types.h> #include<unistd.h> int main(void) { int... (2 Replies)
Discussion started by: a25khan
2 Replies

2. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

3. Programming

c system call

How the c compiler differentiates the system calls and function calls? (1 Reply)
Discussion started by: rangaswamy
1 Replies

4. Shell Programming and Scripting

wait command - cat it wait for not-chile process?

Did not use 'wait' yet. How I understand by now the wait works only for child processes, started background. Is there any other way to watch completion of any, not related process (at least, a process, owned by the same user?) I need to start a background process, witch will be waiting... (2 Replies)
Discussion started by: alex_5161
2 Replies

5. Shell Programming and Scripting

system call

Hi, How to write a system calls in a script ? > cd $HOME > ls -ltr thanks in advance.. (10 Replies)
Discussion started by: hegdeshashi
10 Replies

6. Programming

C:system call

Hi I'm studing the system call. I've written a small program that return the time spent in doing some operations. Now I'd like to write one that return the time spent in user mode of a process. I'm reading that i should use the tms struct: clock_t times(struct tms *buf); struct tms {... (2 Replies)
Discussion started by: Dedalus
2 Replies

7. Shell Programming and Scripting

[Perl] Capture system call error message.

Hi, I googled a bit, but could not find the answer to my problem. But I am sure it is a common issue. I have this code: #!/bin/perl -w #-d use strict; sub remsh_test() { my $host = $_; printf "\n----\n\n"; printf "remsh to $host with system call\n"; my $result = system... (3 Replies)
Discussion started by: ejdv
3 Replies

8. Programming

need help with system call

hi everyone i wrote a system call and compiled the kernel succesfully... my system call is in a file in the kernel folder named my_syscall1.c (kernel/my_syscall1.c) the header file for this system call i added it in the folder include like this include/my_syscall1/my_syscall1.h my problem is... (2 Replies)
Discussion started by: demis87
2 Replies

9. Shell Programming and Scripting

system call

Trying to figure out a load issue with a webserver. I have traced a php script and noticed the following connect(4, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("XX.XX.XX.XX")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000035> poll(, 1, 2000) = 1 () <0.000120>... (5 Replies)
Discussion started by: rajan007
5 Replies

10. UNIX for Dummies Questions & Answers

Call a UNIX script inside another and dont wait for it

Hi I have two scripts script1.sh and script2.sh(say this script is a long running). I want to call script2.sh inside and script1.sh,but when i call script2.sh i dont want to wait for script2 to complete and want this to run in back ground and go on next commands in script 1.sh and finally at the... (2 Replies)
Discussion started by: lijjumathew
2 Replies
_LWP_PARK(2)						      BSD System Calls Manual						      _LWP_PARK(2)

NAME
_lwp_park -- wait interruptably in the kernel LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <lwp.h> int _lwp_park(const struct timespec *abstime, lwpid_t unpark, const void *hint, const void *unparkhint); DESCRIPTION
_lwp_park() can be used to synchronize access to resources among multiple light-weight processes. It causes the calling LWP to wait inter- ruptably in the kernel, until one of the following conditions is met: o The abstime argument is non-NULL, and the absolute UTC time it specifies has passed. o The LWP receives a directed signal posted using _lwp_kill(), or is elected to handle a signal on behalf of its containing process. o The LWP is awoken by another LWP in the same process that has made a call to _lwp_wakeup(). o The LWP is awoken by another LWP in the same process that has made a call to _lwp_unpark() or _lwp_unpark_all(). The preferred method to awaken an LWP sleeping as a result of a call to _lwp_park() is to make a call to _lwp_unpark(), or _lwp_unpark_all(). The _lwp_wakeup() system call is a more general facility, and requires more resources to execute. The optional hint argument specifies the address of object upon which the LWP is synchronizing. When the hint value is matched between calls to _lwp_park() and _lwp_unpark() or _lwp_unpark_all(), it may reduce the time necessary for the system to resume execution of waiting LWPs. The unpark and unparkhint arguments can be used to fold a park operation and unpark operation into a single system call. If unpark is non- zero, the system will behave as if the following call had been made before the calling thread begins to wait: _lwp_unpark(unpark, unparkhint); RETURN VALUES
_lwp_park() may return a value of 0. Otherwise, -1 is returned and errno is set to provide more information. ERRORS
[EALREADY] A request was made to wake the LWP before it began to wait in the kernel. [EINTR] The LWP has been awoken by a signal or by a call to one of the following functions: _lwp_unpark(), _lwp_unpark_all(), _lwp_wakeup(). [EINVAL] The time value specified by abstime is invalid. [ESRCH] No LWP can be found in the current process corresponding to unpark. [ETIMEDOUT] The UTC time specified by abstime has passed. SEE ALSO
_lwp_unpark(2), _lwp_unpark_all(2), _lwp_wakeup(2) HISTORY
The _lwp_park() system call first appeared in NetBSD 5.0. BSD
September 25, 2007 BSD
All times are GMT -4. The time now is 12:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy