🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.lang.c
Article #200

[Q] fork()

#200
From: Fumihiro Suzumura
Date: Wed, 06 Jan 1993 06:19
46 lines
1638 bytes
$@$O$8$a$^$7$F(J $@NkB<!w9-Eg9)Bg$G$b$J$<$+9-EgBg3X$G$9!#(J

C $@$G%W%m%0%i%`$rAH$s$G$F<!$N$h$&$JLdBj$,@8(J$@$8$^$7$?!#(J
fork() $@4X?t$G@8@.$5$l$?;R%W%m%;%9$r(J exit $@$G=*$m$&$H$7$?$H$3$m(J
$@40A4$K>C5n$5$l$:$K%>%s%S$H$J(J$@$C$F;D$C$F$7$^$$$^$7$?!#(J
$@$J$<$3$s$J$3$H$,5/$3$k$N$G$7$g$&$+!)(J

$@;29M$^$G$K%W%m%0%i%`$N0lIt$G$9!#(J

out_z_point(who)
struct client_data *who;
{
    int i,y,f[4],pid;
    char *local_buf;
    char args[3][10];

    local_buf=(char *)malloc(10*YUV_LEN);

    SendCommand(who->com);

    if (0==(pid=fork())){
	fprintf(stderr,"child prosecc\n");
	strcpy(args[0],"ip");
	strcpy(args[1],"700");
	strcpy(args[2],"10");
	execvp("ip",args);
	exit(1);
    }else if(pid > 0){
	for (i=0;i<4;i++){
	    f[i]=open(fname[i],O_RDWR|O_CREAT,0666);
	    RecvLine(10,local_buf);
	    write(f[i],local_buf,YUV_LEN*10);
	    close(f[i]);
	}
	free(local_buf);
	ReadOk(who);
    }
}

$@:G6a(J fj.lang.c $@$NOCBj$O(JC++$@$J$s$G$9$1$I!"(J
$@$h$m$7$/(J$@$*4j$$$7$^$9!#(J

--
Fumihiro Suzumura
suzumura@katana.mis.hiroshima-u.ac.jp
Technical Details
Message-ID: <SUZUMURA.93Jan6151911@katana.mis.hiroshima-u.ac.jp>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!sgiblab!adagio.panasonic.com!chorus.mei!oskgate0.mei!icspub!wnoc-kyo!hiroshima-u!grape!humpty!humpty!suzumura

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!sgiblab!adagio.panasonic.com!chorus.mei!oskgate0.mei!icspub!wnoc-kyo!hiroshima-u!grape!humpty!humpty!suzumura
From: suzumura@katana.mis.hiroshima-u.ac.jp (Fumihiro Suzumura)
Newsgroups: fj.lang.c
Subject: [Q] fork()
Message-ID: <SUZUMURA.93Jan6151911@katana.mis.hiroshima-u.ac.jp>
Date: 6 Jan 93 06:19:11 GMT
Sender: news@humpty.mis.hiroshima-u.ac.jp
Distribution: fj
Organization: Dept. of Integrate Arts and Sciences, Hiroshima University
Lines: 46
Nntp-Posting-Host: katana