Search Results

Search: Posts Made By: nicos
Forum: Programming 02-27-2009
3
7,319
Posted By nicos
First of all, i would like to thanx you for the...
First of all, i would like to thanx you for the help.
is there an explanation why wait4 and getrusage(RUSAGE_CHILDREN,..) give me different values!!
for example, wait4=most values are in the range...
Forum: Programming 02-27-2009
3
7,319
Posted By nicos
wait4
hello again!
i have the following code,

int main()
{
struct rusage rusage;
for(int i=0;i<100;i++)
{
pid=fork();
if(pid==0)execl("","",NULL);
else if(pid>0) {
...
Forum: Programming 02-26-2009
8,091
Posted By nicos
execl-getrusage
PLZ help! I cannot put getrusage after execl, because the commands after execl executed only if execl crashes
Forum: Programming 02-26-2009
8,091
Posted By nicos
First I would like to thanx you!!! The only...
First I would like to thanx you!!!
The only place i can put getrusage in child process is before execl command, because the command after execl are executed only if execl crushes, Am i right?Do i...
Forum: Programming 02-26-2009
8,091
Posted By nicos
fork-getrusage
Hello everybody!
I wrote the following code:
...
int main()
{
pid_t pid;
for (int i=0;i<100;i++)
{
pid=fork();
if(pid==0)
...
Forum: Programming 02-20-2009
9,938
Posted By nicos
First of all, I would like to thank you for the...
First of all, I would like to thank you for the help!!!:b:
what i want to do is: to flip a bit, at the next instruction to be executed!(

ptrace(PTRACE_GETREGS,pid, NULL, &regs);//get register...
Forum: Programming 02-20-2009
9,938
Posted By nicos
ptrace-GETREGS
hello everybody!!
I want to post a question!I am confused about the explanation of ptrace command.
long ins;
ins=ptrace(PTRACE_GETREGS,pid,NULL,&regs); with this command i am able to read, for...
Forum: Programming 02-16-2009
12,790
Posted By nicos
concat const char * with char *
hello everybody!
i have aproblem! i dont know how to concatenate const char* with char
const char *buffer;
char *b;
sprintf(b,"result.txt");
strcat(buffer,b);

thanx in advance
2
1,540
Posted By nicos
Unix. Ubuntu
Unix. Ubuntu
Forum: Programming 02-10-2009
3,769
Posted By nicos
time execl
hello everybody

how can i time the execution of execl() command inside my C code?
for example, i wrote..
execl("md5sum","md5sum","myprog",NULL);
i want to count the duration of the execl...
2
1,540
Posted By nicos
time
hello everybody!
I wrote a shell script to time a program. the commands are:

time -f "%E real"

how i have to write the above command in order to get the elapsed time in millisecond precision...
Forum: Programming 01-26-2009
2,349
Posted By nicos
disassemble
hello!
does anybody know a way to disassemble a object file(ELF format) using C commands!?
thanxx
Forum: Programming 01-25-2009
9,087
Posted By nicos
ELF-string table
hello everybody!
I want to read the string table of an object file(which is in ELF format).
I get the sh_name value but i cant find a way to read the value in the string table that this index...
Forum: Programming 01-15-2009
15,849
Posted By nicos
i haven't manage to find a correct code yet.
i haven't manage to find a correct code yet.
Forum: Programming 01-15-2009
15,849
Posted By nicos
i write this code to redirect stdout and stderr ...
i write this code to redirect stdout and stderr
dup2(fd2,STDOUT_FILENO);
dup2(fd1,STDERR_FILENO);//redirection of stdout and stderr in parent
close(fd2);close(fd1);
Forum: Programming 01-14-2009
15,849
Posted By nicos
i did it, but i does not work!! can u help...
i did it, but i does not work!! can u help me?thanx anyway!
Forum: Programming 01-12-2009
15,849
Posted By nicos
redirect stdout
hello again!
i use dup2 to redirect stdout. I run what i want, now i want undo this redirection. how can i do that?

thanx in advance
Forum: Programming 01-09-2009
3,909
Posted By nicos
the snippet of code is posted below!!!any help...
the snippet of code is posted below!!!any help would be apriciated!!!:(

....
pid = fork();

errno=0;
if(pid == 0) //Target Program-Child Process
{
...
Forum: Programming 01-09-2009
3,909
Posted By nicos
first of all, i would like to thank u for your...
first of all, i would like to thank u for your interest to answer another question of mine!
i appriciate that.
in my code i have a kill command (which send a signal to a process) which is inside an...
Forum: Programming 01-09-2009
3,909
Posted By nicos
kill priority
hello everybody!
i would like to post a question. If i embed in my C code the command kill(9,pid) inside an if command. Is this command(kill) executed in any way. Both if the if is true and false....
Forum: Programming 01-05-2009
9,490
Posted By nicos
thanx
thanx a lot everybody for the help!!!:b::)
Forum: Programming 01-03-2009
9,490
Posted By nicos
ok!i understood that! but how can i solve this...
ok!i understood that! but how can i solve this problem? (beceause the same command work properly if i post it to the terminal)

thanks a lot!
Forum: Programming 01-02-2009
9,490
Posted By nicos
system() command
hello everybody!
i write this following command: system ("time (md5sum ./a.out)>log 2>&1");
as a part of a c program.
but it printf the following error:
sh: Syntax error: word unexpected...
Forum: Programming 12-30-2008
3,382
Posted By nicos
defunct vs running
hello everybody!
Is there any way to identify if a process is defunct or if it is still running? (in C).
for example: by using a signal such as SIGCHLD?
thanx in advance
Forum: Programming 12-16-2008
4,761
Posted By nicos
the problem i found is that the command...
the problem i found is that the command if(kill(pid,0)==0) is always true either if the child process finishs on time (before timer ends up) or if the process does not finish on time. ANybody help?
...
Showing results 1 to 25 of 36

 
All times are GMT -4. The time now is 10:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy