From aabcdb460bc25256386f4abc7e7e30c7e17c691a Mon Sep 17 00:00:00 2001 From: Dmitry Irtegov Date: Tue, 24 Sep 2024 13:03:19 +0700 Subject: [PATCH 1/6] Added core files, .DS_Store and .nfs* to .gitignore --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index c6127b38..926b71aa 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,9 @@ modules.order Module.symvers Mkfile.old dkms.conf + +# some musom +core +core.* +.nfs* +.DS_Store§ From faa6b620640e3f12761c07b64e8d9023212622a6 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Irtegov" Date: Tue, 24 Sep 2024 13:27:21 +0700 Subject: [PATCH 2/6] Update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 926b71aa..83b47fc1 100644 --- a/.gitignore +++ b/.gitignore @@ -55,4 +55,4 @@ dkms.conf core core.* .nfs* -.DS_Store§ +.DS_Store From 6bff7b97bc718bf9f10e60ba753e9fc1817d008d Mon Sep 17 00:00:00 2001 From: ArtemChepenkov <82212767+ArtemChepenkov@users.noreply.github.com> Date: Sat, 16 Nov 2024 12:48:54 +0700 Subject: [PATCH 3/6] Artem Chepenkov 23213 lab20 (#413) --- 23213/a.chepenkov/lab20/Makefile | 2 ++ 23213/a.chepenkov/lab20/lab20.c | 37 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 23213/a.chepenkov/lab20/Makefile create mode 100644 23213/a.chepenkov/lab20/lab20.c diff --git a/23213/a.chepenkov/lab20/Makefile b/23213/a.chepenkov/lab20/Makefile new file mode 100644 index 00000000..35987c8e --- /dev/null +++ b/23213/a.chepenkov/lab20/Makefile @@ -0,0 +1,2 @@ +main: lab20.c + gcc lab20.c -Wall -Wextra -Werror -pedantic -std=c99 -o main diff --git a/23213/a.chepenkov/lab20/lab20.c b/23213/a.chepenkov/lab20/lab20.c new file mode 100644 index 00000000..bb229f01 --- /dev/null +++ b/23213/a.chepenkov/lab20/lab20.c @@ -0,0 +1,37 @@ +#include +#include +#include +#include + +int errfunc(const char *epath, int eerrno) { + if (eerrno != ENOTDIR) { + fprintf(stderr, "%s: %s\n", epath, strerror(eerrno)); + } + return 0; +} + +int main() { + glob_t glob_struct; + int glob_res; + char** matched; + char pattern[BUFSIZ]; + fgets(pattern, BUFSIZ, stdin); + + if (pattern[strlen(pattern) - 1] == '\n') { + pattern[strlen(pattern) - 1] = '\0'; + } + + glob_res = glob(pattern, 0, &errfunc, &glob_struct); + if (glob_res == GLOB_NOMATCH) { + printf("No files found with pattern: %s\n", pattern); + return -1; + } + + matched = glob_struct.gl_pathv; + while (*matched) { + printf("%s\n", *matched); + matched++; + } + globfree(&glob_struct); + return 0; +} From b170ddd4780e57808d1ca6cdb0cc71de9c035fdb Mon Sep 17 00:00:00 2001 From: mikle Date: Wed, 4 Dec 2024 13:31:21 +0700 Subject: [PATCH 4/6] =?UTF-8?q?=09=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84?= =?UTF-8?q?=D0=B0=D0=B9=D0=BB:=20=20=20=2023217/m.baev/lab2/main.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 23217/m.baev/lab2/main.c | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 23217/m.baev/lab2/main.c diff --git a/23217/m.baev/lab2/main.c b/23217/m.baev/lab2/main.c new file mode 100644 index 00000000..5fac16cd --- /dev/null +++ b/23217/m.baev/lab2/main.c @@ -0,0 +1,43 @@ +#include +#include +#include +#include +extern char *tzname[]; + +int main() { + time_t now; + struct tm *sp; + + if(setenv("TZ", "America/Los_Angeles", 1) == -1) { + + fprintf(stderr, "setenv error\n"); + return 1; + } + //tzset(); + + now = time(NULL); + if (now == -1) { + fprintf(stderr, "Get time error\n"); + return 1; + } + + char *time_now = ctime(&now); + if (time_now == NULL) { + fprintf(stderr, "ctime error\n"); + return 1; + } + printf("%s", time_now); + + sp = localtime(&now); + if (sp == NULL) { + + fprintf(stderr, "Get time error\n"); + return 1; + } + printf("%d/%d/%02d %d:%02d %s\n", + sp->tm_mon + 1, sp->tm_mday, + sp->tm_year, sp->tm_hour, + sp->tm_min, tzname[sp->tm_isdst]); + + return 0; +} \ No newline at end of file From cc82df4207de864f9fa4a329dfd6de21d3426df2 Mon Sep 17 00:00:00 2001 From: mikle Date: Wed, 4 Dec 2024 13:38:08 +0700 Subject: [PATCH 5/6] =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84?= =?UTF-8?q?=D0=B0=D0=B9=D0=BB:=20=20=20=2023217/m.baev/lab9=5F10/long=5Ffi?= =?UTF-8?q?le.txt=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84=D0=B0=D0=B9?= =?UTF-8?q?=D0=BB:=20=20=20=2023217/m.baev/lab9=5F10/main=20=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D1=8B=D0=B9=20=D1=84=D0=B0=D0=B9=D0=BB:=20=20=20=2023217?= =?UTF-8?q?/m.baev/lab9=5F10/main.c=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB:=20=20=20=2023217/m.baev/lab9=5F10/tes?= =?UTF-8?q?t=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84=D0=B0=D0=B9=D0=BB:?= =?UTF-8?q?=20=20=20=2023217/m.baev/lab9=5F10/test.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 23217/m.baev/lab9_10/long_file.txt | 1 + 23217/m.baev/lab9_10/main | Bin 0 -> 33592 bytes 23217/m.baev/lab9_10/main.c | 23 +++++++++++++++++++++++ 23217/m.baev/lab9_10/test | Bin 0 -> 33432 bytes 23217/m.baev/lab9_10/test.c | 11 +++++++++++ 5 files changed, 35 insertions(+) create mode 100644 23217/m.baev/lab9_10/long_file.txt create mode 100755 23217/m.baev/lab9_10/main create mode 100644 23217/m.baev/lab9_10/main.c create mode 100755 23217/m.baev/lab9_10/test create mode 100644 23217/m.baev/lab9_10/test.c diff --git a/23217/m.baev/lab9_10/long_file.txt b/23217/m.baev/lab9_10/long_file.txt new file mode 100644 index 00000000..7e62f84f --- /dev/null +++ b/23217/m.baev/lab9_10/long_file.txt @@ -0,0 +1 @@ +longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong diff --git a/23217/m.baev/lab9_10/main b/23217/m.baev/lab9_10/main new file mode 100755 index 0000000000000000000000000000000000000000..92db094c02b1e1c7f347e20a7bc90309dd189394 GIT binary patch literal 33592 zcmeI5U2IfU5XWbC3;hsiX$gfY_7cSuB*h@nMky?mLK{h2OQWmC9JbvpUD)o{-P;rd z;v#7RLSi>*NR31qANXjBQ6gy*Vl1iAMjK5ve8j{`^uZE?FTPl?;LN$V?d^(UVoZGa zPcrw+%sFT7oZr2#=bW!@-nc!7$VDt}*7>YP8c{nLY!NMHtzcEEX2X{97t3p_B|1~| z8q47DiL5I19?$c`z0=6dVwe6@DJ_)c-= zmbg-_k+x7IphA(xsP<>(J8kFl*-6At&0%-xM!rKAt5Tab)NN2@)m7W9ui>?S0&caW zv>pzM%D2j4Rcc4n@frRyUlEVh;zX2m6n)FKiaE4zZuk?e+siUT*JWtzmVFj1_g(>FgJ~ zgy(0a2HBs-YOu@y!HnO#?`KP~>wt}O2eY&5B`6eWf{O3-Q_m;3qpR9ps3opYpT?^N^25Au8VXXIrqq1@{{m*@8s@w_olR!Qxj4Stit z(Z~+f$ZoO8Ti1h;fDv!4Z;3@4g7LV~5(*g00!CZNY%=1e-)xPun?)7Da5!qTMPuQ> zQrTZDTWud;6>+w*w^#Q5dbt&q{pliJ{hWTt{^2>CB}Zq{@wDmQoP^}(oxKUkC#|); zIwxTdO6V{iAOHd&00JNY0w4eaAOHd&00JNY0w4eaAOHd&00JNY0w4eaAOHd&00JNY z0w4eaAOHd&00JNY0w4eaAOHd&00JNY0w4eaAOHd&00JNY0w4eaAOHd&00JNY0{E3D9?mTT$y?aq{vl?%v6WHP6Kd2)Ouw1=oYD#jKO}lB?kE zU_-ctl$?%0swEhUMPuB?LJ_l(RGU9!>P#+0Jl(pq+(X0r*iy|+dUmTBR82vDAQ+>} zW`8I`b4d@F9G>msQyW;M{)MdBY{=ON;>(!{+={8?VSYM&xmVrkuTJrwO7Z2K1UVx? z_y{w(&;D*PgVbHhSGxRvg5>7toB^&Z$>}F+U%)Y;yr10scDH`*%iQl{72zW@4s;uC zef7K*`TOUv-R;svR zi+*~&aUku=$jB~twQts)eIM?7wf)t`y t<^Q++S1z3&dE)Y^6~7fc?|VJZSXl8%#^$r-`MsXE+h_lByQ-T literal 0 HcmV?d00001 diff --git a/23217/m.baev/lab9_10/main.c b/23217/m.baev/lab9_10/main.c new file mode 100644 index 00000000..46e9865a --- /dev/null +++ b/23217/m.baev/lab9_10/main.c @@ -0,0 +1,23 @@ +#include +#include +#include + +int main() { + int status; + pid_t pid = fork(); + + if (pid < 0) { + perror("fork failed"); + } + + if (pid == 0) { + execlp("cat", "cat", "long_file.txt", NULL); + } + + else { + printf("end subprocess pid %d with status %d\n", wait(&status), WEXITSTATUS(status)); + printf("Hello world!\n"); + } + + return 1; +} diff --git a/23217/m.baev/lab9_10/test b/23217/m.baev/lab9_10/test new file mode 100755 index 0000000000000000000000000000000000000000..d76334a493047c0233ddd1e38d81d1926b54cf75 GIT binary patch literal 33432 zcmeI*TWl0n7zglgr%NsA(k(`fH|#!Y7CQZD>M2lS12j#^CVlaUilVU1<-`TU<*+u2S2YvXT zKo)>sWrJ_x-Xz{c@-Yy;^(_h5H61*f`l*%M_WK4&v(tMFeawiipyGUQot5E#p z7TVlUDxDdOrwc=+`LZS-8|fl_Z@vnXFF&tTXF8K|l09bs(tPijeEIW{zPEUD%eYd5 z$)}xUmvWNb1G-=AH)it1OcLpr<}g#blIxJ=P^z&Z+Mph7+1Qr58n(F!xYnhlF5^K7 zxmML2O7#qQF2mpEtKfZgv2(|p9+h*$d*3YFXOZR!|D<^F2!%VD>29O1s4&$nEMxvu1Bu+1JH=DR*$lI$m1++p!NP9;`ZWVtng&{?Hfq@K}f=_nSd(1a({c z-_Y)_M=$3} z@@HKlxppf|U%aF&r8swzc5R#r;R2AAOHafKmY;|fB*y_009U<00Izz00bZa0SG_<0uX=z z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZa0SG_<0uX=z1Rwwb2tWV= z|A9b=f3uY%#vz~d_I}pe`;q|pmUzDCw#{F0xAPVWk5}kvYgz8OnbR|->xWB_m(h|};k8uj$9_J#}{n zhCXkf39mUA|9$!6ksnY0{QRXu-DPjpl|S%nXHEB|C6yDWetG+3`?KeMdeu69@p}3H p?R<3j(+%++r+)LzReLutd$)GOm~;59Ey)hMZAEhXYulp+>rZb&KX(8C literal 0 HcmV?d00001 diff --git a/23217/m.baev/lab9_10/test.c b/23217/m.baev/lab9_10/test.c new file mode 100644 index 00000000..29313ff2 --- /dev/null +++ b/23217/m.baev/lab9_10/test.c @@ -0,0 +1,11 @@ +#include +#include + +int main() { + int *x = (int*) 0x10001; + + // Если exec вернул управление, значит произошла ошибка + *x = 5; + perror("err"); + return 0; +} From e2c10abe943500bf443f53d00e3fdcdf54cdd393 Mon Sep 17 00:00:00 2001 From: Mikle Baev Date: Tue, 24 Dec 2024 13:34:04 +0700 Subject: [PATCH 6/6] aadd lab 9, 10 --- 23217/m.baev/lab9_10/test | Bin 33432 -> 0 bytes 23217/m.baev/lab9_10/test.c | 11 ----------- 2 files changed, 11 deletions(-) delete mode 100755 23217/m.baev/lab9_10/test delete mode 100644 23217/m.baev/lab9_10/test.c diff --git a/23217/m.baev/lab9_10/test b/23217/m.baev/lab9_10/test deleted file mode 100755 index d76334a493047c0233ddd1e38d81d1926b54cf75..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33432 zcmeI*TWl0n7zglgr%NsA(k(`fH|#!Y7CQZD>M2lS12j#^CVlaUilVU1<-`TU<*+u2S2YvXT zKo)>sWrJ_x-Xz{c@-Yy;^(_h5H61*f`l*%M_WK4&v(tMFeawiipyGUQot5E#p z7TVlUDxDdOrwc=+`LZS-8|fl_Z@vnXFF&tTXF8K|l09bs(tPijeEIW{zPEUD%eYd5 z$)}xUmvWNb1G-=AH)it1OcLpr<}g#blIxJ=P^z&Z+Mph7+1Qr58n(F!xYnhlF5^K7 zxmML2O7#qQF2mpEtKfZgv2(|p9+h*$d*3YFXOZR!|D<^F2!%VD>29O1s4&$nEMxvu1Bu+1JH=DR*$lI$m1++p!NP9;`ZWVtng&{?Hfq@K}f=_nSd(1a({c z-_Y)_M=$3} z@@HKlxppf|U%aF&r8swzc5R#r;R2AAOHafKmY;|fB*y_009U<00Izz00bZa0SG_<0uX=z z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZa0SG_<0uX=z1Rwwb2tWV= z|A9b=f3uY%#vz~d_I}pe`;q|pmUzDCw#{F0xAPVWk5}kvYgz8OnbR|->xWB_m(h|};k8uj$9_J#}{n zhCXkf39mUA|9$!6ksnY0{QRXu-DPjpl|S%nXHEB|C6yDWetG+3`?KeMdeu69@p}3H p?R<3j(+%++r+)LzReLutd$)GOm~;59Ey)hMZAEhXYulp+>rZb&KX(8C diff --git a/23217/m.baev/lab9_10/test.c b/23217/m.baev/lab9_10/test.c deleted file mode 100644 index 29313ff2..00000000 --- a/23217/m.baev/lab9_10/test.c +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -int main() { - int *x = (int*) 0x10001; - - // Если exec вернул управление, значит произошла ошибка - *x = 5; - perror("err"); - return 0; -}