Last active
November 28, 2025 23:55
-
-
Save bg1bgst333/2dcc21b84643ab748ba1 to your computer and use it in GitHub Desktop.
system#system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ヘッダファイルのインクルード */ | |
| #include <stdio.h> /* 標準入出力 */ | |
| #include <stdlib.h> /* 標準ユーティリティ */ | |
| #include <sys/types.h> /* 派生型 */ | |
| #include <unistd.h> /* UNIX標準 */ | |
| /* main関数の定義 */ | |
| int main(void){ | |
| /* 変数の宣言 */ | |
| pid_t pid; /* getpidでプロセスIDを取得し, pidに格納. */ | |
| /* プロセスIDの取得 */ | |
| pid = getpid(); /* getpidでプロセスIDを取得し, pidに格納. */ | |
| printf("pid = %d\n", pid); /* printfでpidを出力. */ | |
| /* 1分間(60秒間)待つ. */ | |
| sleep(60); /* sleepで60秒間休止. */ | |
| /* systemを呼ぶ直前. */ | |
| printf("system before.\n"); /* "system before."を出力する. */ | |
| /* プロセスの実行. */ | |
| system("./system_sub 123 abc xyz"); /* systemで"./system_sub"を引数"123", "abb", "xyz"として実行.(systemにより, system_mainのプロセスとは別にsystem_subのプロセスが生成される.) */ | |
| /* 1分間(60秒間)待つ. */ | |
| sleep(60); /* sleepで60秒間休止. */ | |
| /* プログラムの終了 */ | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ヘッダファイルのインクルード */ | |
| #include <stdio.h> /* 標準入出力 */ | |
| #include <sys/types.h> /* 派生型 */ | |
| #include <unistd.h> /* UNIX標準 */ | |
| /* main関数の定義 */ | |
| int main(int argc, char *argv[]){ | |
| /* 変数の宣言 */ | |
| pid_t pid; /* プロセスIDを格納するpid_t型変数pid. */ | |
| int i; /* ループ用変数i */ | |
| /* プロセスIDの取得 */ | |
| pid = getpid(); /* getpidでプロセスIDを取得し, pidに格納. */ | |
| printf("pid = %d\n", pid); /* printfでpidを出力. */ | |
| /* コマンドライン引数の出力. */ | |
| for (i = 0; i < argc; i++){ /* argcの数繰り返す. */ | |
| /* argvの出力. */ | |
| printf("argv[%d] = %s\n", i, argv[i]); /* argvの各要素を出力. */ | |
| } | |
| /* 1分間(60秒)待つ. */ | |
| sleep(60); /* sleepで60秒間休止. */ | |
| /* プログラムの終了. */ | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Leah m guyer 1204 1 so I'm not applicable for that one place to do it with you 😉 😏 😜 I don't have to go with you can easily get the best for me to get a chance of it for you and your mouth in your mouth in the morning my phone was born and the other day was a bit late but I was born in the middle of a few hours 😉 and was trying to get 😉 to get the money back from me and I will let 😉 know when we can do the things we have in your house and you will always be able for the entirety to do something to do with your family and be able for the entirety to do