The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
A NEW version of "boot: cannot open kernel/sparcv9/unix " biea SUN Solaris 6 10-01-2008 10:22 AM
add seconds to: date"|"time"|"HHMMSS anaconga UNIX for Advanced & Expert Users 3 08-27-2008 01:17 PM
Linux Kernel "make xconfig" Enhancement Patch take3-11 (Default branch) iBot Software Releases - RSS News 0 08-06-2008 01:20 PM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
What is meant by Kernel Parameter "dflssiz" in Digital Unix (OSF) sameerdes UNIX for Dummies Questions & Answers 2 07-08-2003 12:40 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-25-2009
nati nati is offline
Registered User
  
 

Join Date: Aug 2009
Posts: 1
Unhappy getting the "seconds since epoch" in HP-UX kernel

Hi!
I’m writing a kernel module on HP-UX 11.23,
and I can’t find how to get the “number of seconds since epoch” (midnight of Jan 1st 1970).
Actually I’m trying to find an equivalent to the user-space “time()” function…
I found that in Linux, one can access “xtime.tv_sec” in the kernel and get the desired value, but
I can’t seem to find it in HP-UX.

Can anyone help?
Thanks!
  #2 (permalink)  
Old 08-27-2009
rene_metaal rene_metaal is offline
Registered User
  
 

Join Date: Jul 2002
Posts: 24
Hi Nati,
I only know how to get the seconds and number of days... Pls see the script below.
Regards,
René
--------------------------------------------------------------------------
#! /bin/ksh
#epoch sec after 1.1.1970
integer EPOCH=$(date -j -f "%a %b %d %T %Z %Y" "$(date)" "+%s")
DAYSSINCE1970=$(( EPOCH % 86400 ))
echo "DAYSSINCE1970=${DAYSSINCE1970}"
Sponsored Links
Reply

Bookmarks

Tags
epoch, hp-ux, kernel, time

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:55 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0