From 3f357d6c5b5444c9556e347aa60aa68d6577ec85 Mon Sep 17 00:00:00 2001 From: lecorre Date: Fri, 15 Oct 2021 14:46:20 +0200 Subject: [PATCH] ajout fichiers tp4 --- TP4/.nfs00000000023a0b5b0000001f | Bin 0 -> 16312 bytes TP4/.nfs00000000023a1c8700000008 | Bin 0 -> 16512 bytes TP4/.nfs00000000023a1cc900000020 | Bin 0 -> 16368 bytes TP4/.nfs00000000023a2b8d00000009 | Bin 0 -> 16512 bytes TP4/a.out | Bin 0 -> 16312 bytes TP4/ex1.c | 31 ++++++++++++++++ TP4/ex2.c | 62 +++++++++++++++++++++++++++++++ TP4/ex3.c | 24 ++++++++++++ 8 files changed, 117 insertions(+) create mode 100755 TP4/.nfs00000000023a0b5b0000001f create mode 100755 TP4/.nfs00000000023a1c8700000008 create mode 100755 TP4/.nfs00000000023a1cc900000020 create mode 100755 TP4/.nfs00000000023a2b8d00000009 create mode 100755 TP4/a.out create mode 100644 TP4/ex1.c create mode 100644 TP4/ex2.c create mode 100644 TP4/ex3.c diff --git a/TP4/.nfs00000000023a0b5b0000001f b/TP4/.nfs00000000023a0b5b0000001f new file mode 100755 index 0000000000000000000000000000000000000000..2171e5c813c1f96c186073a7bf67dfa537798a9d GIT binary patch literal 16312 zcmeHOYiu0V6~4QP6I1Zo2?>}akRc>eLgmdnH3gSlzcNP7gT#4MB}~@dwY_D%>+a4{ z8$s*J5V1{7Bb2H_MJoN(_6Jg`fC{djzrG^4BkYxLvJLha> zCu`L92mR4G(d>8cch0$wGk3=KX72rZTW5PP5Ktns)E5-xM(P|U!ivU5P5>gRQPtr0 z7Im|lgZymGIr@kL&^mG|SdP`q&jONPJtZpO5{FiT(n3P=n@OgrK@dU3{UE<8QgGgj zd2Xkm=u7n(9Tt1ShyYL5U~D zgsw)8rxzp8kwo;bQeM9y_VZ#Z+Y3@1Bsdj;yP!A+iDK(f)rtMxe7|Z7p%CdTfVpeYwCdr2=i`(C0 zHm} z-#{kKWmt}BMMK?-prU`O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#P2To1ttOD6n2Nu=e+W*oq15l~|JT^RlkMbvM(_cbKW0(yir=@vQB0(Knlk9b zDDQd9>b6Rr@NOJ#{}B5Lj+2oqd5Twbecb-{vVq`%Qed1y#9xYh$m1{bFF|>a6?^aa z{UQ68stK_r<4zU@B>o~liVU@1{C9>Nji9_=JFIi9B~SPy4!8dUA!6~~8q%O-{5#UZ z^%ME`$OLilZC`qiko~US_KGa{JbW8n{__4l-wF~*>>O!97XD=@XzWP+GT)c|%QMtD zBpUye#80l{o8ZVq{AC~E5uP}%CMQ=Cf5Eq*bNj0Z8@D;Ql|=#Z6Rd%=+h6A6TiIXQ z>GdzkaHg`P{ktNLW*7TQJ!0=2e+^ten~RwefA1WX+DgfdGWHyea~|UYf6W!rbC`a^ pk@m>*^HgxscE{5>N7g&|pr>%DS8Qq8Udey%qmIQH9tV%8{sqBxW&8jD literal 0 HcmV?d00001 diff --git a/TP4/.nfs00000000023a1cc900000020 b/TP4/.nfs00000000023a1cc900000020 new file mode 100755 index 0000000000000000000000000000000000000000..712568e2b482b7352af5ee9d012837d6347d3e16 GIT binary patch literal 16368 zcmeHOeQX?85r22K6NlDkr%B4?t69)SGF-7f-5po==7`H%i3lzsVOYJdoJ~1cw zX`_5PF$gx4p!^oX88=38PV6FoMr;FR-z78hue3KnacdM=jd0>U7A+XLz55^z^YU(m zf9Ac^UZvl`Px)u0^olL9=uqp9EwM;bESkuUHI22kHnr{uWRihxvJ2R+X87Qo>fOCx zc#n%| z?<7IT`ChJmk%^8Z^q3el_GA75(m^K@TfzM1%e zpk-&C_47L|9X5)FxXb9T)Taa+Y&48N$Hv?`4+zhxGa5M0Kl7YY0-|=^K z;&QF}Sk3RY2%$bQZF&nYsuMq}oslCfw7ddzVdF*ku3r~~66&L9o0~0wY9o0|e1`?K}WeYtZFs<~IxiHq|C zgZ+~=XQ6&|vTl!r_RHX0Sg{`Bu1u+u?O%d|I$85Mgu52Z6)=?R0c$8r3bXa=j)S|H zAq0P2`nP-xVbgUrH?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HcmV?d00001 diff --git a/TP4/.nfs00000000023a2b8d00000009 b/TP4/.nfs00000000023a2b8d00000009 new file mode 100755 index 0000000000000000000000000000000000000000..f2fe230319c730f4931a528e5ba4f78b2475a713 GIT binary patch literal 16512 zcmeHOe{dXC9e;OiXlltNv<(IdbU`{6B-gai8mN)I{OSg;w6-b8*s|T^Hp#-}F5c~x z6a|8n&fJt})EPymjEHt9Dl?*g=!llo)FO<3v^r|};gG>HUH~y5Fhxtx@Atj$_p-O# zIp`k_Gw#dme%|-<{eIt%@4nr4J}X_MnU~RzZz7L?8j}? z4o23O>eJ8}k|xh3oJIpkj9x#CO`%z;MWL-6M=362gzSeR`kf-bQ{>0U^)PZgF(!Dl zQa}8tgAS7}&qDb9M#;~Qon+65bzs{1qMP_{>f20y+cjB?@MB!jf|2X{B=})m-fQB^ zyoKtkb{(21{)}`v#j2#!x9+M{$wYI~N##bHM_bo5ue&OmO-I+rCSbc-;J`7p;reYN zJSHZQWB-r{mC0d}!9*ssT?z+=9sQsA{le??{T;`b4xD*nQC;u&SMT1j3vI9;SSH$F zLJkj3sN;jV_kw+3q*XA)ak01pe@zu0>#k&fC-52^{)D!b?3Y*JKUjqy2VR52pH=`- zsr-)se~I51mJJ?$Oln&_J7T4DC|ZZs2i#vXLCuAS-K z*pW=9>|U!ciDe89r&CmhsZ1*x${vLU{t0>ZA}V1V%6p0LhurzjLbSX=dcyOGo-h17 zm^eo%W_`R){HJuKXM2`UT&sAzM{!JWn)dMYh>@y-hnLS~a+vk-(9lvk<>42VSor^; zD*+$-*mq8vu5!qG@0XPx-upah@$mF7L>AEM;knPK&^`PIkf3DfDuZR5OL?DPj5P|no1pZ!s(Lanmuhbg*YMx#tgmKTL8!jF*_8h65lFclxeF5m=ij#1z zU#>$A*^)69S7rL<6`i8W5O73 z%R|N(ulYQ})u-G>=-R7M)wPAi>H6hkU@oQz!Tu&`zjh14WoL~1ta13&YmLLF<{6=* z#_==mQYhe8R6uQUdZ2!J=bS&bZ>+5md`0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QLDI=$>J6 literal 0 HcmV?d00001 diff --git a/TP4/a.out b/TP4/a.out new file mode 100755 index 0000000000000000000000000000000000000000..2171e5c813c1f96c186073a7bf67dfa537798a9d GIT binary patch literal 16312 zcmeHOYiu0V6~4QP6I1Zo2?>}akRc>eLgmdnH3gSlzcNP7gT#4MB}~@dwY_D%>+a4{ z8$s*J5V1{7Bb2H_MJoN(_6Jg`fC{djzrG^4BkYxLvJLha> zCu`L92mR4G(d>8cch0$wGk3=KX72rZTW5PP5Ktns)E5-xM(P|U!ivU5P5>gRQPtr0 z7Im|lgZymGIr@kL&^mG|SdP`q&jONPJtZpO5{FiT(n3P=n@OgrK@dU3{UE<8QgGgj zd2Xkm=u7n(9Tt1ShyYL5U~D zgsw)8rxzp8kwo;bQeM9y_VZ#Z+Y3@1Bsdj;yP!A+iDK(f)rtMxe7|Z7p%CdTfVpeYwCdr2=i`(C0 zHm} z-#{kKWmt}BMMK?-prU`O?3WZ6NBWtS@tj|jyoRjq(O!7J@cTiY=fQc7V#>oC%$pHM zFZPl@b+^OQGe-ARWWvSsD?+O#UA%s;vcr^%mpVu_?c&jalGI0>223Bj88CkHG(N1pZlj%SYzug=+I))gM8KPpz6H9t;tYOkmqw7Hd_U>VO%x$3-k>~98PA>6`QKBXrgG=T zb^h0sr>Wz)BRc;QVS$NAFJu|hvt8=XCILb4}YPM-;x&Y(i z!gcU_?~pmx^b`{2Sk;pRcTC$0(ex0d(e!JI6SYf6V6Kia!ak|(H+B=Ox@;Dv%%gAL zZ62MTWd@F$uU@tnpn$Vj-%tV7#fje9rL9-|seL0&E8wg0>vx%>O)t?($Sj<-Ys`a9 zbHEoD9sxDkgU%eUx`n z82tIF$;SY?%vW4(k@};1I>(yMe^#mJ?vBDAqPsc@??=0$g^Rn)v4%H6@9bQ4iN?g_ z=}V~g=%rcq(zSo$cy<=v?JT_ATKH?UxZt!odMsex@#p;CXuN!BU-Z7{zUci?%iU+{ zFO4KZJt`RDs2_?xfHD^qpn)RI!)>#(`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2dEN3)KCO_5$Lts%iinh*aqymn@My`;Ipx4-EIj)1 zQxH}>m$CX|={TK`=-39wcrtC_2u56=$|&>IM>EP8SC1&b=wWv*$Cc}28kU7K7!p)E zoKf+_MfquuvKr`oNExBRx#0mj)(y0?4)#k52S^gxK^4~HurHkt4`wriiL5>BqPp`* z93o1_nTj@dG|)&5lX-tE*RR6y;WVmn(9SxV2NT&`GLtULSkPq?sTetMYA|K1u#QC7 zP7EPUBNV!fzM0`fKaa`&ID94NcsPU8@sKnMjtwMxP-_Nd;U}ysa0)}DRT$660ET{r z2lYRs=&>bFsnWqREV#w(A-vj;w%mJnSGA|aC{>vE`Z~J5Lr#Z3s%e+~znt}_VK2lQr zW&WB3M_m?wnTHF?yc;H3xH!qGuOLNpT=AEAtsu?QNTmH@C-^n!XwEEonKug>p!vgj^CfMzr +#include +#include +#include +#include + +static void msg1(int sig); + +int main(int argc, char const *argv[]) { + pid_t fils; + + if(!(fils=fork())) { + signal(SIGQUIT, &msg1); + signal(SIGINT, &msg1); + pause(); + pause(); + pause(); + } else { + sleep(1); + kill(fils, SIGQUIT); + kill(fils, SIGINT); + sleep(1); + kill(fils, SIGKILL); + } + + return EXIT_SUCCESS; +} + +void msg1(int sig) { + printf("JE TRAITE PAS\n"); +} \ No newline at end of file diff --git a/TP4/ex2.c b/TP4/ex2.c new file mode 100644 index 0000000..8f47247 --- /dev/null +++ b/TP4/ex2.c @@ -0,0 +1,62 @@ +#include +#include +#include +#include +#include + +static void work_finished(int sig); + + +static void save(int sig); + + +static void save_confirm(int sig); + +pid_t fils; + +int main(int argc, char const *argv[]) { + int mode = 'a'; // ou 'b' si a alors le fils n'a pas le temps de terminer + // si non a alors le fils termine son travail + + if(!(fils=fork())) { // Fils + signal(SIGUSR2, &save); + printf("Travail en cours"); + sleep(5); + if (mode != 'a') { + kill(getppid(), SIGQUIT); // Dire au père que le travail est terminé + } + + pause();// En attente d'une réponse (après l'envoi de la fin du travail) + pause();// En attente d'une réponse (après l'envoi de la confirmation de sauvegarde) + } else { // Père + signal(SIGQUIT, &work_finished); + signal(SIGINT, &save_confirm); + if (mode == 'a') { + sleep(2); + printf("Dire au fils de sauvegarder") + } else { + pause(); // En attente de la fin du travail du fils + } + pause(); // En attente de la fin de la sauvegarde du fils + } + + return EXIT_SUCCESS; +} + +void work_finished(int sig) { // SIGQUIT + printf("Le travail est terminé\n"); + kill(fils, SIGUSR2); // Dire au fils de sauvegarder +} + +void save(int sig) { // SIGUSR2 + printf("Sauvegarde des données en cours...\n"); + sleep(1); + kill(getppid(), SIGINT); // Dire au père que la sauvegarde est terminée + +} + +void save_confirm(int sig) { // SIGINT + printf("Sauvegarde terminée\n"); + sleep(.5); + kill(fils, SIGKILL); // Kill du fils +} \ No newline at end of file diff --git a/TP4/ex3.c b/TP4/ex3.c new file mode 100644 index 0000000..cd008ec --- /dev/null +++ b/TP4/ex3.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include +#include + +static void babouche() { + printf("Je recois le signal 5/5"); +} + +int main(int argc, char const *argv[]) { + pid_t pid; + signal(SIGUSR2, &babouche); + if (pid=fork()) { // PERE + kill(pid, SIGUSR2); + } else { // FILS + pause(); + } + return EXIT_SUCCESS; +} + +// La réponse a la question : +// "Est ce que le handler de signaux d'un processus est hérité par son fils?" +// Est non. \ No newline at end of file