From 683e426f2cdf0a5e3dfbb0d1f705021e670bd578 Mon Sep 17 00:00:00 2001 From: 10195501441 <10195501441@stu.ecnu.edu.com> Date: Thu, 11 Mar 2021 22:09:31 +0800 Subject: [PATCH] adjust the format --- yeeshell | Bin 23488 -> 32624 bytes yeeshell.c | 21 +++++++++++++++++---- yeeshell.h | 3 +++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/yeeshell b/yeeshell index ba5008ebd197ad0d504ada7f333cf83206ac7c85..84f66a63d4e9fcf4b8492cc24ef9c75427c8a9d9 100755 GIT binary patch delta 9870 zcmZ`<33yZ2mA>yuS9(v9Wm)pR3hZEPzzbUl7*Gj|Spp;hYRn>JOSS~E88;ks zKlYbDm9Copr!PM~d`N!FE*IK|_c~Xbr4j8H?i%wO7RI!AX_1!aamgl|R^w@u^DM*5 zJub6+-lAU|$`|p6N`f% zx^~;n@U5D&yuo_>y^)dqyhoc?zOLaZ%uh)``1`7?_51^Gd;~;mYJKc#8!c1v&S~Wp zF>@hEZK%3XJ62I$`@ioZiWM(y9PeX7xxO{gJ46+qt#Zr3wuF~ zI(i$94xZDtRe!Q%3Y@g>Uv!o7a~6OGUzYaq+CuGOb&dA*s;Sz4mTw;ZLS>nxl~%9U zKCFJR@ww}WV$r4iZ@)bFVJ5wN|Dx;rUeVJi!)p7!Meh;o%+=ffp}kSFNWOkuo8WDh z3$AOQ^xh`_;kx!k?=<<;_2Dz#=S)kFd@wR{R%Yy%7_VZS|Cf;w1qqLRI5IL3;|Cbq zF;4vJ$VeFD{TLs_coE}qjI;j+eT;{PzgzdNq`B%#Efm8~-q)V4FXvY={k?W_LWQiz z+FKKGYl#Uv@uL(L>xcfy@Xvb-QD{uTyq=8;&6$v=a- zsiD{>)cG42GV-HvYC2d(JOR`6aM=!;{}0JNQX%HQAybFSLd5?TS$|aL&n20c#N49% z7^`smJ;+*Vu58Bag1J@M0u9vN{aJ?heE)ir+@t^OX7~t!xqCURI~kN|*8+c;9Do z7sBJ#vWt+j-A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jI?xPKXSF!Hsm9PXnwA-9slj~7g*)CF`Yt&+i6V4gC~E56Ztm5gX)6@x810qHDSi}D|kL?y=WA#XO z#RkW#Kd@p499Z7S4m-4h6>|hSTHCT(7k~|$u0_|^8zJg5z?r%n%lL_@za*s4^qV50 Z9G=z max) + { + max = jobs[i].jid; + } + } + return max; +} + handler_t *Signal(int signum, handler_t *handler) { struct sigaction action, old_action; diff --git a/yeeshell.h b/yeeshell.h index b1c2152..7fa40cb 100644 --- a/yeeshell.h +++ b/yeeshell.h @@ -72,6 +72,9 @@ struct job_t *getjobpid(struct job_t *jobs, pid_t pid); /* getjobjid - Find a job (by JID) on the job list */ struct job_t *getjobjid(struct job_t *jobs, int jid); +/* maxjid - Returns largest allocated job ID */ +int maxjid(struct job_t *jobs); + /* Signal - wrapper for the sigaction function */ typedef void handler_t(int); handler_t *Signal(int signum, handler_t *handler);