Max length for SHM names on Apple is 30!
Bloody CrApple
This commit is contained in:
parent
d3b63a9c45
commit
4528173ff5
@ -341,10 +341,14 @@ PyInit_fast_data_types(void) {
|
||||
PyModule_AddIntMacro(m, APC);
|
||||
PyModule_AddIntMacro(m, OSC);
|
||||
PyModule_AddIntMacro(m, FILE_TRANSFER_CODE);
|
||||
// FreeBSD's man page says this is 1023. Linux says its PATH_MAX.
|
||||
#ifdef __APPLE__
|
||||
// Apple says its SHM_NAME_MAX but SHM_NAME_MAX is not actually declared in typical CrApple style.
|
||||
// Experimentation shows that 1023 is allowed on macOS Catalina
|
||||
// This value is based on experimentation
|
||||
PyModule_AddIntConstant(m, "SHM_NAME_MAX", 30);
|
||||
#else
|
||||
// FreeBSD's man page says this is 1023. Linux says its PATH_MAX.
|
||||
PyModule_AddIntConstant(m, "SHM_NAME_MAX", MIN(1023, PATH_MAX));
|
||||
#endif
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user