--- projects/libstatgrab/examples/process_snapshot.c 2004/04/07 15:50:25 1.9 +++ projects/libstatgrab/examples/process_snapshot.c 2004/04/08 13:16:04 1.10 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id: process_snapshot.c,v 1.9 2004/04/07 15:50:25 tdb Exp $ + * $Id: process_snapshot.c,v 1.10 2004/04/08 13:16:04 ats Exp $ */ #include @@ -46,6 +46,8 @@ int main(){ fprintf(stderr, "Failed to get process snapshot\n"); exit(1); } + + qsort(ps, ps_size, sizeof *ps, sg_process_compare_pid); printf("%5s %5s %5s %5s %5s %5s %5s %6s %6s %9s %-10s %-4s %-8s %-20s %s\n", "pid", "ppid", "pgid", "uid", "euid", "gid", "egid", "size", "res", "time", "cpu", "nice", "state", "name", "title");