🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #568

what are all the ports for?

#568
From: Bruce Ediger
Date: Wed, 08 Apr 1992 03:23
38 lines
1636 bytes
I wrote a little program that uses port_names() to get the list of ports
available to a thread.  The output looks like this:

port    1, type Send rights
port    2, type Send rights
port    3, type Send, receive, ownership
port    4, type Send rights
port    5, type Send rights
port    6, type Set ownership
port    7, type Send, receive, ownership
port    8, type Send, receive, ownership
port    9, type Send rights
port   10, type Set ownership
port   11, type Send, receive, ownership
port   12, type Send, receive, ownership


Curious about the number, I added to the program.  Using a combination of
task_get_special_port(), thread_get_reply_port(), thread_get_exception_port()
and inspection of /usr/include/mach_init.h, I was able to determine the
correspondence of port numbers to various names.  Here's what I get them
to be:

exception port 1
bootstrap port 2
thread reply port 3
task port 4
name server port 5
thread port 9


What gives with the extra 6 ports?  What are they used for?  Why is task_self()
masked by preprocessor macros so that it is actually a variable task_self_
located in the shared libraries _DATA segment?  Who puts all these ports
into a task?

-- 
Technical Details
Message-ID: <1992Apr8.032349.1765@nugget.rmNUG.ORG>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!nugget.rmNUG.ORG!bediger

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!nugget.rmNUG.ORG!bediger
From: bediger@nugget.rmnug.org (Bruce Ediger)
Subject: what are all the ports for?
Message-ID: <1992Apr8.032349.1765@nugget.rmNUG.ORG>
Sender: bediger@nugget.rmNUG.ORG (Bruce Ediger)
Organization: Rocky Mountain NeXT Users' Group
Date: Wed, 8 Apr 1992 03:23:49 GMT