<commit_before>#include <sys/sbunix.h>
#include<sys/syscall.h>
#include<stdlib.h>

int main(int argc, char* argv[], char* envp[]) {
	printf("hello\n");
	printf("argc is %d\n",argc);
	int i;
	for(i=0;argv[i];i++){
		printf("argv[%d]->%s\n",i,argv[i]);
	}
	for(i=0;envp[i];i++){
		printf("envp[%d]->%s\n",i,envp[i]);
	}
	int status=0;
	pid_t b=fork();
	int pid=0, pid1=0;
	if(b>0){
		printf("parent says hi\n");
		printf("parent waiting for child process %d\n",b);
		pid=waitpid(-1,&status,0);
	}
	else if(b==0){
		pid_t b1=fork();
		if(b1>0){
			printf("child_parent says hi\n");
			printf("child_parent's child %d\n",b1);
			pid1=waitpid(b1,&status,0);
			printf("child %d exited\n",pid1);
			printf("child_parent about to exit\n");
			exit(0);
		}
		else if(b1==0){
			printf("child_child says hi\n");
			printf("child_child about to exit\n");
			exit(0);
		}
	}
	printf("parent child exited %d\n",pid);<commit_msg>testcase included for both waitpid and argv, envp variable<commit_after>#include <sys/sbunix.h>
#include<sys/syscall.h>
#include<stdlib.h>

int main(int argc, char* argv[], char* envp[]) {
	printf("hello\n");
	printf("argc is %d\n",argc);
	int i;
	for(i=0;argv[i];i++){
		printf("argv[%d]->%s\n",i,argv[i]);
	}
	for(i=0;envp[i];i++){
		printf("envp[%d]->%s\n",i,envp[i]);
	}
	int status=0;
	pid_t b=fork();
	int pid=0, pid1=0;
	if(b>0){
		printf("parent says hi\n");
		printf("parent waiting for child process %d\n",b);
		pid=waitpid(-1,&status,0);
	}
	else if(b==0){
		pid_t b1=fork();
		if(b1>0){
			printf("child_parent says hi\n");
			printf("child_parent's child %d\n",b1);
			pid1=waitpid(b1,&status,0);
			printf("child_parent %d exited\n",pid1);
			printf("child_parent about to exit\n");
			exit(0);
		}
		else if(b1==0){
			pid_t b2=fork();
			if(b2>0){
				printf("child_child says hi\n");
				printf("child_child about to exit\n");
				sleep(10);
				exit(0);
			}
			else if(b2==0){
				while(1){
					yield();
				}
			}
		}
	}
	printf("parent child exited %d\n",pid);
{'fraction_non_alphanumeric': 0.23023023023023023, 'fraction_numerical': 0.026026026026026026, 'mean_word_length': 4.246719160104987, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6492376', 'n_tokens_mistral': 980, 'n_tokens_neox': 884, 'n_words': 161}