{"id":20635984,"url":"https://github.com/achrafelkhnissi/minitalk","last_synced_at":"2026-03-12T21:00:53.600Z","repository":{"id":107286025,"uuid":"499220182","full_name":"achrafelkhnissi/minitalk","owner":"achrafelkhnissi","description":"The purpose of this project is to code a small data exchange program﻿using UNIX signals.","archived":false,"fork":false,"pushed_at":"2023-03-13T08:08:36.000Z","size":83,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T21:34:54.276Z","etag":null,"topics":["1337school","42cursus","42projects","42school","minitalk","minitalk42"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/in/achrafelkhnissi/","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/achrafelkhnissi.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,"zenodo":null}},"created_at":"2022-06-02T17:00:43.000Z","updated_at":"2025-03-24T23:48:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"13d295d3-fc64-4650-8f18-9f3c11087a98","html_url":"https://github.com/achrafelkhnissi/minitalk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/achrafelkhnissi/minitalk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achrafelkhnissi%2Fminitalk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achrafelkhnissi%2Fminitalk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achrafelkhnissi%2Fminitalk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achrafelkhnissi%2Fminitalk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/achrafelkhnissi","download_url":"https://codeload.github.com/achrafelkhnissi/minitalk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/achrafelkhnissi%2Fminitalk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30444283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T20:23:30.529Z","status":"ssl_error","status_checked_at":"2026-03-12T20:23:14.027Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["1337school","42cursus","42projects","42school","minitalk","minitalk42"],"created_at":"2024-11-16T15:08:43.532Z","updated_at":"2026-03-12T21:00:53.594Z","avatar_url":"https://github.com/achrafelkhnissi.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n\t\t\t\t███╗   ███╗██╗███╗   ██╗██╗████████╗ █████╗ ██╗     ██╗██╗\t\t\t\n\t\t\t\t██╔████╔██║██║██╔██╗ ██║██║   ██║   ███████║██║     █████╔╝\t\t\t \n\t\t\t\t██║╚██╔╝██║██║██║╚██╗██║██║   ██║   ██╔══██║██║     ██╔═██╗\t\t\t \n\t\t\t\t██║ ╚═╝ ██║██║██║ ╚████║██║   ██║   ██║  ██║███████╗██║  ██╗\t\t\t\n\t\t\t\t╚═╝     ╚═╝╚═╝╚═╝  ╚═══╝╚═╝   ╚═╝   ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝\t\t\t\n\n\t\t\t\t\tPID: 0000\t\t\tBy: ael-khni\n\t\t\t\t⊱ ────────────────────── {.⋅ ✯ ⋅.} ─────────────────────── ⊰\t\n```\n\n\u003ch1 align=\"center\"\u003e\n\t42cursus' minitalk \n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cb\u003e\u003ci\u003eDevelopment repo for 42cursus' ft_printf project\u003c/i\u003e\u003c/b\u003e\u003cbr\u003e\n\tFor further information about 42cursus and its projects, please refer to \u003ca href=\"https://github.com/achrafelkhnissi/1337/blob/master/42curses/README.md\"\u003e\u003cb\u003e42cursus repo\u003c/b\u003e\u003c/a\u003e.\n\u003c/p\u003e\n\n\n\u003ch3 align=\"center\"\u003e\n\t\u003ca href=\"#about\"\u003eAbout\u003c/a\u003e\n\t\u003cspan\u003e · \u003c/span\u003e\n\t\u003ca href=\"#intro-to-signals\"\u003eSignals\u003c/a\u003e\n\t\u003cspan\u003e · \u003c/span\u003e\n\t\u003ca href=\"#resources\"\u003eResources\u003c/a\u003e\n\u003c/h3\u003e\n\n---\n\n## Table of content\n\n\u003e The purpose of this project is to code a small data exchange program using Unix signals.\n\nCreate a communication program - in C - in the form of a client and server. The server is the first one to be launched, having to display its PID after. The client will take as parameters the server PID and the string to be sent. Once the string has been received by the server, this one should display it.\n\nThis communication should only be done using Unix signals. Only two signals can be used SIGUSR1 and SIGUSR2. The executable files are named client and server.\n\n1. [Unix Processes](https://github.com/achrafelkhnissi/minitalk/tree/master/README/unix_processes.md)\n2. [Unix Signals](https://github.com/achrafelkhnissi/minitalk/tree/master/README/unix_signals.md)\n3. [Used Function \u0026 their brief explaination!](https://github.com/achrafelkhnissi/minitalk/tree/master/README/used_funcitons.md)\n\t- [`signal()`](https://github.com/achrafelkhnissi/1337/minitalk/tree/master/README/used_funcitons.md#signal)\n\t- [`sigaction()`](https://github.com/achrafelkhnissi/minitalk/tree/master/README/used_funcitons.md#sigaction)\n\t- [`struct sigaction`](https://github.com/achrafelkhnissi/minitalk/tree/master/README/used_funcitons.md#struct-sigaction)\n\t- [`sigemptyset()`](https://github.com/achrafelkhnissi/minitalk/tree/master/README/used_funcitons.md#sigemptyset)\n\t- [`sigaddset()`](https://github.com/achrafelkhnissi/minitalk/tree/master/README/used_funcitons.md#sigaddset)\n\t- [`getpid()`](https://github.com/achrafelkhnissi/minitalk/tree/master/README/used_funcitons.md#getpid)\n\t- [`kill()`](https://github.com/achrafelkhnissi/minitalk/tree/master/README/used_funcitons.md#kill)\n\t- [`pause()`](https://github.com/achrafelkhnissi/minitalk/tree/master/README/used_funcitons.md#pause)\n\t- [`sleep()`](https://github.com/achrafelkhnissi/minitalk/tree/master/README/used_funcitons.md#sleep)\n\t- [`usleep()`](https://github.com/achrafelkhnissi/minitalk/tree/master/README/used_funcitons.md#usleep)\n4. [minitalk explained!](https://github.com/achrafelkhnissi/minitalk/tree/master/README/minitalk.md)\n\t- [STEP 1: Make server receive a signal from client](https://github.com/achrafelkhnissi/minitalk/tree/master/README/minitalk.md#step-1-make-server-receive-a-signal-from-client)\n\t- [STEP 2: Convert ASCII character to Binary character](https://github.com/achrafelkhnissi/minitalk/tree/master/README/minitalk.md#step-2-convert-ascii-character-to-binary-character)\n\t- [STEP 3: Convert Binary character to ASCII character](https://github.com/achrafelkhnissi/minitalk/tree/master/README/minitalk.md#step-3-convert-binary-character-to-ascii-character)\n\t- [STEP 4: Sending a string from client to server](https://github.com/achrafelkhnissi/minitalk/tree/master/README/minitalk.md#step-4-sending-a-string-from-client-to-server)\n\t- [LINKS](https://github.com/achrafelkhnissi/minitalk/tree/master/README/minitalk.md#links)\n## Project Information\n\n### About\n\nThe purpose of this project is to code a small data exchange program using *UNIX signals*. \\\nKeep in mind:\n- You have to handle errors sensitively. In no way can your program quit unexpectedly (Segmentation fault, bus error, double free, etc).\n- Your program cannot have memory leaks.\n- You can use one global variable but it must be justified.\n\n### Mandatory\n\n- Produce `server` \u0026 `client` executables\n- `client` must communicate a string passed as a parameter to `server` *(referenced by its process ID)* which then displays it\n- Use `SIGUSR1` \u0026 `SIGUSR2` signals **ONLY**\n\n### Bonus\n\n- Add reception acknowledgement system\n- Support Unicode characters\n\n### Allowed Functions (manual)\n- [`write`](https://man7.org/linux/man-pages/man2/write.2.html)\n- [`ft_printf`](https://github.com/achrafelkhnissi/1337/tree/master/42curses/ft_printf) and any equivalent YOU coded\n- [`signal`](https://man7.org/linux/man-pages/man2/signal.2.html)\n- [`sigemptyset \u0026 sigaddset`](https://man7.org/linux/man-pages/man3/sigsetops.3.html)\n- [`sigaction`](https://man7.org/linux/man-pages/man2/sigaction.2.html)\n- [`kill`](https://man7.org/linux/man-pages/man2/kill.2.html)\n- [`getpid`](https://man7.org/linux/man-pages/man2/getpid.2.html)\n- [`malloc`](https://man7.org/linux/man-pages/man3/free.3.html)\n- [`free`](https://man7.org/linux/man-pages/man3/free.3.html)\n- [`pause`](https://man7.org/linux/man-pages/man2/pause.2.html)\n- [`sleep`](https://man7.org/linux/man-pages/man3/sleep.3.html)\n- [`usleep`](https://man7.org/linux/man-pages/man3/usleep.3.html)\n- [`exit`](https://man7.org/linux/man-pages/man3/exit.3.html)\n\n## Intro to signals\n\nSignals are standardized messages sent to a running program to trigger specific behavior, such as quitting or error handling. They are a limited form of inter-process communication (IPC), typically used in POSIX-compliant operating systems. \\\nWhen a signal is sent. the operating system interrupts the target process normal flow of executing to deliver the signal. Execution can be interrupted during any non-atomic instruction. If the process has previously registered a signal handler,  that routine is executed. Otherwise, the default signal handler is executed. \\\nA signal is an event generated by the UNIX and Linux systems in response to some condition. Upon receipt of a signal, a process may take action. \\\nA signal is just like an interrupt; when it is generated at the user level, a call is made to the kernel of the OS, which then acts accordingly. \\\nThere are two types of signals:\n- __Maskable__: signals which can be changed or ignored by the user (e.g., Ctrl+C)\n- __None-Maskable__: Signals which cannot be changed or ignored by the user. These typically occurs when the user is signaled for non-recoverable hardware errors.\n\n#### Handling signals\nSignal handlers can be installed with the [`signal(2)`](https://man7.org/linux/man-pages/man7/signal.7.html) or [`sigaction(2)`](https://man7.org/linux/man-pages/man2/sigaction.2.html) system calls. If a signal handler is not installer for a particular signal, the fefault handler is user. Otherwise the signal is intercepted and the signal handler is invoked. \\\nThe signals are defined in the header file signal.h as a macro constant. Signal name has started with a “SIG” and followed by a short description of the signal. So, every signal has a unique numeric value. Your program should always use the name of the signals, not the signals number. The reason is signal number can differ according to system but meaning of names will be standard. \\\nThe macro NSIG is the total number of signal defined. The value of NSIG is one greater than the total number of signal defined (All signal numbers are allocated consecutively).\n\nThe following is a list of all signals with names as in the include file `\u003csignal.h\u003e`:\n\n```\n    No    Name         Default Action       Description\n     1     SIGHUP       terminate process    terminal line hangup\n     2     SIGINT       terminate process    interrupt program\n     3     SIGQUIT      create core image    quit program\n     4     SIGILL       create core image    illegal instruction\n     5     SIGTRAP      create core image    trace trap\n     6     SIGABRT      create core image    abort program (formerly SIGIOT)\n     7     SIGEMT       create core image    emulate instruction executed\n     8     SIGFPE       create core image    floating-point exception\n     9     SIGKILL      terminate process    kill program\n     10    SIGBUS       create core image    bus error\n     11    SIGSEGV      create core image    segmentation violation\n     12    SIGSYS       create core image    non-existent system call invoked\n     13    SIGPIPE      terminate process    write on a pipe with no reader\n     14    SIGALRM      terminate process    real-time timer expired\n     15    SIGTERM      terminate process    software termination signal\n     16    SIGURG       discard signal       urgent condition present on socket\n     17    SIGSTOP      stop process         stop (cannot be caught or ignored)\n     18    SIGTSTP      stop process         stop signal generated from keyboard\n     19    SIGCONT      discard signal       continue after stop\n     20    SIGCHLD      discard signal       child status has changed\n     21    SIGTTIN      stop process         background read attempted from control terminal\n     22    SIGTTOU      stop process         background write attempted to control terminal\n     23    SIGIO        discard signal       I/O is possible on a descriptor (see fcntl(2))\n     24    SIGXCPU      terminate process    cpu time limit exceeded (see setrlimit(2))\n     25    SIGXFSZ      terminate process    file size limit exceeded (see setrlimit(2))\n     26    SIGVTALRM    terminate process    virtual time alarm (see setitimer(2))\n     27    SIGPROF      terminate process    profiling timer alarm (see setitimer(2))\n     28    SIGWINCH     discard signal       Window size change\n     29    SIGINFO      discard signal       status request from keyboard\n     30    SIGUSR1      terminate process    User defined signal 1\n     31    SIGUSR2      terminate process    User defined signal 2\n```\n\n\n## Resources\n- [Signal (IPC)](https://en.wikipedia.org/wiki/Signal_(IPC))\n- [Process (computing)](https://en.wikipedia.org/wiki/Process_(computing))\n- [Thread (computing)](https://en.wikipedia.org/wiki/Thread_(computing))\n- [How to use signal handlers in C](https://linuxhint.com/signal_handlers_c_programming_language/)\n- [signals](https://people.kth.se/~johanmon/ose/assignments/signals.pdf)\n- [How to Write Advanced Signal Handlers in UNIX](https://www.oracle.com/technical-resources/articles/it-infrastructure/dev-signal-handlers-studio.html)\n- [sigaction() - IBM docs](https://www.ibm.com/docs/en/i/7.2?topic=ssw_ibm_i_72/apis/sigactn.htm)\n- [What is the difference between sigaction and signal?](https://stackoverflow.com/questions/231912/what-is-the-difference-between-sigaction-and-signal)\n- [What is sigaction in C?](https://jameshfisher.com/2017/01/13/c-sigaction/)\n\n\n## Author\n\n- [`@achrafelkhnissi`]() | Software Engineer Student\n\n    \u003e Reach out to me if you need any help or have any questions.\n\n\t\u003ca href=\"mailto:achraf.elkhnissi@icloud.com\"\u003e\n\t\t\u003cimg alt=\"Feel free to contact me\" src=\"https://img.shields.io/badge/-Ask_me_anything-blue?style=flat\u0026logo=Gmail\u0026logoColor=white\u0026link=mailto:achraf.elkhnissi@gmail.com\u0026color=3d85c6\" /\u003e\n\t\u003c/a\u003e\n\t\u003cspan\u003e * \u003c/span\u003e\n    \u003ca href=\"https://www.linkedin.com/in/achrafelkhnissi/\"\u003e\n        \u003cimg alt=\"Linkedin Profile\" src=\"https://img.shields.io/badge/-Linkedin-0072b1?style=flat\u0026logo=Linkedin\u0026logoColor=white\u0026link=https://www.linkedin.com/in/achrafelkhnissi/\" /\u003e\n    \u003c/a\u003e\n    \u003cspan\u003e * \u003c/span\u003e\n    \u003ca href=\"https://twitter.com/suprivada\"\u003e\n        \u003cimg alt=\"Twitter Profile\" src=\"https://img.shields.io/badge/-Twitter-0072b1?style=flat\u0026logo=Twitter\u0026logoColor=white\u0026link=https://www.linkedin.com/in/achrafelkhnissi/\u0026color=1DA1F2\" /\u003e\n    \u003c/a\u003e\n    \u003cspan\u003e * \u003c/span\u003e\n    \u003ca href=\"https://www.linkedin.com/in/achrafelkhnissi/\"\u003e\n        \u003cimg alt=\"Discord Profile\" src=\"https://img.shields.io/badge/-Discord-0072b1?style=flat\u0026logo=Discord\u0026logoColor=white\u0026link=https://www.linkedin.com/in/achrafelkhnissi/\u0026color=7289da\" /\u003e\n    \u003c/a\u003e\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fachrafelkhnissi%2Fminitalk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fachrafelkhnissi%2Fminitalk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fachrafelkhnissi%2Fminitalk/lists"}