Здравствуйте! У меня такая проблема: Из одной программы я вызываю другую. Вот из которой вызываю:
#include <unistd.h>
#include <stdio.h> int main (void) {
char *arg[] = { "/home/pasha/Документы/1", 0 };
/* fork, and exec within child process */
if (fork() == 0)
{
printf("In child process:\n");
execv(arg[0], arg);
printf("I will never be called\n");
}
printf("Execution continues in parent process\n"); }
#include <termios.h>
#include <sys/ioctl.h>
#include <signal.h>
#include <stdlib.h>
#include <curses.h>
#include <time.h>
#include <sys/time.h>
void alarm_handler()
{
int i;
time_t tp;
char *s;
tp = time(NULL);
s = ctime(&tp);
wprintw(stdscr,"%s",s);
refresh();
}
int main(int argc, char * argv[])
{
struct itimerval delay;
int ret;
int y;
if(argc>1)
y=(int)argv[1];
signal (SIGALRM, alarm_handler);
delay.it_value.tv_sec = 3;
delay.it_value.tv_usec = 0;
delay.it_interval.tv_sec = 1;
delay.it_interval.tv_usec = 0;
ret = setitimer (ITIMER_REAL, &delay, NULL);
initscr();
curs_set(TRUE);
while(1)
{
move(3,1);
pause();
}
endwin();
exit(EXIT_SUCCESS);
}