| 
 |   
| version 1.1, 2025/01/19 02:04:04 | version 1.4, 2025/03/09 19:50:47 | 
|---|---|
| Line 1 | Line 1 | 
| /* | /* | 
| * * | * $Id$ | 
| * * * | |
| * * * | |
| * *************** | |
| * * * * * | |
| * * MUMPS * | |
| * * * * * | |
| * *************** | |
| * * * | |
| * * * | |
| * * | |
| * | |
| * shmmgr.c | |
| * shared memory manager | * shared memory manager | 
| * | * | 
| * | * | 
| * Author: Serena Willis <jpw@coherent-logic.com> | * Author: Serena Willis <snw@coherent-logic.com> | 
| * Copyright (C) 1998 MUG Deutschland | * Copyright (C) 1998 MUG Deutschland | 
| * Copyright (C) 2020 Coherent Logic Development LLC | * Copyright (C) 2020, 2025 Coherent Logic Development LLC | 
| * | * | 
| * | * | 
| * This file is part of FreeM. | * This file is part of FreeM. | 
| Line 35 | Line 23 | 
| * You should have received a copy of the GNU Affero Public License | * You should have received a copy of the GNU Affero Public License | 
| * along with FreeM. If not, see <https://www.gnu.org/licenses/>. | * along with FreeM. If not, see <https://www.gnu.org/licenses/>. | 
| * | * | 
| * $Log$ | |
| * Revision 1.4 2025/03/09 19:50:47 snw | |
| * Second phase of REUSE compliance and header reformat | |
| * | |
| * | |
| * SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC | |
| * SPDX-License-Identifier: AGPL-3.0-or-later | |
| **/ | **/ | 
| #include <stdlib.h> | #include <stdlib.h> | 
| Line 100 short shm_init(const size_t seg_size) | Line 95 short shm_init(const size_t seg_size) | 
| shm_config->seg_id = shmget (shm_config->key, shm_config->segsiz, 0660 | IPC_CREAT); | shm_config->seg_id = shmget (shm_config->key, shm_config->segsiz, 0660 | IPC_CREAT); | 
| if (shm_config->seg_id == -1) { | if (shm_config->seg_id == -1) { | 
| if (errno == 22) { | if (errno == 22) { | 
| fprintf (stderr, "shm_init: cannot get shared memory segment of %d bytes\r\n\r\n", shm_config->segsiz); | fprintf (stderr, "shm_init: cannot get shared memory segment of %ld bytes\r\n\r\n", (unsigned long) shm_config->segsiz); | 
| fprintf (stderr, "You may need to tune your kernel parameters, or manually set a smaller shared memory segment size in both the FreeM daemon and each interpreter process by using the `-S` command-line flag.\r\n\r\nPlease refer to the FreeM Platform Notes for your operating system for details.\r\n\r\n"); | fprintf (stderr, "You may need to tune your kernel parameters, or manually set a smaller shared memory segment size in both the FreeM daemon and each interpreter process by using the `-S` command-line flag.\r\n\r\nPlease refer to the FreeM Platform Notes for your operating system for details.\r\n\r\n"); | 
| } | } | 
| return SHMS_GET_ERR; | return SHMS_GET_ERR; | 
| Line 473 void shm_dump(void) | Line 468 void shm_dump(void) | 
| { | { | 
| printf ("SHARED MEMORY CONFIGURATION\r\n"); | printf ("SHARED MEMORY CONFIGURATION\r\n"); | 
| printf (" pgsiz %d\r\n", shm_config->pgsiz); | printf (" pgsiz %ld\r\n", (unsigned long) shm_config->pgsiz); | 
| printf (" pgct %d\r\n", shm_config->pgct); | printf (" pgct %d\r\n", shm_config->pgct); | 
| printf (" key %d\r\n", shm_config->key); | printf (" key %ld\r\n", shm_config->key); | 
| printf (" segid %d\r\n", shm_config->seg_id); | printf (" segid %d\r\n", shm_config->seg_id); | 
| printf (" sizeof shm_page_t %d\r\n", sizeof (shm_page_t)); | printf (" sizeof shm_page_t %ld\r\n", (long) sizeof (shm_page_t)); | 
| printf (" segsiz %d\r\n", shm_config->segsiz); | printf (" segsiz %ld\r\n", (long) shm_config->segsiz); | 
| printf (" shm address %p\r\n", shm_config->dta); | printf (" shm address %p\r\n", shm_config->dta); | 
| printf (" alloc_map size %d\r\n", sizeof (shm_page_t) * shm_config->pgct); | printf (" alloc_map size %ld\r\n", (unsigned long) sizeof (shm_page_t) * shm_config->pgct); | 
| printf (" buf address %p\r\n", shm_config->buf); | printf (" buf address %p\r\n", shm_config->buf); | 
| } | } |