I can tell you how to fix this bug;  but the attached fragment of code is
probably in the wrong place.

All the calls to mach_task_self() are mapped by the defines to simple variable
__mach_task_self.  There is no funtion call to initialise the variable.  I
have run nm though the object on both new Hurd  and old Hurd, to show this.

To get the Hurd running with gcc 2-95 I did  (proc/main.c) :

main (int argc, char **argv, char **envp)
{
  mach_port_t boot;
  error_t err;
  mach_port_t pset, psetcntl;
  void *genport;
  process_t startup_port;
  struct argp argp = { 0, 0, 0, "Hurd process server" };

  argp_parse (&argp, argc, argv, 0, 0, 0);

  initialize_version_info ();

  #undef  mach_task_self()

  err = task_get_bootstrap_port ( mach_task_self() , &boot);  /* Function
call  */

  #define mach_task_self()    __mach_task_self()

  assert_perror (err);
  if (boot == MACH_PORT_NULL)
    error (2, 0, "proc server can only be run by init during boot");

  proc_bucket = ports_create_bucket ();
  proc_class = ports_create_class (0, 0);

The lines:

 #undef  mach_task_self()

  err = task_get_bootstrap_port ( mach_task_self() , &boot);  /* Function
call  */

  #define mach_task_self()    __mach_task_self()

are different.

the program ext2fs calls mach_port_self so the modification perhaps belongs
there.  The still leaves the mystery as to how old Hurd initialises the
variable

Chris

Reply via email to