/[hurd]/hurd/libshouldbeinlibc/portinfo.c
ViewVC logotype

Diff of /hurd/libshouldbeinlibc/portinfo.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by roland, Sun Jul 11 19:56:24 1999 UTC revision 1.7 by roland, Wed May 8 09:24:24 2002 UTC
# Line 1  Line 1 
1  /* Print information about a task's ports  /* Print information about a task's ports
2    
3     Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.     Copyright (C) 1996,98,99,2002 Free Software Foundation, Inc.
4       Written by Miles Bader <miles@gnu.org>
    Written by Miles Bader <miles@gnu.ai.mit.edu>  
5    
6     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
7     modify it under the terms of the GNU General Public License as     modify it under the terms of the GNU General Public License as
# Line 44  print_port_info (mach_port_t name, mach_ Line 43  print_port_info (mach_port_t name, mach_
43        mach_port_urefs_t refs;        mach_port_urefs_t refs;
44        error_t err = mach_port_get_refs (task, name, right, &refs);        error_t err = mach_port_get_refs (task, name, right, &refs);
45        if (! err)        if (! err)
46          fprintf (stream, " (refs: %u)", refs);          fprintf (stream, " (refs: %zu)", refs);
47      }      }
48    
49    if (type == 0)    if (type == 0)
# Line 54  print_port_info (mach_port_t name, mach_ Line 53  print_port_info (mach_port_t name, mach_
53          return err;          return err;
54      }      }
55    
56    fprintf (stream, hex_names ? "%#6x: " : "%6d: ", name);    fprintf (stream, hex_names ? "%#6zx: " : "%6zd: ", name);
57    
58    if (type & MACH_PORT_TYPE_RECEIVE)    if (type & MACH_PORT_TYPE_RECEIVE)
59      {      {
# Line 69  print_port_info (mach_port_t name, mach_ Line 68  print_port_info (mach_port_t name, mach_
68                fprintf (stream, " (");                fprintf (stream, " (");
69                if (status.mps_pset != MACH_PORT_NULL)                if (status.mps_pset != MACH_PORT_NULL)
70                  fprintf (stream,                  fprintf (stream,
71                           hex_names ? "port-set: %#x, " : "port-set: %d, ",                           hex_names ? "port-set: %#zx, " : "port-set: %zd, ",
72                           status.mps_pset);                           status.mps_pset);
73                fprintf (stream, "seqno: %u", status.mps_seqno);                fprintf (stream, "seqno: %zu", status.mps_seqno);
74                if (status.mps_mscount)                if (status.mps_mscount)
75                  fprintf (stream, ", ms-count: %u", status.mps_mscount);                  fprintf (stream, ", ms-count: %zu", status.mps_mscount);
76                if (status.mps_qlimit != MACH_PORT_QLIMIT_DEFAULT)                if (status.mps_qlimit != MACH_PORT_QLIMIT_DEFAULT)
77                  fprintf (stream, ", qlimit: %u", status.mps_qlimit);                  fprintf (stream, ", qlimit: %zu", status.mps_qlimit);
78                if (status.mps_msgcount)                if (status.mps_msgcount)
79                  fprintf (stream, ", msgs: %u", status.mps_msgcount);                  fprintf (stream, ", msgs: %zu", status.mps_msgcount);
80                fprintf (stream, "%s%s%s)",                fprintf (stream, "%s%s%s)",
81                         status.mps_srights ? ", send-rights" : "",                         status.mps_srights ? ", send-rights" : "",
82                         status.mps_pdrequest ? ", pd-req" : "",                         status.mps_pdrequest ? ", pd-req" : "",
# Line 120  print_port_info (mach_port_t name, mach_ Line 119  print_port_info (mach_port_t name, mach_
119                  fprintf (stream, " (empty)");                  fprintf (stream, " (empty)");
120                else                else
121                  {                  {
122                    fprintf (stream, hex_names ? " (%#x" : " (%u", members[0]);                    fprintf (stream, hex_names ? " (%#zx" : " (%zu", members[0]);
123                    for (i = 1; i < members_len; i++)                    for (i = 1; i < members_len; i++)
124                      fprintf (stream, hex_names ? ", %#x" : ", %u", members[i]);                      fprintf (stream, hex_names ? ", %#zx" : ", %zu",
125                                 members[i]);
126                    fprintf (stream, ")");                    fprintf (stream, ")");
127                    munmap ((caddr_t) members, members_len * sizeof *members);                    munmap ((caddr_t) members, members_len * sizeof *members);
128                  }                  }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26