mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-25 18:37:50 +00:00
Max length for SHM names on Apple is 30!
Bloody CrApple
This commit is contained in:
parent
d3b63a9c45
commit
4528173ff5
1 changed files with 6 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue