Skip to content

Commit e8fab05

Browse files
committed
adding op-codes for syscall ipc for shmat/shmdt
These op codes used to be in bits/ipc.h but were removed in glibc in 2015 with a comment saying they should be defined in internal headers: https://sourceware.org/bugzilla/show_bug.cgi?id=18560 and when glibc uses that syscall it seems to do so from its own definitions: https://github.com/bminor/glibc/search?q=IPCOP_shmat&unscoped_q=IPCOP_shmat So I think using #ifndef and defining them if they're not already defined using the values from glibc is the best option. At IBM it was the testing on redhat 8 that found this as an issue (the opcodes being undefined on the system made it select the left undefined so shmat/shmdt memory events went unintercepted). Signed-off-by: Mark Allen <markalle@us.ibm.com>
1 parent 0a21a58 commit e8fab05

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

opal/mca/memory/patcher/memory_patcher_component.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* reserved.
1616
* Copyright (c) 2016-2017 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
18-
* Copyright (c) 2016-2019 IBM Corporation. All rights reserved.
18+
* Copyright (c) 2016-2020 IBM Corporation. All rights reserved.
1919
*
2020
* $COPYRIGHT$
2121
*
@@ -334,6 +334,18 @@ static int intercept_brk (void *addr)
334334

335335
#endif
336336

337+
// These op codes used to be in bits/ipc.h but were removed in glibc in 2015
338+
// with a comment saying they should be defined in internal headers:
339+
// https://sourceware.org/bugzilla/show_bug.cgi?id=18560
340+
// and when glibc uses that syscall it seems to do so from its own definitions:
341+
// https://github.com/bminor/glibc/search?q=IPCOP_shmat&unscoped_q=IPCOP_shmat
342+
#ifndef IPCOP_shmat
343+
#define IPCOP_shmat 21
344+
#endif
345+
#ifndef IPCOP_shmdt
346+
#define IPCOP_shmdt 22
347+
#endif
348+
337349
#if defined(SYS_shmdt) || (defined(IPCOP_shmdt) && defined(SYS_ipc))
338350
#define HAS_SHMDT 1
339351
#else

0 commit comments

Comments
 (0)