summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrhodes <trhodes@FreeBSD.org>2005-12-24 22:22:17 +0000
committertrhodes <trhodes@FreeBSD.org>2005-12-24 22:22:17 +0000
commit412f766852e2da36b4f178232cadb20dda832f61 (patch)
tree99de98c38a690d4ece3fe809f6493bae7a25e39b
parent130f918f03cc5185b2ae0c0a13e639fbe38250bf (diff)
downloadFreeBSD-src-412f766852e2da36b4f178232cadb20dda832f61.zip
FreeBSD-src-412f766852e2da36b4f178232cadb20dda832f61.tar.gz
Make tv_sec a time_t on all platforms but alpha. Brings us more in line with
POSIX. This also makes the struct correct we ever implement an i386-time64 architecture. Not that we need too. Reviewed by: imp, brooks Approved by: njl (acpica), des (no objects, touches procfs) Tested with: make universe
-rw-r--r--libexec/bootpd/bootpd.c5
-rw-r--r--sys/dev/acpica/Osd/OsdSynch.c4
-rw-r--r--sys/dev/firewire/sbp.c4
-rw-r--r--sys/fs/procfs/procfs_status.c8
-rw-r--r--sys/sys/_timeval.h6
5 files changed, 16 insertions, 11 deletions
diff --git a/libexec/bootpd/bootpd.c b/libexec/bootpd/bootpd.c
index 239b267..b0a49b5 100644
--- a/libexec/bootpd/bootpd.c
+++ b/libexec/bootpd/bootpd.c
@@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$");
#include <paths.h>
#include <syslog.h>
#include <assert.h>
+#include <inttypes.h>
#ifdef NO_SETSID
# include <fcntl.h> /* for O_RDONLY, etc */
@@ -535,8 +536,8 @@ main(argc, argv)
}
if (!FD_ISSET(s, &readfds)) {
if (debug > 1)
- report(LOG_INFO, "exiting after %ld minutes of inactivity",
- actualtimeout.tv_sec / 60);
+ report(LOG_INFO, "exiting after %jd minutes of inactivity",
+ (intmax_t)actualtimeout.tv_sec / 60);
exit(0);
}
ra_len = sizeof(recv_addr);
diff --git a/sys/dev/acpica/Osd/OsdSynch.c b/sys/dev/acpica/Osd/OsdSynch.c
index 659b6fb..6cc6bcf 100644
--- a/sys/dev/acpica/Osd/OsdSynch.c
+++ b/sys/dev/acpica/Osd/OsdSynch.c
@@ -257,8 +257,8 @@ AcpiOsWaitSemaphore(ACPI_HANDLE Handle, UINT32 Units, UINT16 Timeout)
tmo = 1;
if (acpi_semaphore_debug) {
- printf("%s: Wakeup timeleft(%lu, %lu), tmo %u, sem %p, thread %d\n",
- __func__, timelefttv.tv_sec, timelefttv.tv_usec, tmo, as,
+ printf("%s: Wakeup timeleft(%jd, %lu), tmo %u, sem %p, thread %d\n",
+ __func__, (intmax_t)timelefttv.tv_sec, timelefttv.tv_usec, tmo, as,
AcpiOsGetThreadId());
}
}
diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c
index c2f8e4f..51e93c9 100644
--- a/sys/dev/firewire/sbp.c
+++ b/sys/dev/firewire/sbp.c
@@ -698,8 +698,8 @@ sbp_login(struct sbp_dev *sdev)
if (t.tv_sec >= 0 && t.tv_usec > 0)
ticks = (t.tv_sec * 1000 + t.tv_usec / 1000) * hz / 1000;
SBP_DEBUG(0)
- printf("%s: sec = %ld usec = %ld ticks = %d\n", __func__,
- t.tv_sec, t.tv_usec, ticks);
+ printf("%s: sec = %jd usec = %ld ticks = %d\n", __func__,
+ (intmax_t)t.tv_sec, t.tv_usec, ticks);
END_DEBUG
callout_reset(&sdev->login_callout, ticks,
sbp_login_callout, (void *)(sdev));
diff --git a/sys/fs/procfs/procfs_status.c b/sys/fs/procfs/procfs_status.c
index 1579037..95f2b17 100644
--- a/sys/fs/procfs/procfs_status.c
+++ b/sys/fs/procfs/procfs_status.c
@@ -132,10 +132,10 @@ procfs_doprocstatus(PFS_FILL_ARGS)
calcru(p, &ut, &st);
start = p->p_stats->p_start;
timevaladd(&start, &boottime);
- sbuf_printf(sb, " %ld,%ld %ld,%ld %ld,%ld",
- start.tv_sec, start.tv_usec,
- ut.tv_sec, ut.tv_usec,
- st.tv_sec, st.tv_usec);
+ sbuf_printf(sb, " %jd,%ld %jd,%ld %jd,%ld",
+ (intmax_t)start.tv_sec, start.tv_usec,
+ (intmax_t)ut.tv_sec, ut.tv_usec,
+ (intmax_t)st.tv_sec, st.tv_usec);
} else {
sbuf_printf(sb, " -1,-1 -1,-1 -1,-1");
}
diff --git a/sys/sys/_timeval.h b/sys/sys/_timeval.h
index d9ea6f5..2a51d2f 100644
--- a/sys/sys/_timeval.h
+++ b/sys/sys/_timeval.h
@@ -45,7 +45,11 @@ typedef __time_t time_t;
* Structure returned by gettimeofday(2) system call, and used in other calls.
*/
struct timeval {
- long tv_sec; /* seconds (XXX should be time_t) */
+#ifdef __alpha__
+ long tv_sec; /* seconds */
+#else
+ time_t tv_sec; /* seconds */
+#endif
suseconds_t tv_usec; /* and microseconds */
};
OpenPOWER on IntegriCloud