{"id":25958063,"url":"https://github.com/georgecatalin-codepractice-courses/inter-process-communication-in-c","last_synced_at":"2026-07-06T08:31:08.765Z","repository":{"id":127926871,"uuid":"373537332","full_name":"georgecatalin-CodePractice-Courses/Inter-Process-Communication-in-C","owner":"georgecatalin-CodePractice-Courses","description":"Code works that show inter-process communication (IPC) in multiple programming languages","archived":false,"fork":false,"pushed_at":"2021-07-22T10:36:13.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T18:45:00.811Z","etag":null,"topics":["c","cprogramming","interprocess-communication","ipc","socket-programming"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/georgecatalin-CodePractice-Courses.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-03T14:31:46.000Z","updated_at":"2022-07-07T16:04:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"40707d62-cea5-4bc3-abc1-5357bf5eca0a","html_url":"https://github.com/georgecatalin-CodePractice-Courses/Inter-Process-Communication-in-C","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/georgecatalin-CodePractice-Courses/Inter-Process-Communication-in-C","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgecatalin-CodePractice-Courses%2FInter-Process-Communication-in-C","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgecatalin-CodePractice-Courses%2FInter-Process-Communication-in-C/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgecatalin-CodePractice-Courses%2FInter-Process-Communication-in-C/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgecatalin-CodePractice-Courses%2FInter-Process-Communication-in-C/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georgecatalin-CodePractice-Courses","download_url":"https://codeload.github.com/georgecatalin-CodePractice-Courses/Inter-Process-Communication-in-C/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgecatalin-CodePractice-Courses%2FInter-Process-Communication-in-C/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35184015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cprogramming","interprocess-communication","ipc","socket-programming"],"created_at":"2025-03-04T17:53:31.664Z","updated_at":"2026-07-06T08:31:08.753Z","avatar_url":"https://github.com/georgecatalin-CodePractice-Courses.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Inter-Process-Communication\nInteprocess-Communication (IPC) examples in C programming language.\n\n## Theoretic aspects\nThe following Interprocess Communication mechanisms (IPC) can be used:\n* pipes\n* named pipes (FIFO)\n* sockets\n* message queues\n* shared memory\n\n### Unidirectional communication:\n* pipes\n* named pipes (FIFO)\n\n## Bidirectional communication:\n* sockets\n* message queues\n* shared memory\n\n## Communicating between processes using pipes\n### Vocabulary\nThe most commonly used functions and terms for communication between processes  are \n* pipe()\n* mkfifo()\n* write()\n* read()\n* perror()\n* fork()\n\n\n#### pipe()\nA pipe is used for connecting two processes. The output from one process can be sent as an input to another process. The flow is unidirectional, that is one process can write to the pipe, and another process can read from the pipe. Writing and reading are done in an area of main memory which is called VIRTUAL FILE.\n\nPipes have a First in First Out (FIFO) or queue structure, that means what is written first, is read first too.\nA process should not try to read from a pipe before something is written into it, otherwise it will suspend until something is written onto the pipe.\n\n* syntax\nint pipe(int arr[2]); where arr[0] is a file descriptor for the read end of the pipe and arr[1] is a file descriptor for the write end of the pipe. Function pipe() returns 0 on successful completion and otherwise -1.\n\n#### mkfifo()\nThis function creates a new FIFO special file. \n* syntax\nint mkfifo(const char *filename, mode_t permission) where filename represents the filename along with complete path, and permission represents the permission bits of the new FIFO file. The default permissions are read and write permission for owner, group and others that is 0666\n\n#### write()\nThis function is used for writing the specified file or pipe whose descriptor is supplied.\n* syntax\nwrite(int file_descriptor, const void *buf,size_t n) where it writes the n number of bytes into the file that is being pointed by the file pointer file_descriptor, from the buffer buf\n\n#### read()\nThis function reads from the specified file or pipe by the file descriptor that is supplied\n*  syntax\nread(int file_descriptor, void *buf, size_t n) where it tries to read up to a number of n bytes from a file that is being pointed by the file_descriptor. The bytes that are read are then assigned to the buffer buf.\n\n#### perror()\nThis function displays the error message indicating the error that might have occurred while invoking a function or system call. The error message is displayed to stderr, that is, the standard error output stream.\n* syntax\nvoid perror(const char *str) where the error message displayed is optionally preceded by the string 'str'  which is provided by the function.\n\n#### fork()\nThis function is used to create a new process. The newly created process is called the child process, and runs concurrently with the new process.\nAfter the execution of the fork() function, the execution of the program continues and the instruction following the fork() is executed in both the parent and the child process. If such a system call is successful , it will return a process ID of the child process in the parent process and it returns 0 in the newly created process. The fork() function returns a negative value if a child process is not created.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgecatalin-codepractice-courses%2Finter-process-communication-in-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgecatalin-codepractice-courses%2Finter-process-communication-in-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgecatalin-codepractice-courses%2Finter-process-communication-in-c/lists"}