(1) 自行编写一个C语言程序,在主进程中生成两个子进程,在子进程1中将“1111111111”、“2222222222”、……、“9999999999”写入文件myfile,在子进程2中将“AAAAAAAAAA”、“BBBBBBBBBB”、……、“ZZZZZZZZZZ”写入文件myfile。
源代码:
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
int main(){
pid_t cid,ppid;
char buf;
int in,i,j;
if(cid=fork()!=-1)
{
in=open("myfile",O_RDWR|O_CREAT,S_IRUSR|S_IWUSR);
for (i=0;i<9;i++){