JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。
... onds since boot */ unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ unsigned long totalram; /* Total usable main memory size */ unsigned long freeram; /* Available memory size */ unsigned long sharedram; /* Amount of shared memory */ u ... nsigned long bufferram; /* Memory used by buffers */ unsigned long totalswap; /* Total swap space size */ unsigned long freeswap; /* Swap space still availa ... * Number of current processes */ char _f[22]; /* Pads structure to 64 bytes */ }; In the above structure, the sizes of the memory and swap fields are given in bytes. Linux 2.3.23 (i386)、Linux 2.3.48 (全てのアーキテクチャー) 以降では、構造体は struct s ... ... afety MT-Safe locale 準拠 POSIX.1-2001, POSIX.1-2008. POSIX.1-2001 says that the group ownership of a newly created shared memory object is set to either the calling process's effective group ID or "a system default group ID". POSIX.1-2008 says that th ... ファイルシステムを使用する。そのファイルシステムは通常 /dev/shm にマウントされる。 例 The programs below employ POSIX shared memory and POSIX unnamed semaphores to exchange a piece of data. The "bounce" program (which must be run first) raises the case o ... _ucase_bounce.c Licensed under GNU General Public License v2 or later. */ #include < ctype.h > #include "pshm_ucase.h" int main(int argc, char *argv[]) { if (argc != 2) { fprintf(stderr, "Usage: %s /shm-path\n", argv[0]); exit(EXIT_FAILURE); } char * ... ... afety MT-Safe locale 準拠 POSIX.1-2001, POSIX.1-2008. POSIX.1-2001 says that the group ownership of a newly created shared memory object is set to either the calling process's effective group ID or "a system default group ID". POSIX.1-2008 says that th ... ファイルシステムを使用する。そのファイルシステムは通常 /dev/shm にマウントされる。 例 The programs below employ POSIX shared memory and POSIX unnamed semaphores to exchange a piece of data. The "bounce" program (which must be run first) raises the case o ... _ucase_bounce.c Licensed under GNU General Public License v2 or later. */ #include < ctype.h > #include "pshm_ucase.h" int main(int argc, char *argv[]) { if (argc != 2) { fprintf(stderr, "Usage: %s /shm-path\n", argv[0]); exit(EXIT_FAILURE); } char * ... ... g ); int shmdt(const void * shmaddr ); 説明 shmat() shmat () は shmid で指定された System V 共有メモリーセグメント (shared memory segment) を コールしたプロセスのアドレス空間に付加 (attach) する。 付加するアドレスは shmaddr に以下のどれかの形式で指定す ... グメントの最大数 ( SHMSEG ) に関する実装依存の制限はない。 例 The two programs shown below exchange a string using a shared memory segment. Further details about the programs are given below. First, we show a shell session demonstrating their use. In on ... e "writer". /* svshm_string_read.c Licensed under GNU General Public License v2 or later. */ #include "svshm_string.h" int main(int argc, char *argv[]) { int semid, shmid; union semun arg, dummy; struct sembuf sop; char *addr; /* Create shared memory ... ... g ); int shmdt(const void * shmaddr ); 説明 shmat() shmat () は shmid で指定された System V 共有メモリーセグメント (shared memory segment) を コールしたプロセスのアドレス空間に付加 (attach) する。 付加するアドレスは shmaddr に以下のどれかの形式で指定す ... グメントの最大数 ( SHMSEG ) に関する実装依存の制限はない。 例 The two programs shown below exchange a string using a shared memory segment. Further details about the programs are given below. First, we show a shell session demonstrating their use. In on ... e "writer". /* svshm_string_read.c Licensed under GNU General Public License v2 or later. */ #include "svshm_string.h" int main(int argc, char *argv[]) { int semid, shmid; union semun arg, dummy; struct sembuf sop; char *addr; /* Create shared memory ... ... g ); int shmdt(const void * shmaddr ); 説明 shmat() shmat () は shmid で指定された System V 共有メモリーセグメント (shared memory segment) を コールしたプロセスのアドレス空間に付加 (attach) する。 付加するアドレスは shmaddr に以下のどれかの形式で指定す ... グメントの最大数 ( SHMSEG ) に関する実装依存の制限はない。 例 The two programs shown below exchange a string using a shared memory segment. Further details about the programs are given below. First, we show a shell session demonstrating their use. In on ... e "writer". /* svshm_string_read.c Licensed under GNU General Public License v2 or later. */ #include "svshm_string.h" int main(int argc, char *argv[]) { int semid, shmid; union semun arg, dummy; struct sembuf sop; char *addr; /* Create shared memory ... ... c void * thread_func(void *arg) { int tn = (int) arg; /* The multiplier '(2 + tn)' ensures that each thread (including the main thread) allocates a different amount of memory */ for (int j = 0; j < numBlocks; j++) if (malloc(blockSize * (2 + tn)) == ... NULL) errExit("malloc-thread"); sleep(100); /* Sleep until main thread terminates */ return NULL; } int main(int argc, char *argv[]) { int sleepTime; if (argc < 4) { fprintf(stderr, "%s ... == Before allocating blocks ============\n"); malloc_info(0, stdout); /* Create threads that allocate different amounts of memory */ for (int tn = 0; tn < numThreads; tn++) { errno = pthread_create(&thr[tn], NULL, thread_func, (void *) tn); if (errno ! ... ... 特定の状況では free (3) により自動的に呼び出される。 mallopt (3) の M_TOP_PAD と M_TRIM_THRESHOLD の議論を参照。 Only the main heap (using sbrk (2)) honors the pad argument; thread heaps do not. Since glibc 2.8 this function frees memory in all aren ... as and in all chunks with whole free pages. Before glibc 2.8 this function only freed memory at the top of the heap in the main arena. 関連項目 sbrk (2), malloc (3), mallopt (3) この文書について この man ページは Li ... ... envp array must be terminated by a NULL pointer. The argument vector and environment can be accessed by the new program's main function, when it is defined as: int main(int argc, char *argv[], char *envp[]) Note, however, that the use of a third arg ... ument to the main function is not specified in POSIX.1; according to POSIX.1, the environment should be accessed via the external variable e ... RLIMIT_STACK resource limit (see getrlimit (2)) that is in force at the time of the execve () call. (Architectures with no memory management unit are excepted: they maintain the limit that was in effect before kernel 2.6.23.) This change allows program ... ... d. Dynamic loading usually triggers a call to malloc (3). If you need certain calls to these two functions to not allocate memory (in signal handlers, for example), you need to make sure libgcc is loaded beforehand. シンボル名は特別なリンカーオプション ... ./prog [0x8048871] ./prog(myfunc+0x21) [0x8048894] ./prog(myfunc+0x1a) [0x804888d] ./prog(myfunc+0x1a) [0x804888d] ./prog(main+0x65) [0x80488fb] /lib/libc.so.6(__libc_start_main+0xdc) [0xb7e38f9c] ./prog [0x8048711] プログラムのソース #include < exe ... 意味する */ myfunc2(void) { myfunc3(); } void myfunc(int ncalls) { if (ncalls > 1) myfunc(ncalls - 1); else myfunc2(); } int main(int argc, char *argv[]) { if (argc != 2) { fprintf(stderr, "%s num-calls\n", argv[0]); exit(EXIT_FAILURE); } myfunc(atoi(a ... 日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。