{"action":"created","comment":{"url":"https://api.github.com/repos/AntonKozlov/eduos/pulls/comments/147430034","pull_request_review_id":72527969,"id":147430034,"diff_hunk":"@@ -183,6 +188,40 @@ static long sys_sem_free(int syscall,\n \treturn sem_free(arg1);\n }\n \n+static long sys_sleep(int syscall,\n+\tunsigned long arg1, unsigned long arg2,\n+\tunsigned long arg3, unsigned long arg4,\n+\tvoid *rest) {\n+\tint seconds = (int) arg1;\n+\n+\tirqmask_t irq = irq_disable();\n+\n+\tstruct timer tmr;\n+\n+\tnew_timer(seconds, sched_current(), &tmr);\n+\twhile(tmr.sec_left > 0) {\n+\t\tsched_wait();\n+\t\tsched();\n+\t}\n+\n+\tirq_enable(irq);\n+\n+\treturn 0;\n+}\n+\n+static long sys_uptime(int syscall,","path":"src/os/syscall.c","position":44,"original_position":44,"commit_id":"12dd228d99f6d05e46fb736eeb36ec13fa5bb705","original_commit_id":"12dd228d99f6d05e46fb736eeb36ec13fa5bb705","user":{"login":"ImmortalTurtle","id":22173703,"avatar_url":"https://avatars0.githubusercontent.com/u/22173703?v=4","gravatar_id":"","url":"https://api.github.com/users/ImmortalTurtle","html_url":"https://github.com/ImmortalTurtle","followers_url":"https://api.github.com/users/ImmortalTurtle/followers","following_url":"https://api.github.com/users/ImmortalTurtle/following{/other_user}","gists_url":"https://api.github.com/users/ImmortalTurtle/gists{/gist_id}","starred_url":"https://api.github.com/users/ImmortalTurtle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImmortalTurtle/subscriptions","organizations_url":"https://api.github.com/users/ImmortalTurtle/orgs","repos_url":"https://api.github.com/users/ImmortalTurtle/repos","events_url":"https://api.github.com/users/ImmortalTurtle/events{/privacy}","received_events_url":"https://api.github.com/users/ImmortalTurtle/received_events","type":"User","site_admin":false},"body":"Sure, now that I think of that it seems much more appropriate for `os_uptime()` to return time as long, not to print it.\r\nAnd shell function `uptime` does the printing.","created_at":"2017-10-27T14:43:31Z","updated_at":"2017-10-27T14:43:32Z","html_url":"https://github.com/AntonKozlov/eduos/pull/30#discussion_r147430034","pull_request_url":"https://api.github.com/repos/AntonKozlov/eduos/pulls/30","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/AntonKozlov/eduos/pulls/comments/147430034"},"html":{"href":"https://github.com/AntonKozlov/eduos/pull/30#discussion_r147430034"},"pull_request":{"href":"https://api.github.com/repos/AntonKozlov/eduos/pulls/30"}},"in_reply_to_id":147173250},"pull_request":{"url":"https://api.github.com/repos/AntonKozlov/eduos/pulls/30","id":148691282,"html_url":"https://github.com/AntonKozlov/eduos/pull/30","diff_url":"https://github.com/AntonKozlov/eduos/pull/30.diff","patch_url":"https://github.com/AntonKozlov/eduos/pull/30.patch","issue_url":"https://api.github.com/repos/AntonKozlov/eduos/issues/30","number":30,"state":"open","locked":false,"title":"Homework №3: Time","user":{"login":"ImmortalTurtle","id":22173703,"avatar_url":"https://avatars0.githubusercontent.com/u/22173703?v=4","gravatar_id":"","url":"https://api.github.com/users/ImmortalTurtle","html_url":"https://github.com/ImmortalTurtle","followers_url":"https://api.github.com/users/ImmortalTurtle/followers","following_url":"https://api.github.com/users/ImmortalTurtle/following{/other_user}","gists_url":"https://api.github.com/users/ImmortalTurtle/gists{/gist_id}","starred_url":"https://api.github.com/users/ImmortalTurtle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImmortalTurtle/subscriptions","organizations_url":"https://api.github.com/users/ImmortalTurtle/orgs","repos_url":"https://api.github.com/users/ImmortalTurtle/repos","events_url":"https://api.github.com/users/ImmortalTurtle/events{/privacy}","received_events_url":"https://api.github.com/users/ImmortalTurtle/received_events","type":"User","site_admin":false},"body":"Implemented `sleep()` and `uptime()`.\r\nThere is only one timer yet though. Planning to make a list of them.\r\n\r\nI'm not sure about the interface of `uptime`: right now it takes buffer as first argument. Buffer is needed to store the string representation of time. Otherwise (if we define buffer in `sys_uptime()`) at the time of executing `os_sys_write()` program catches _Segmentation fault_.\r\n\r\nThat happens if we put `os_sys_write()` in any `sys_*` function. That doesn't seem right to me, but may be that is how it's supposed to be.\r\n@AntonKozlov Do you consider this a problem? And what would you advice considering everything I've mentioned?","created_at":"2017-10-25T14:52:31Z","updated_at":"2017-10-27T14:43:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e142e9eeb7c48d7c606321945d375efd02fd8df","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/AntonKozlov/eduos/pulls/30/commits","review_comments_url":"https://api.github.com/repos/AntonKozlov/eduos/pulls/30/comments","review_comment_url":"https://api.github.com/repos/AntonKozlov/eduos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AntonKozlov/eduos/issues/30/comments","statuses_url":"https://api.github.com/repos/AntonKozlov/eduos/statuses/12dd228d99f6d05e46fb736eeb36ec13fa5bb705","head":{"label":"ImmortalTurtle:hw-3-time","ref":"hw-3-time","sha":"12dd228d99f6d05e46fb736eeb36ec13fa5bb705","user":{"login":"ImmortalTurtle","id":22173703,"avatar_url":"https://avatars0.githubusercontent.com/u/22173703?v=4","gravatar_id":"","url":"https://api.github.com/users/ImmortalTurtle","html_url":"https://github.com/ImmortalTurtle","followers_url":"https://api.github.com/users/ImmortalTurtle/followers","following_url":"https://api.github.com/users/ImmortalTurtle/following{/other_user}","gists_url":"https://api.github.com/users/ImmortalTurtle/gists{/gist_id}","starred_url":"https://api.github.com/users/ImmortalTurtle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImmortalTurtle/subscriptions","organizations_url":"https://api.github.com/users/ImmortalTurtle/orgs","repos_url":"https://api.github.com/users/ImmortalTurtle/repos","events_url":"https://api.github.com/users/ImmortalTurtle/events{/privacy}","received_events_url":"https://api.github.com/users/ImmortalTurtle/received_events","type":"User","site_admin":false},"repo":{"id":102863352,"name":"eduos","full_name":"ImmortalTurtle/eduos","owner":{"login":"ImmortalTurtle","id":22173703,"avatar_url":"https://avatars0.githubusercontent.com/u/22173703?v=4","gravatar_id":"","url":"https://api.github.com/users/ImmortalTurtle","html_url":"https://github.com/ImmortalTurtle","followers_url":"https://api.github.com/users/ImmortalTurtle/followers","following_url":"https://api.github.com/users/ImmortalTurtle/following{/other_user}","gists_url":"https://api.github.com/users/ImmortalTurtle/gists{/gist_id}","starred_url":"https://api.github.com/users/ImmortalTurtle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImmortalTurtle/subscriptions","organizations_url":"https://api.github.com/users/ImmortalTurtle/orgs","repos_url":"https://api.github.com/users/ImmortalTurtle/repos","events_url":"https://api.github.com/users/ImmortalTurtle/events{/privacy}","received_events_url":"https://api.github.com/users/ImmortalTurtle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ImmortalTurtle/eduos","description":null,"fork":true,"url":"https://api.github.com/repos/ImmortalTurtle/eduos","forks_url":"https://api.github.com/repos/ImmortalTurtle/eduos/forks","keys_url":"https://api.github.com/repos/ImmortalTurtle/eduos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ImmortalTurtle/eduos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ImmortalTurtle/eduos/teams","hooks_url":"https://api.github.com/repos/ImmortalTurtle/eduos/hooks","issue_events_url":"https://api.github.com/repos/ImmortalTurtle/eduos/issues/events{/number}","events_url":"https://api.github.com/repos/ImmortalTurtle/eduos/events","assignees_url":"https://api.github.com/repos/ImmortalTurtle/eduos/assignees{/user}","branches_url":"https://api.github.com/repos/ImmortalTurtle/eduos/branches{/branch}","tags_url":"https://api.github.com/repos/ImmortalTurtle/eduos/tags","blobs_url":"https://api.github.com/repos/ImmortalTurtle/eduos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ImmortalTurtle/eduos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ImmortalTurtle/eduos/git/refs{/sha}","trees_url":"https://api.github.com/repos/ImmortalTurtle/eduos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ImmortalTurtle/eduos/statuses/{sha}","languages_url":"https://api.github.com/repos/ImmortalTurtle/eduos/languages","stargazers_url":"https://api.github.com/repos/ImmortalTurtle/eduos/stargazers","contributors_url":"https://api.github.com/repos/ImmortalTurtle/eduos/contributors","subscribers_url":"https://api.github.com/repos/ImmortalTurtle/eduos/subscribers","subscription_url":"https://api.github.com/repos/ImmortalTurtle/eduos/subscription","commits_url":"https://api.github.com/repos/ImmortalTurtle/eduos/commits{/sha}","git_commits_url":"https://api.github.com/repos/ImmortalTurtle/eduos/git/commits{/sha}","comments_url":"https://api.github.com/repos/ImmortalTurtle/eduos/comments{/number}","issue_comment_url":"https://api.github.com/repos/ImmortalTurtle/eduos/issues/comments{/number}","contents_url":"https://api.github.com/repos/ImmortalTurtle/eduos/contents/{+path}","compare_url":"https://api.github.com/repos/ImmortalTurtle/eduos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ImmortalTurtle/eduos/merges","archive_url":"https://api.github.com/repos/ImmortalTurtle/eduos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ImmortalTurtle/eduos/downloads","issues_url":"https://api.github.com/repos/ImmortalTurtle/eduos/issues{/number}","pulls_url":"https://api.github.com/repos/ImmortalTurtle/eduos/pulls{/number}","milestones_url":"https://api.github.com/repos/ImmortalTurtle/eduos/milestones{/number}","notifications_url":"https://api.github.com/repos/ImmortalTurtle/eduos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ImmortalTurtle/eduos/labels{/name}","releases_url":"https://api.github.com/repos/ImmortalTurtle/eduos/releases{/id}","deployments_url":"https://api.github.com/repos/ImmortalTurtle/eduos/deployments","created_at":"2017-09-08T13:17:01Z","updated_at":"2017-09-08T13:17:03Z","pushed_at":"2017-10-25T14:35:18Z","git_url":"git://github.com/ImmortalTurtle/eduos.git","ssh_url":"git@github.com:ImmortalTurtle/eduos.git","clone_url":"https://github.com/ImmortalTurtle/eduos.git","svn_url":"https://github.com/ImmortalTurtle/eduos","homepage":null,"size":114,"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,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"AntonKozlov:master","ref":"master","sha":"320ef84f289ce32881998886126a5282ca4bfa78","user":{"login":"AntonKozlov","id":919084,"avatar_url":"https://avatars0.githubusercontent.com/u/919084?v=4","gravatar_id":"","url":"https://api.github.com/users/AntonKozlov","html_url":"https://github.com/AntonKozlov","followers_url":"https://api.github.com/users/AntonKozlov/followers","following_url":"https://api.github.com/users/AntonKozlov/following{/other_user}","gists_url":"https://api.github.com/users/AntonKozlov/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonKozlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonKozlov/subscriptions","organizations_url":"https://api.github.com/users/AntonKozlov/orgs","repos_url":"https://api.github.com/users/AntonKozlov/repos","events_url":"https://api.github.com/users/AntonKozlov/events{/privacy}","received_events_url":"https://api.github.com/users/AntonKozlov/received_events","type":"User","site_admin":false},"repo":{"id":102276320,"name":"eduos","full_name":"AntonKozlov/eduos","owner":{"login":"AntonKozlov","id":919084,"avatar_url":"https://avatars0.githubusercontent.com/u/919084?v=4","gravatar_id":"","url":"https://api.github.com/users/AntonKozlov","html_url":"https://github.com/AntonKozlov","followers_url":"https://api.github.com/users/AntonKozlov/followers","following_url":"https://api.github.com/users/AntonKozlov/following{/other_user}","gists_url":"https://api.github.com/users/AntonKozlov/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonKozlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonKozlov/subscriptions","organizations_url":"https://api.github.com/users/AntonKozlov/orgs","repos_url":"https://api.github.com/users/AntonKozlov/repos","events_url":"https://api.github.com/users/AntonKozlov/events{/privacy}","received_events_url":"https://api.github.com/users/AntonKozlov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AntonKozlov/eduos","description":null,"fork":false,"url":"https://api.github.com/repos/AntonKozlov/eduos","forks_url":"https://api.github.com/repos/AntonKozlov/eduos/forks","keys_url":"https://api.github.com/repos/AntonKozlov/eduos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AntonKozlov/eduos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AntonKozlov/eduos/teams","hooks_url":"https://api.github.com/repos/AntonKozlov/eduos/hooks","issue_events_url":"https://api.github.com/repos/AntonKozlov/eduos/issues/events{/number}","events_url":"https://api.github.com/repos/AntonKozlov/eduos/events","assignees_url":"https://api.github.com/repos/AntonKozlov/eduos/assignees{/user}","branches_url":"https://api.github.com/repos/AntonKozlov/eduos/branches{/branch}","tags_url":"https://api.github.com/repos/AntonKozlov/eduos/tags","blobs_url":"https://api.github.com/repos/AntonKozlov/eduos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AntonKozlov/eduos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AntonKozlov/eduos/git/refs{/sha}","trees_url":"https://api.github.com/repos/AntonKozlov/eduos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AntonKozlov/eduos/statuses/{sha}","languages_url":"https://api.github.com/repos/AntonKozlov/eduos/languages","stargazers_url":"https://api.github.com/repos/AntonKozlov/eduos/stargazers","contributors_url":"https://api.github.com/repos/AntonKozlov/eduos/contributors","subscribers_url":"https://api.github.com/repos/AntonKozlov/eduos/subscribers","subscription_url":"https://api.github.com/repos/AntonKozlov/eduos/subscription","commits_url":"https://api.github.com/repos/AntonKozlov/eduos/commits{/sha}","git_commits_url":"https://api.github.com/repos/AntonKozlov/eduos/git/commits{/sha}","comments_url":"https://api.github.com/repos/AntonKozlov/eduos/comments{/number}","issue_comment_url":"https://api.github.com/repos/AntonKozlov/eduos/issues/comments{/number}","contents_url":"https://api.github.com/repos/AntonKozlov/eduos/contents/{+path}","compare_url":"https://api.github.com/repos/AntonKozlov/eduos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AntonKozlov/eduos/merges","archive_url":"https://api.github.com/repos/AntonKozlov/eduos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AntonKozlov/eduos/downloads","issues_url":"https://api.github.com/repos/AntonKozlov/eduos/issues{/number}","pulls_url":"https://api.github.com/repos/AntonKozlov/eduos/pulls{/number}","milestones_url":"https://api.github.com/repos/AntonKozlov/eduos/milestones{/number}","notifications_url":"https://api.github.com/repos/AntonKozlov/eduos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AntonKozlov/eduos/labels{/name}","releases_url":"https://api.github.com/repos/AntonKozlov/eduos/releases{/id}","deployments_url":"https://api.github.com/repos/AntonKozlov/eduos/deployments","created_at":"2017-09-03T16:00:15Z","updated_at":"2017-09-04T09:13:52Z","pushed_at":"2017-10-25T14:52:32Z","git_url":"git://github.com/AntonKozlov/eduos.git","ssh_url":"git@github.com:AntonKozlov/eduos.git","clone_url":"https://github.com/AntonKozlov/eduos.git","svn_url":"https://github.com/AntonKozlov/eduos","homepage":null,"size":83,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":9,"forks":14,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AntonKozlov/eduos/pulls/30"},"html":{"href":"https://github.com/AntonKozlov/eduos/pull/30"},"issue":{"href":"https://api.github.com/repos/AntonKozlov/eduos/issues/30"},"comments":{"href":"https://api.github.com/repos/AntonKozlov/eduos/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/AntonKozlov/eduos/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/AntonKozlov/eduos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AntonKozlov/eduos/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/AntonKozlov/eduos/statuses/12dd228d99f6d05e46fb736eeb36ec13fa5bb705"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ImmortalTurtle"}}