[MacPorts] #59772: python38: fails on Leopard: Undefined symbols: :info:build "_pthread_threadid_np"

MacPorts noreply at macports.org
Fri Feb 28 21:30:10 UTC 2020


#59772: python38: fails on Leopard: Undefined symbols: :info:build
"_pthread_threadid_np"
-----------------------+---------------------------
  Reporter:  kencu     |      Owner:  jmroot
      Type:  defect    |     Status:  assigned
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:  leopard tiger
      Port:  python38  |
-----------------------+---------------------------

Comment (by kencu):

 this looks like it will do it:

 {{{
 #include <errno.h>
 #include <pthread.h>
 #include <mach/kern_return.h>
 #include <mach/thread_info.h>
 #include <mach/thread_act.h>

 int pthread_threadid_np(pthread_t thread, __uint64_t *thread_id) {

     if (thread_id == NULL) {
         return EINVAL;
     }

     if (thread == NULL) {
         thread = pthread_self();

         if (thread == NULL ) {
           return ESRCH;
         }
     }

     mach_port_name_t port = pthread_mach_thread_np(thread);

     thread_identifier_info_data_t info;
     mach_msg_type_number_t info_count = THREAD_IDENTIFIER_INFO_COUNT;

     kern_return_t kr = thread_info(port,
                                    THREAD_IDENTIFIER_INFO,
                                    (thread_info_t)&info,
                                    &info_count);
     if(kr != KERN_SUCCESS) {
         return ESRCH;
     } else {
         *thread_id = info.thread_id;
         return 0;
     }
 }
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/59772#comment:15>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list