From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,4c06a816f2164b37,start X-Google-Attributes: gidf678f,public From: kenm@u.washington.edu (Ken Marquess) Subject: getting time and pid in kernel? Date: 1996/01/31 Message-ID: <4eo9vc$41@nntp5.u.washington.edu>#1/1 X-Deja-AN: 137366468 organization: University of Washington, Seattle nntp-posting-user: kenm newsgroups: comp.unix.osf.misc Executive summary: I'm having problems determining the process id and time of day from a kernel process, specifically a device driver top half. If you know how to do either, I'd like to talk to you! Details: I'm trying to port/rewrite a driver (from AIX) for a pseudodevice. The pseudodevice forms a pair of devices (kind of like tty/pty pairs) that are used to support a remote tape drive (i.e. there is a local pseudo device that emulates a tape drive, and sends the data to/from a real drive on another system. In the device drivers, I write a trace table for diagnostic purposes, which includes the time of day and pid. Aix supplied a getpid() that worked in kernel mode, and a global variable called 'time' that was the current time. When I call getpid() in DEC OSF/Digital Unix (3.2.C if it matters) the system abends. sys/time.h has some lines that imply there ought to be a global variable called time, but I haven't figured out the right loader flags or something - I never get a value other than 0. I've looked through the kernel source a little, without finding any good examples to copy. If anyone can help, I'd appreciate it. The software will be available for free when completed. Ken Marquess, University of Washington, kenm@u.washington.edu