Hello!
I am working on a server where I should have 4 (resident)processes, one of them being "the father" of the others, so I do 3 forks. The problem that I have is that I do an accept (for sockets) in the "father" process and I want to transmit the job to one of the processes "child" with... (3 Replies)
Hi!
Can someone explain me exactly this technique? Why a process (PARENT) creates a copy of itself with FORK (CHILD)? What's the reason of this behaviour? Sorry, but I cannot understand the logic behind it.
Thanks. (4 Replies)
On my *nix box, I have a telegram program.
When I go like
tel person "la\nla\nla\n"
the person sees
"la\nla\nla\n"
However, when I have a program that forks and execs tel like:
pid = fork();
if (pid < 0) {
perror("fork failed");
exit(EXIT_FAILURE);
}
if (pid == 0) {... (7 Replies)
Hi,
I need to find/implement an application that FTPs (puts) all new files in a certain directory to an external storage unit. This application should check for new files every 10 seconds (leaving the FTP connection open in between the 10 seconds).
The easiest way would be if there are... (2 Replies)
I need to ssh to a remote server and run my script there. This is my script.
$ssh = "ssh username@host";
$cmd = "$ssh 'cd <my dir> && < sudo Run_exe>'";
my $pid = fork;
if ($pid == 0){
exec $cmd;
}
When I run this I get:
pccons_getchar: got r == 0 (1 Reply)
Hi All,
In my program i am handling SIGHUP signal. In the handler i fork and then exec on child process same binary file which is running. Parent process will die after 10 mins.
Now my child process which was exec with same binary file is not receiving SIGHUP signal. Below is the progran code:... (6 Replies)
Hello everybody.I want to make clear that i am not going to ask from anybody to build my asignement but i have a big problem. I can't seem to find anywhere ONE good example on C about what i am trying to do:wall:.I think it is simple. All i ask is one example, even a link is fine.
So, i want to... (1 Reply)
Hello... And thanks in advance for any help anyone can offer me on my question! I've been doing a lot of reading to try and find my answer... But I haven't had any luck
What I'm trying to understand is where a child process inherits global environment variables from? I understand the exec()... (2 Replies)
Discussion started by: bodisha
2 Replies
LEARN ABOUT MINIX
priv_set
priv_set(3C) Standard C Library Functions priv_set(3C)NAME
priv_set, priv_ineffect - change privilege sets and check whether privileges are set
SYNOPSIS
#include <priv.h>
int priv_set(priv_op_t op, priv_ptype_t which, ...);
boolean_t priv_ineffect(const char *priv);
DESCRIPTION
The priv_set() function is a convenient wrapper for the setppriv(2) function. It takes three or more arguments. The operation argument, op,
can be one of PRIV_OFF, PRIV_ON or PRIV_SET. The which argument is the name of the privilege set to change. The third argument is a list of
zero or more privilege names terminated with a null pointer. If which is the special pseudo set PRIV_ALLSETS, the operation should be
applied to all privilege sets.
The specified privileges are converted to a binary privilege set and setppriv() is called with the same op and which arguments. When
called with PRIV_ALLSETS as the value for the which argument, setppriv() is called for each set in turn, aborting on the first failed call.
The priv_ineffect() function is a conventient wrapper for the getppriv(2) function. The priv argument specifies the name of the privilege
for which this function checks its presence in the effective set.
RETURN VALUES
Upon successful completion, priv_set() return 0. Otherwise, -1 is returned and errno is set to indicate the error.
If priv is a valid privilege that is a member of the effective set, priv_ineffect() returns B_TRUE. Otherwise, it returns B_FALSE and sets
errno to incicate the error.
ERRORS
The priv_set() function will fail if:
EINVAL The value of op or which is out of range.
ENOMEM Insufficient memory was allocated.
EPERM The application attempted to add privileges to PRIV_LIMIT or PRIV_PERMITTED, or the application attempted to add privileges
to PRIV_INHERITABLE or PRIV_EFFECTIVE that were not in PRIV_PERMITTED.
The priv_ineffect() function will fail if:
EINVAL The privilege specified by priv is invalid.
ENOMEM Insufficient memory was allocated.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO setppriv(2), priv_str_to_set(3C), attributes(5), privileges(5)SunOS 5.10 25 Sep 2003 priv_set(3C)