comparison src/os_amiga.c @ 25014:a47dea17acba v8.2.3044

patch 8.2.3044: Amiga MorphOS and AROS: process ID is not valid Commit: https://github.com/vim/vim/commit/3a62b14077c51c739cdc755356882b40c299f1c0 Author: ola.soder@axis.com <ola.soder@axis.com> Date: Thu Jun 24 18:50:30 2021 +0200 patch 8.2.3044: Amiga MorphOS and AROS: process ID is not valid Problem: Amiga MorphOS and AROS: process ID is not valid. Solution: Use FindTask to return something which is unique to all processes. (Ola S?der, closes #8444)
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Jun 2021 19:00:05 +0200
parents c2c2189a98c4
children 76c9f536bafb
comparison
equal deleted inserted replaced
25013:5dc82450efc5 25014:a47dea17acba
444 * Use a pointer on the stack (nobody else will be using it). 444 * Use a pointer on the stack (nobody else will be using it).
445 * Under AmigaOS4, this assumption might change in the future, so 445 * Under AmigaOS4, this assumption might change in the future, so
446 * we use a pointer to the current task instead. This should be a 446 * we use a pointer to the current task instead. This should be a
447 * shared structure and thus globally unique. 447 * shared structure and thus globally unique.
448 */ 448 */
449 #ifdef __amigaos4__ 449 #if !defined(__amigaos4__) && !defined(__AROS__) && !defined(__MORPHOS__)
450 sprintf((char *)buf1, "t:nc%p", FindTask(0)); 450 sprintf((char *)buf1, "t:nc%p", FindTask(0));
451 #else 451 #else
452 sprintf((char *)buf1, "t:nc%ld", (long)buf1); 452 sprintf((char *)buf1, "t:nc%ld", (long)buf1);
453 #endif 453 #endif
454 if ((fh = Open((UBYTE *)buf1, (long)MODE_NEWFILE)) == (BPTR)NULL) 454 if ((fh = Open((UBYTE *)buf1, (long)MODE_NEWFILE)) == (BPTR)NULL)
704 * return process ID 704 * return process ID
705 */ 705 */
706 long 706 long
707 mch_get_pid(void) 707 mch_get_pid(void)
708 { 708 {
709 #ifdef __amigaos4__ 709 #if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__)
710 // This is as close to a pid as we can come. We could use CLI numbers also, 710 // This is as close to a pid as we can come. We could use CLI numbers also,
711 // but then we would have two different types of process identifiers. 711 // but then we would have two different types of process identifiers.
712 return((long)FindTask(0)); 712 return((long)FindTask(0));
713 #else 713 #else
714 return (long)0; 714 return (long)0;