JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。
... lude < stdio.h > #include < stdlib.h > #include < unistd.h > int main(int argc, char *argv[]) { char *newargv[] = { NULL, "hello", "world", NULL }; char *newenviron[] = { NULL }; if (argc != 2) { fprintf(stderr, "Usage: %s <file-to-exec>\n", argv[0]); ... 行するには 以下のようにする。 $ cc myecho.c -o myecho $ cc execve.c -o execve $ ./execve ./myecho argv[0]: ./myecho argv[1]: hello argv[2]: world さらに、これらのプログラムを使って、スクリプトインタープリターの例を示す。 このために、「インタープリター」 ... ログラムを使ってスクリプトを実行する。 $ ./execve ./script argv[0]: ./myecho argv[1]: script-arg argv[2]: ./script argv[3]: hello argv[4]: world 関連項目 chmod (2), execveat (2), fork (2), get_robust_list (2), ptrace (2), exec (3), fexecve (3), getopt ... ... mory segment, copies the string to the shared memory, and modifies the semaphore value. $ ./svshm_string_write 1114194 15 'Hello, world' Returning to the terminal where the "reader" is running, we see that the program has ceased waiting on the semapho ... re and has printed the string that was copied into the shared memory segment by the writer: Hello, world プログラムのソース: svshm_string.h The following header file is included by the "reader" and "writer" programs. #in ... ... mory segment, copies the string to the shared memory, and modifies the semaphore value. $ ./svshm_string_write 1114194 15 'Hello, world' Returning to the terminal where the "reader" is running, we see that the program has ceased waiting on the semapho ... re and has printed the string that was copied into the shared memory segment by the writer: Hello, world プログラムのソース: svshm_string.h The following header file is included by the "reader" and "writer" programs. #in ... ... mory segment, copies the string to the shared memory, and modifies the semaphore value. $ ./svshm_string_write 1114194 15 'Hello, world' Returning to the terminal where the "reader" is running, we see that the program has ceased waiting on the semapho ... re and has printed the string that was copied into the shared memory segment by the writer: Hello, world プログラムのソース: svshm_string.h The following header file is included by the "reader" and "writer" programs. #in ... ... 、サポートされている標準的な Unix システムで標準 Unix のオブジェクトファイルを作成する場合を考えよう。このようなシステ ムで hello.o ファイルをリンクする作業は以下のようになる。 $ ld -o output /lib/crt0.o hello.o -lc この例では ld に output という名前の ... ファイルを作成するように命令している。リンクするファイルは /lib/crt0.o 、 hello.o および標準的な検索ディレクトリにあるライブラリ libc.a である。 ld のコマンドラインオプションは任意の順序で指定でき、必要 ... ... ample execution of the two programs is the following: $ ./pshm_ucase_bounce /myshm & [1] 270171 $ ./pshm_ucase_send /myshm hello HELLO Further detail about these programs is provided below. プログラムのソース: pshm_ucase.h The following header file is ... ... ample execution of the two programs is the following: $ ./pshm_ucase_bounce /myshm & [1] 270171 $ ./pshm_ucase_send /myshm hello HELLO Further detail about these programs is provided below. プログラムのソース: pshm_ucase.h The following header file is ... ... 字も文字通りに取り込むために、 (たとえその文字が他に特別な意味を持っていたとしても) ` ! ' を文字の前につけられる。例えば、`"hello !"world!"" • % EXPR を EXPR 式の数値を求めるために書くことが出来、 その結果は文字列として使用できる。 例 gasp に .MACRO sa ... ount LE \to mov r\&count,@-sp count .ASSIGNA \&count + 1 .AENDW .ENDM saveregs from=12 bar: mov #H'dead+10,r0 foo .SDATAC "hello"<10> .END を与えると、下の GNU as のコードを生成する: ! save r12..r14 mov r12,@-sp mov r13,@-sp mov r14,@-sp bar: mov #570 ... ... 例えば、次のような使い方は許されない: #include < stdio.h > int main(void) { char buf[BUFSIZ]; setbuf(stdin, buf); printf("Hello, world!\n"); return 0; } 関連項目 stdbuf (1), fclose (3), fflush (3), fopen (3), fread (3), malloc (3), printf (3), puts ( ... ... 例えば、次のような使い方は許されない: #include < stdio.h > int main(void) { char buf[BUFSIZ]; setbuf(stdin, buf); printf("Hello, world!\n"); return 0; } 関連項目 stdbuf (1), fclose (3), fflush (3), fopen (3), fread (3), malloc (3), printf (3), puts ( ... 日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。