Dear friends,
We are learning UNIX system programming as part of our course. I came across this simple program, which the teacher didn't explain well enough. could you please explain this program fully
And why does this program give an output of 912???
Thanks
Can somebody explain to me the differences between fork() and vfork() system calls using C programs which I can implement in the UNIX environement? (1 Reply)
if
then
echo "Syntax: $0 <sid> <COLD/HOT> <DEST>"
exit
fi
if --------------what does this mean???
echo "Syntax: $0 <sid> <COLD/HOT> <DEST>"---pls explain this as well (2 Replies)
hi all i have an example i want one help me to understand cause i tried to test it but almost fail and i don't know how can i solve this problem " the main idea to read from two files and replace something from one to another " but i don't understand why it fail all time
$ cat main.txt... (4 Replies)
I'm trying to follow a script and I see it begins with this:
if ; then
if ; then
print "blah $0 blah blah "
exit
fi
fi
What does $# mean? I found out that $1 refers to the shell environment and the last argument that was entered or passed in the previous command. I couldn't find $#... (2 Replies)
Can someone do me a favour and explain the following for me:
((r=$RANDOM%$n+1))
I know what $RANDOM does but what is % sign and what does it do with %$n+1? (2 Replies)
Hi friends! I'm learning UNIX and I have a small question. Working with Shell, i put the name of one executable (in c language) + one number and it says this:
$ gcc misterioso_4.c
$ ./misterioso_4 6
got: ,
I can not find an answer in the manual because I havent applied any variable.... (5 Replies)
Discussion started by: dakota
5 Replies
LEARN ABOUT DEBIAN
explain_waitpid_or_die
explain_waitpid_or_die(3) Library Functions Manual explain_waitpid_or_die(3)NAME
explain_waitpid_or_die - wait for process to change state and report errors
SYNOPSIS
#include <libexplain/waitpid.h>
int pid = explain_waitpid_or_die(int pid, int *status, int options);
DESCRIPTION
The explain_waitpid_or_die function is used to call the waitpid(2) system call. On failure an explanation will be printed to stderr,
obtained from explain_waitpid(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
explain_waitpid_or_die(pid, status, options);
pid The pid, exactly as to be passed to the waitpid(2) system call.
status The status, exactly as to be passed to the waitpid(2) system call.
options The options, exactly as to be passed to the waitpid(2) system call.
Returns:
This function only returns on success. On failure, prints an explanation and exits.
SEE ALSO waitpid(2)
wait for process to change state
explain_waitpid(3)
explain waitpid(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
explain_waitpid_or_die(3)