🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
1 messages
1 total messages Started by Bruce Ediger Wed, 08 Apr 1992 03:23
what are all the ports for?
#568
Author: 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?

-- 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads