From owner-freebsd-questions@FreeBSD.ORG Thu Jan 21 17:03:00 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97554106566B for ; Thu, 21 Jan 2010 17:03:00 +0000 (UTC) (envelope-from cronfy@gmail.com) Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by mx1.freebsd.org (Postfix) with ESMTP id 2FA0E8FC12 for ; Thu, 21 Jan 2010 17:02:59 +0000 (UTC) Received: by fxm10 with SMTP id 10so208117fxm.34 for ; Thu, 21 Jan 2010 09:02:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=45phmp60J40d+Sa2z8lRJ8+DZdZs1RTezl9oiQk7xOE=; b=nKifgxawmlcg3LVSJy7y/G/dYpaV9JP4xygE/9HOmo1C5pncUHXn7lKNOYHZhxs2I5 LLnbU0HAv+S3YbAtdXYN5v+idsfRg2FVPx6vN4smaq5AuYQC4HwOovBGRGzrN5ddi5lh vV5KOq6pvK2igjItuOOX/mQJ7dpGcYqNg4naA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=AFT5CwzXnKmpbZWBGgZh4ZYcU3chMJsyO9FpEJOV5nxfaPmIuQ/ADZQ/dq5+XGuy89 71sLjvMZUGfACgbcTO2pxbMQnd7SFrWWfwRWBREgFyxp+aIAqyydzpce48PPCnIf1+Pg ZUMfcI23ghUsz76iyx3YWvRjaUMaOEIiCkGgo= MIME-Version: 1.0 Received: by 10.223.4.216 with SMTP id 24mr1685208fas.67.1264093379198; Thu, 21 Jan 2010 09:02:59 -0800 (PST) From: cronfy Date: Thu, 21 Jan 2010 20:02:39 +0300 Message-ID: To: freebsd-questions Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Unique id of a process (not pid) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 17:03:00 -0000 Hello, Is there any unique identifier of a process in FreeBSD (not PID)? I am trying to get list of processes and watch for changes with kvm_getprocs(). I want to catch every process start and exit (except those processes that were started and finished between calls to kvm_getprocs()). But between calls to this function one process may exit and be replaced with another process with the same pid and same command name. The only difference is a start time of processes. Looks like this is a solution, but process start time may change if system time was shifted (i. e. with ntpdate). I can track these shifts too, but it looks to be too complex. Is there any simpler way to identify a process? Thanks in advance. -- // cronfy