{"action":"created","comment":{"url":"https://api.github.com/repos/LambdaSchool/Processes/pulls/comments/232012918","pull_request_review_id":173110894,"id":232012918,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjAxMjkxOA==","diff_hunk":"@@ -11,6 +11,29 @@\n int main(void)\n {\n     // Your code here    \n+    int rc = fork();\n+    // ------------------------------------------------ child process starts executing here\n+    if (rc < 0) {    // fork failed; exit\n+        fprintf(stderr, \"fork failed\\n\");\n+        exit(1);\n+    } else if (rc == 0) {    // child process satisfies this branch\n+        printf(\"hello, child here (pid: %d) \\n\", (int) getpid());\n+        char *myargs[2];    // allocate an array of chars to hold 3 bytes\n+        // `strdup` duplicates the given input string \n+        myargs[0] = strdup(\"/bin/ls\");      // pass the name of the program we want to run as the first array element","path":"ex4/ex4.c","position":13,"original_position":13,"commit_id":"4e6f4a9ba642e05337f3988480148f13d679df17","original_commit_id":"4e6f4a9ba642e05337f3988480148f13d679df17","user":{"login":"kelfro","id":37552307,"node_id":"MDQ6VXNlcjM3NTUyMzA3","avatar_url":"https://avatars0.githubusercontent.com/u/37552307?v=4","gravatar_id":"","url":"https://api.github.com/users/kelfro","html_url":"https://github.com/kelfro","followers_url":"https://api.github.com/users/kelfro/followers","following_url":"https://api.github.com/users/kelfro/following{/other_user}","gists_url":"https://api.github.com/users/kelfro/gists{/gist_id}","starred_url":"https://api.github.com/users/kelfro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelfro/subscriptions","organizations_url":"https://api.github.com/users/kelfro/orgs","repos_url":"https://api.github.com/users/kelfro/repos","events_url":"https://api.github.com/users/kelfro/events{/privacy}","received_events_url":"https://api.github.com/users/kelfro/received_events","type":"User","site_admin":false},"body":"I'm pretty sure you need to #include string.h to use the strdup function correctly. I am getting a warning about this when I compile. This may be why it ends up seg faulting.","created_at":"2018-11-08T18:36:21Z","updated_at":"2018-11-08T18:36:21Z","html_url":"https://github.com/LambdaSchool/Processes/pull/283#discussion_r232012918","pull_request_url":"https://api.github.com/repos/LambdaSchool/Processes/pulls/283","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/LambdaSchool/Processes/pulls/comments/232012918"},"html":{"href":"https://github.com/LambdaSchool/Processes/pull/283#discussion_r232012918"},"pull_request":{"href":"https://api.github.com/repos/LambdaSchool/Processes/pulls/283"}}},"pull_request":{"url":"https://api.github.com/repos/LambdaSchool/Processes/pulls/283","id":229164567,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5MTY0NTY3","html_url":"https://github.com/LambdaSchool/Processes/pull/283","diff_url":"https://github.com/LambdaSchool/Processes/pull/283.diff","patch_url":"https://github.com/LambdaSchool/Processes/pull/283.patch","issue_url":"https://api.github.com/repos/LambdaSchool/Processes/issues/283","number":283,"state":"open","locked":false,"title":"Khoa Nguyen CS12 Processes","user":{"login":"munsu99","id":29219296,"node_id":"MDQ6VXNlcjI5MjE5Mjk2","avatar_url":"https://avatars2.githubusercontent.com/u/29219296?v=4","gravatar_id":"","url":"https://api.github.com/users/munsu99","html_url":"https://github.com/munsu99","followers_url":"https://api.github.com/users/munsu99/followers","following_url":"https://api.github.com/users/munsu99/following{/other_user}","gists_url":"https://api.github.com/users/munsu99/gists{/gist_id}","starred_url":"https://api.github.com/users/munsu99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munsu99/subscriptions","organizations_url":"https://api.github.com/users/munsu99/orgs","repos_url":"https://api.github.com/users/munsu99/repos","events_url":"https://api.github.com/users/munsu99/events{/privacy}","received_events_url":"https://api.github.com/users/munsu99/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-07T20:52:35Z","updated_at":"2018-11-08T18:36:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cca2c1fb33b570c596f34025abd5751ae71e6fb9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/LambdaSchool/Processes/pulls/283/commits","review_comments_url":"https://api.github.com/repos/LambdaSchool/Processes/pulls/283/comments","review_comment_url":"https://api.github.com/repos/LambdaSchool/Processes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LambdaSchool/Processes/issues/283/comments","statuses_url":"https://api.github.com/repos/LambdaSchool/Processes/statuses/4e6f4a9ba642e05337f3988480148f13d679df17","head":{"label":"munsu99:master","ref":"master","sha":"4e6f4a9ba642e05337f3988480148f13d679df17","user":{"login":"munsu99","id":29219296,"node_id":"MDQ6VXNlcjI5MjE5Mjk2","avatar_url":"https://avatars2.githubusercontent.com/u/29219296?v=4","gravatar_id":"","url":"https://api.github.com/users/munsu99","html_url":"https://github.com/munsu99","followers_url":"https://api.github.com/users/munsu99/followers","following_url":"https://api.github.com/users/munsu99/following{/other_user}","gists_url":"https://api.github.com/users/munsu99/gists{/gist_id}","starred_url":"https://api.github.com/users/munsu99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munsu99/subscriptions","organizations_url":"https://api.github.com/users/munsu99/orgs","repos_url":"https://api.github.com/users/munsu99/repos","events_url":"https://api.github.com/users/munsu99/events{/privacy}","received_events_url":"https://api.github.com/users/munsu99/received_events","type":"User","site_admin":false},"repo":{"id":156606418,"node_id":"MDEwOlJlcG9zaXRvcnkxNTY2MDY0MTg=","name":"Processes","full_name":"munsu99/Processes","private":false,"owner":{"login":"munsu99","id":29219296,"node_id":"MDQ6VXNlcjI5MjE5Mjk2","avatar_url":"https://avatars2.githubusercontent.com/u/29219296?v=4","gravatar_id":"","url":"https://api.github.com/users/munsu99","html_url":"https://github.com/munsu99","followers_url":"https://api.github.com/users/munsu99/followers","following_url":"https://api.github.com/users/munsu99/following{/other_user}","gists_url":"https://api.github.com/users/munsu99/gists{/gist_id}","starred_url":"https://api.github.com/users/munsu99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munsu99/subscriptions","organizations_url":"https://api.github.com/users/munsu99/orgs","repos_url":"https://api.github.com/users/munsu99/repos","events_url":"https://api.github.com/users/munsu99/events{/privacy}","received_events_url":"https://api.github.com/users/munsu99/received_events","type":"User","site_admin":false},"html_url":"https://github.com/munsu99/Processes","description":null,"fork":true,"url":"https://api.github.com/repos/munsu99/Processes","forks_url":"https://api.github.com/repos/munsu99/Processes/forks","keys_url":"https://api.github.com/repos/munsu99/Processes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/munsu99/Processes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/munsu99/Processes/teams","hooks_url":"https://api.github.com/repos/munsu99/Processes/hooks","issue_events_url":"https://api.github.com/repos/munsu99/Processes/issues/events{/number}","events_url":"https://api.github.com/repos/munsu99/Processes/events","assignees_url":"https://api.github.com/repos/munsu99/Processes/assignees{/user}","branches_url":"https://api.github.com/repos/munsu99/Processes/branches{/branch}","tags_url":"https://api.github.com/repos/munsu99/Processes/tags","blobs_url":"https://api.github.com/repos/munsu99/Processes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/munsu99/Processes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/munsu99/Processes/git/refs{/sha}","trees_url":"https://api.github.com/repos/munsu99/Processes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/munsu99/Processes/statuses/{sha}","languages_url":"https://api.github.com/repos/munsu99/Processes/languages","stargazers_url":"https://api.github.com/repos/munsu99/Processes/stargazers","contributors_url":"https://api.github.com/repos/munsu99/Processes/contributors","subscribers_url":"https://api.github.com/repos/munsu99/Processes/subscribers","subscription_url":"https://api.github.com/repos/munsu99/Processes/subscription","commits_url":"https://api.github.com/repos/munsu99/Processes/commits{/sha}","git_commits_url":"https://api.github.com/repos/munsu99/Processes/git/commits{/sha}","comments_url":"https://api.github.com/repos/munsu99/Processes/comments{/number}","issue_comment_url":"https://api.github.com/repos/munsu99/Processes/issues/comments{/number}","contents_url":"https://api.github.com/repos/munsu99/Processes/contents/{+path}","compare_url":"https://api.github.com/repos/munsu99/Processes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/munsu99/Processes/merges","archive_url":"https://api.github.com/repos/munsu99/Processes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/munsu99/Processes/downloads","issues_url":"https://api.github.com/repos/munsu99/Processes/issues{/number}","pulls_url":"https://api.github.com/repos/munsu99/Processes/pulls{/number}","milestones_url":"https://api.github.com/repos/munsu99/Processes/milestones{/number}","notifications_url":"https://api.github.com/repos/munsu99/Processes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/munsu99/Processes/labels{/name}","releases_url":"https://api.github.com/repos/munsu99/Processes/releases{/id}","deployments_url":"https://api.github.com/repos/munsu99/Processes/deployments","created_at":"2018-11-07T20:49:21Z","updated_at":"2018-11-08T16:25:28Z","pushed_at":"2018-11-08T16:25:26Z","git_url":"git://github.com/munsu99/Processes.git","ssh_url":"git@github.com:munsu99/Processes.git","clone_url":"https://github.com/munsu99/Processes.git","svn_url":"https://github.com/munsu99/Processes","homepage":null,"size":60,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"LambdaSchool:master","ref":"master","sha":"df8b10a1b1ad39fbfb3a2ab597bac5d0e86536d9","user":{"login":"LambdaSchool","id":24780114,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzgwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/24780114?v=4","gravatar_id":"","url":"https://api.github.com/users/LambdaSchool","html_url":"https://github.com/LambdaSchool","followers_url":"https://api.github.com/users/LambdaSchool/followers","following_url":"https://api.github.com/users/LambdaSchool/following{/other_user}","gists_url":"https://api.github.com/users/LambdaSchool/gists{/gist_id}","starred_url":"https://api.github.com/users/LambdaSchool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LambdaSchool/subscriptions","organizations_url":"https://api.github.com/users/LambdaSchool/orgs","repos_url":"https://api.github.com/users/LambdaSchool/repos","events_url":"https://api.github.com/users/LambdaSchool/events{/privacy}","received_events_url":"https://api.github.com/users/LambdaSchool/received_events","type":"Organization","site_admin":false},"repo":{"id":106137758,"node_id":"MDEwOlJlcG9zaXRvcnkxMDYxMzc3NTg=","name":"Processes","full_name":"LambdaSchool/Processes","private":false,"owner":{"login":"LambdaSchool","id":24780114,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzgwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/24780114?v=4","gravatar_id":"","url":"https://api.github.com/users/LambdaSchool","html_url":"https://github.com/LambdaSchool","followers_url":"https://api.github.com/users/LambdaSchool/followers","following_url":"https://api.github.com/users/LambdaSchool/following{/other_user}","gists_url":"https://api.github.com/users/LambdaSchool/gists{/gist_id}","starred_url":"https://api.github.com/users/LambdaSchool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LambdaSchool/subscriptions","organizations_url":"https://api.github.com/users/LambdaSchool/orgs","repos_url":"https://api.github.com/users/LambdaSchool/repos","events_url":"https://api.github.com/users/LambdaSchool/events{/privacy}","received_events_url":"https://api.github.com/users/LambdaSchool/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/LambdaSchool/Processes","description":null,"fork":false,"url":"https://api.github.com/repos/LambdaSchool/Processes","forks_url":"https://api.github.com/repos/LambdaSchool/Processes/forks","keys_url":"https://api.github.com/repos/LambdaSchool/Processes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LambdaSchool/Processes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LambdaSchool/Processes/teams","hooks_url":"https://api.github.com/repos/LambdaSchool/Processes/hooks","issue_events_url":"https://api.github.com/repos/LambdaSchool/Processes/issues/events{/number}","events_url":"https://api.github.com/repos/LambdaSchool/Processes/events","assignees_url":"https://api.github.com/repos/LambdaSchool/Processes/assignees{/user}","branches_url":"https://api.github.com/repos/LambdaSchool/Processes/branches{/branch}","tags_url":"https://api.github.com/repos/LambdaSchool/Processes/tags","blobs_url":"https://api.github.com/repos/LambdaSchool/Processes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LambdaSchool/Processes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LambdaSchool/Processes/git/refs{/sha}","trees_url":"https://api.github.com/repos/LambdaSchool/Processes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LambdaSchool/Processes/statuses/{sha}","languages_url":"https://api.github.com/repos/LambdaSchool/Processes/languages","stargazers_url":"https://api.github.com/repos/LambdaSchool/Processes/stargazers","contributors_url":"https://api.github.com/repos/LambdaSchool/Processes/contributors","subscribers_url":"https://api.github.com/repos/LambdaSchool/Processes/subscribers","subscription_url":"https://api.github.com/repos/LambdaSchool/Processes/subscription","commits_url":"https://api.github.com/repos/LambdaSchool/Processes/commits{/sha}","git_commits_url":"https://api.github.com/repos/LambdaSchool/Processes/git/commits{/sha}","comments_url":"https://api.github.com/repos/LambdaSchool/Processes/comments{/number}","issue_comment_url":"https://api.github.com/repos/LambdaSchool/Processes/issues/comments{/number}","contents_url":"https://api.github.com/repos/LambdaSchool/Processes/contents/{+path}","compare_url":"https://api.github.com/repos/LambdaSchool/Processes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LambdaSchool/Processes/merges","archive_url":"https://api.github.com/repos/LambdaSchool/Processes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LambdaSchool/Processes/downloads","issues_url":"https://api.github.com/repos/LambdaSchool/Processes/issues{/number}","pulls_url":"https://api.github.com/repos/LambdaSchool/Processes/pulls{/number}","milestones_url":"https://api.github.com/repos/LambdaSchool/Processes/milestones{/number}","notifications_url":"https://api.github.com/repos/LambdaSchool/Processes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LambdaSchool/Processes/labels{/name}","releases_url":"https://api.github.com/repos/LambdaSchool/Processes/releases{/id}","deployments_url":"https://api.github.com/repos/LambdaSchool/Processes/deployments","created_at":"2017-10-07T23:41:45Z","updated_at":"2018-08-16T13:20:53Z","pushed_at":"2018-11-08T18:19:48Z","git_url":"git://github.com/LambdaSchool/Processes.git","ssh_url":"git@github.com:LambdaSchool/Processes.git","clone_url":"https://github.com/LambdaSchool/Processes.git","svn_url":"https://github.com/LambdaSchool/Processes","homepage":null,"size":47,"stargazers_count":3,"watchers_count":3,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":378,"mirror_url":null,"archived":false,"open_issues_count":270,"license":null,"forks":378,"open_issues":270,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LambdaSchool/Processes/pulls/283"},"html":{"href":"https://github.com/LambdaSchool/Processes/pull/283"},"issue":{"href":"https://api.github.com/repos/LambdaSchool/Processes/issues/283"},"comments":{"href":"https://api.github.com/repos/LambdaSchool/Processes/issues/283/comments"},"review_comments":{"href":"https://api.github.com/repos/LambdaSchool/Processes/pulls/283/comments"},"review_comment":{"href":"https://api.github.com/repos/LambdaSchool/Processes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LambdaSchool/Processes/pulls/283/commits"},"statuses":{"href":"https://api.github.com/repos/LambdaSchool/Processes/statuses/4e6f4a9ba642e05337f3988480148f13d679df17"}},"author_association":"NONE"}}
{"actor":{"display_login":"kelfro"}}